- Timestamp:
- Apr 22, 2007 12:48:30 PM (18 years ago)
- Location:
- pjproject/branches/split-3rd-party
- Files:
-
- 20 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/split-3rd-party/Makefile
r1202 r1210 57 57 done 58 58 59 prefix = /usr/local 60 install: 61 mkdir -p $(DESTDIR)$(prefix)/lib 62 cp -L $$(find . -name '*.a') $(DESTDIR)$(prefix)/lib 63 mkdir -p $(DESTDIR)$(prefix)/include 64 cp -RL $$(find . -name include) $(DESTDIR)$(prefix) 65 cd $(DESTDIR)$(prefix)/lib && for i in $$(find . -name 'libpj*a'); do\ 66 ln -s $$i $$(echo $$i | sed -e "s/-$(TARGET_NAME)//");\ 67 done 68 mkdir -p $(DESTDIR)$(prefix)/lib/pkgconfig 69 sed -e "s!@PREFIX@!$(DESTDIR)$(prefix)!" libpj.pc.in > $(DESTDIR)/$(prefix)/lib/pkgconfig/libpj.pc -
pjproject/branches/split-3rd-party/pjlib-util/src/pjlib-util/scanner.c
r1145 r1210 343 343 pj_str_t *out) 344 344 { 345 pj_scan_get_quotes(scanner, (char*)&begin_quote, (char*)&end_quote, 1, out); 345 char beg = (char)begin_quote; 346 char end = (char)end_quote; 347 pj_scan_get_quotes(scanner, &beg, &end, 1, out); 346 348 } 347 349 -
pjproject/branches/split-3rd-party/pjlib/include/pj/string.h
r974 r1210 519 519 520 520 /** 521 * Convert strings to an unsigned long-integer value. 522 * This function stops reading the string input either when the number 523 * of characters has exceeded the length of the input or it has read 524 * the first character it cannot recognize as part of a number, that is 525 * a character greater than or equal to base. 526 * 527 * @param str The input string. 528 * @param endptr Optional pointer to receive the remainder/unparsed 529 * portion of the input. 530 * @param base Number base to use. 531 * 532 * @return the unsigned integer number. 533 */ 534 PJ_DECL(unsigned long) pj_strtoul2(const pj_str_t *str, pj_str_t *endptr, 535 unsigned base); 536 537 /** 521 538 * Utility to convert unsigned integer to string. Note that the 522 539 * string will be NULL terminated. -
pjproject/branches/split-3rd-party/pjlib/src/pj/hash.c
r974 r1210 134 134 if (hval && *hval != 0) { 135 135 hash = *hval; 136 if (keylen==PJ_HASH_KEY_STRING) { 137 keylen = pj_ansi_strlen((const char*)key); 138 } 136 139 } else { 137 140 /* This slightly differs with pj_hash_calc() because we need -
pjproject/branches/split-3rd-party/pjlib/src/pj/string.c
r1125 r1210 18 18 */ 19 19 #include <pj/string.h> 20 #include <pj/assert.h> 20 21 #include <pj/pool.h> 21 22 #include <pj/ctype.h> … … 84 85 } 85 86 87 PJ_DEF(unsigned long) pj_strtoul2(const pj_str_t *str, pj_str_t *endptr, 88 unsigned base) 89 { 90 unsigned long value; 91 unsigned i; 92 93 PJ_CHECK_STACK(); 94 95 value = 0; 96 if (base <= 10) { 97 for (i=0; i<(unsigned)str->slen; ++i) { 98 unsigned c = (str->ptr[i] - '0'); 99 if (c >= base) 100 break; 101 value = value * base + c; 102 } 103 } else if (base == 16) { 104 for (i=0; i<(unsigned)str->slen; ++i) { 105 if (!pj_isxdigit(str->ptr[i])) 106 break; 107 value = value * 16 + pj_hex_digit_to_val(str->ptr[i]); 108 } 109 } else { 110 pj_assert(!"Unsupported base"); 111 i = 0; 112 value = 0xFFFFFFFFUL; 113 } 114 115 if (endptr) { 116 endptr->ptr = str->ptr + i; 117 endptr->slen = str->slen - i; 118 } 119 120 return value; 121 } 122 86 123 PJ_DEF(int) pj_utoa(unsigned long val, char *buf) 87 124 { -
pjproject/branches/split-3rd-party/pjlib/src/pjlib-test/string.c
r974 r1210 49 49 * - pj_utoa() 50 50 * - pj_strtoul() 51 * - pj_strtoul2() 51 52 * - pj_create_random_string() 52 53 * - ... and mode.. … … 359 360 return -280; 360 361 362 /* 363 * pj_strtoul2() 364 */ 365 s5 = pj_str("123456"); 366 367 pj_strtoul2(&s5, NULL, 10); /* Crash test */ 368 369 if (pj_strtoul2(&s5, &s4, 10) != 123456UL) 370 return -290; 371 if (s4.slen != 0) 372 return -291; 373 if (pj_strtoul2(&s5, &s4, 16) != 0x123456UL) 374 return -292; 375 376 s5 = pj_str("0123ABCD"); 377 if (pj_strtoul2(&s5, &s4, 10) != 123) 378 return -293; 379 if (s4.slen != 4) 380 return -294; 381 if (s4.ptr == NULL || *s4.ptr != 'A') 382 return -295; 383 if (pj_strtoul2(&s5, &s4, 16) != 0x123ABCDUL) 384 return -296; 385 if (s4.slen != 0) 386 return -297; 387 361 388 /* 362 389 * pj_create_random_string() -
pjproject/branches/split-3rd-party/pjmedia/include/pjmedia/alaw_ulaw.h
r974 r1210 21 21 22 22 #include <pjmedia/types.h> 23 24 PJ_BEGIN_DECL 23 25 24 26 #if defined(PJMEDIA_HAS_ALAW_ULAW_TABLE) && PJMEDIA_HAS_ALAW_ULAW_TABLE!=0 … … 135 137 PJ_DECL(unsigned char) pjmedia_ulaw2alaw(unsigned char uval); 136 138 137 138 139 #endif 139 140 141 PJ_END_DECL 140 142 141 143 #endif /* __PJMEDIA_ALAW_ULAW_H__ */ -
pjproject/branches/split-3rd-party/pjmedia/src/pjmedia/alaw_ulaw.c
r838 r1210 155 155 PJ_DEF(int) 156 156 pjmedia_alaw2linear( 157 unsigned chara_val)157 unsigned a_val) 158 158 { 159 159 int t; -
pjproject/branches/split-3rd-party/pjmedia/src/pjmedia/sdp.c
r974 r1210 139 139 { 140 140 unsigned i; 141 unsigned c_pt = 0xFFFF; 142 143 if (c_fmt) 144 c_pt = pj_strtoul(c_fmt); 141 145 142 146 for (i=0; i<count; ++i) { … … 144 148 const pjmedia_sdp_attr *a = attr_array[i]; 145 149 if (c_fmt) { 146 if (a->value.slen > c_fmt->slen && 147 pj_strncmp(&a->value, c_fmt, c_fmt->slen)==0) 148 { 150 unsigned pt = (unsigned) pj_strtoul2(&a->value, NULL, 10); 151 if (pt == c_pt) { 149 152 return (pjmedia_sdp_attr*)a; 150 153 } -
pjproject/branches/split-3rd-party/pjnath/build/Makefile
r1201 r1210 11 11 PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) 12 12 PJNATH_LIB:=../../pjnath/lib/libpjnath-$(TARGET_NAME)$(LIBEXT) 13 export PJNATH_LIB:=../lib/libpjnath-$(TARGET_NAME)$(LIBEXT)14 13 15 14 ############################################################################### … … 28 27 29 28 ############################################################################### 30 # Defines for building PJ LIB-UTILlibrary29 # Defines for building PJNATH library 31 30 # 32 31 export PJNATH_SRCDIR = ../src/pjnath … … 46 45 47 46 47 ############################################################################### 48 # Defines for building test client application 49 # 50 export PJSTUN_CLIENT_SRCDIR = ../src/pjstun-client 51 export PJSTUN_CLIENT_OBJS += client_main.o 52 export PJSTUN_CLIENT_CFLAGS += $(_CFLAGS) 53 export PJSTUN_CLIENT_LDFLAGS += $(_LDFLAGS) 54 export PJSTUN_CLIENT_EXE:=../bin/pjstun-client-$(TARGET_NAME)$(HOST_EXE) 55 56 ############################################################################### 57 # Defines for building test server application 58 # 59 export PJSTUN_SRV_TEST_SRCDIR = ../src/pjstun-srv-test 60 export PJSTUN_SRV_TEST_OBJS += bind_usage.o server.o turn_usage.o usage.o \ 61 main.o 62 export PJSTUN_SRV_TEST_CFLAGS += $(_CFLAGS) 63 export PJSTUN_SRV_TEST_LDFLAGS += $(_LDFLAGS) 64 export PJSTUN_SRV_TEST_EXE:=../bin/pjstun-srv-test-$(TARGET_NAME)$(HOST_EXE) 65 66 67 48 68 export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT 49 69 ############################################################################### … … 52 72 # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. 53 73 # 54 TARGETS := pjnath pjnath-test 74 TARGETS := pjnath pjnath-test pjstun-client pjstun-srv-test 55 75 56 76 all: $(TARGETS) … … 69 89 pjnath-test: $(PJLIB_LIB) $(PJLIB_UTIL_LIB) $(PJNATH_LIB) 70 90 $(MAKE) -f $(RULES_MAK) APP=PJNATH_TEST app=pjnath-test $(PJNATH_TEST_EXE) 91 92 pjstun-client: $(PJLIB_LIB) $(PJLIB_UTIL_LIB) $(PJNATH_LIB) 93 $(MAKE) -f $(RULES_MAK) APP=PJSTUN_CLIENT app=pjstun-client $(PJSTUN_CLIENT_EXE) 94 95 pjstun-srv-test: $(PJLIB_LIB) $(PJLIB_UTIL_LIB) $(PJNATH_LIB) 96 $(MAKE) -f $(RULES_MAK) APP=PJSTUN_SRV_TEST app=pjstun-srv-test $(PJSTUN_SRV_TEST_EXE) 71 97 72 98 .PHONY: ../lib/pjnath.ko -
pjproject/branches/split-3rd-party/pjnath/src/pjnath/ice_session.c
r1157 r1210 550 550 char tmp[128]; 551 551 552 PJ_ASSERT_RETURN(ice && comp_id && local_pref &&552 PJ_ASSERT_RETURN(ice && comp_id && 553 553 foundation && addr && base_addr && addr_len, 554 554 PJ_EINVAL); -
pjproject/branches/split-3rd-party/pjnath/src/pjnath/ice_strans.c
r1154 r1210 213 213 { 214 214 pj_ice_strans_cand *cand; 215 unsigned i; 215 216 216 217 PJ_ASSERT_RETURN(ice_st && comp && addr, PJ_EINVAL); 217 218 PJ_ASSERT_RETURN(comp->cand_cnt < PJ_ICE_ST_MAX_CAND, PJ_ETOOMANY); 219 220 /* Check that we don't have candidate with the same 221 * address. 222 */ 223 for (i=0; i<comp->cand_cnt; ++i) { 224 if (pj_memcmp(addr, &comp->cand_list[i].addr, 225 sizeof(pj_sockaddr_in))==0) 226 { 227 /* Duplicate */ 228 PJ_LOG(5,(ice_st->obj_name, "Duplicate candidate not added")); 229 return PJ_SUCCESS; 230 } 231 } 218 232 219 233 cand = &comp->cand_list[comp->cand_cnt]; … … 226 240 cand->local_pref = local_pref; 227 241 pj_ice_calc_foundation(ice_st->pool, &cand->foundation, type, 228 (const pj_sockaddr*)addr);242 &comp->local_addr); 229 243 230 244 if (set_default) -
pjproject/branches/split-3rd-party/pjnath/src/pjstun-client/client_main.c
r1152 r1210 67 67 68 68 69 static my_perror(const char *title, pj_status_t status)69 static void my_perror(const char *title, pj_status_t status) 70 70 { 71 71 char errmsg[PJ_ERR_MSG_SIZE]; … … 146 146 if (n > 0) { 147 147 if (PJ_FD_ISSET(g.sock, &readset)) { 148 charbuffer[512];148 pj_uint8_t buffer[512]; 149 149 pj_ssize_t len; 150 150 pj_sockaddr_in addr; … … 427 427 &g.peer_addr, sizeof(g.peer_addr)); 428 428 pj_stun_msg_add_binary_attr(tdata->pool, tdata->msg, 429 PJ_STUN_ATTR_DATA, g.data, len);429 PJ_STUN_ATTR_DATA, (pj_uint8_t*)g.data, len); 430 430 431 431 rc = pj_stun_session_send_msg(g.sess, PJ_FALSE, … … 521 521 printf("Input peer address in IP:PORT format: "); 522 522 fflush(stdout); 523 gets(addr);523 fgets(addr, sizeof(addr), stdin); 524 524 525 525 if (parse_addr(addr, &g.peer_addr) != PJ_SUCCESS) { … … 562 562 } else if (input[0]=='d' && input[1]=='t') { 563 563 printf("Input data: "); 564 gets(g.data);564 fgets(g.data, sizeof(g.data_buf), stdin); 565 565 566 566 } else if (input[0]=='p' && input[1]=='r') { -
pjproject/branches/split-3rd-party/pjsip-apps/src/pjsua/pjsua_app.c
r1135 r1210 321 321 int c; 322 322 int option_index; 323 enum { OPT_CONFIG_FILE , OPT_LOG_FILE, OPT_LOG_LEVEL, OPT_APP_LOG_LEVEL,323 enum { OPT_CONFIG_FILE=127, OPT_LOG_FILE, OPT_LOG_LEVEL, OPT_APP_LOG_LEVEL, 324 324 OPT_HELP, OPT_VERSION, OPT_NULL_AUDIO, 325 325 OPT_LOCAL_PORT, OPT_IP_ADDR, OPT_PROXY, OPT_OUTBOUND_PROXY, … … 880 880 PJ_LOG(1,(THIS_FILE, 881 881 "Argument \"%s\" is not valid. Use --help to see help", 882 argv[pj_optind ]));882 argv[pj_optind-1])); 883 883 return -1; 884 884 } -
pjproject/branches/split-3rd-party/pjsip/include/pjsip/sip_transaction.h
r974 r1210 75 75 76 76 /** 77 * Transaction timeout timer policy, to control the UAC transaction timeout78 * scheduling (see #pjsip_tsx_set_uac_timeout()).79 */80 typedef enum pjsip_tsx_timeout_policy81 {82 PJSIP_TSX_IGNORE_100 = 1, /**< To make the UAC transaction NOT to cancel83 the timeout timer when 100 response is84 received.*/85 PJSIP_TSX_IGNORE_1xx = 3 /**< To make the UAC transaction NOT to cancel86 the timeout timer when any 1xx responses87 are received. */88 } pjsip_tsx_timeout_policy;89 90 91 /**92 77 * This structure describes SIP transaction object. The transaction object 93 78 * is used to handle both UAS and UAC transaction. … … 146 131 pj_timer_entry timeout_timer; /**< Timeout timer. */ 147 132 148 unsigned msec_timeout; /**< User set timeout. */149 pjsip_tsx_timeout_policy timeout_policy; /**< Timeout policy. */150 151 133 /** Module specific data. */ 152 134 void *mod_data[PJSIP_MAX_MODULE]; … … 249 231 const pjsip_tpselector *sel); 250 232 251 252 /**253 * Set the UAC absolute transaction timeout. Normally UAC transaction will254 * stop its timeout timer (timer B for INVITE and timer F for non-INVITE255 * transactions) after a provisional response is received.256 *257 * When this timer is set, the transaction's timer B and F will use this258 * value, and if the \a flag flag is set, the transaction will continue259 * the scheduling of the timeout timer even when provisional response has260 * been received.261 *262 * Note that this function MUST be called AFTER the transaction has been263 * created AND BEFORE any request is transmitted.264 *265 * @param tsx The client/UAC transaction.266 * @param msec_time The timeout value, in miliseconds. Currently this267 * value must be non-zero (value zero is reserved for268 * future use).269 * @param flag Option flags to control whether the transaction should270 * cancel the timeout timer on arrival of provisional271 * responses (which is yes according to RFC 3261).272 * The valid values are:273 * - PJSIP_TSX_IGNORE_100, to make the UAC transaction274 * NOT to cancel the timeout timer when 100 response275 * is received.276 * - PJSIP_TSX_IGNORE_1xx, to make the UAC transaction277 * NOT to cancel the timeout timer when any 1xx278 * responses are received.279 *280 * Note that regardless of the values in the \a flag281 * argument, the provisional response would still be282 * delivered to transaction user and it will still283 * affect the transaction state. The \a flag flag only284 * changes the behavior of the timeout timer of the285 * transaction.286 */287 PJ_DECL(pj_status_t) pjsip_tsx_set_uac_timeout(pjsip_transaction *tsx,288 unsigned msec_time,289 pjsip_tsx_timeout_policy flag);290 291 292 233 /** 293 234 * Call this function to manually feed a message to the transaction. -
pjproject/branches/split-3rd-party/pjsip/include/pjsua-lib/pjsua.h
r1177 r1210 914 914 915 915 /** 916 * Specify STUN server to be used. 916 * Specify STUN server to be used, in "HOST[:PORT]" format. If port is 917 * not specified, default port 3478 will be used. 917 918 */ 918 919 pj_str_t stun_host; -
pjproject/branches/split-3rd-party/pjsip/src/pjsip/sip_transaction.c
r1079 r1210 133 133 static const pj_time_val t1_timer_val = { PJSIP_T1_TIMEOUT/1000, 134 134 PJSIP_T1_TIMEOUT%1000 }; 135 static const pj_time_val t2_timer_val = { PJSIP_T2_TIMEOUT/1000, 136 PJSIP_T2_TIMEOUT%1000 }; 135 137 static const pj_time_val t4_timer_val = { PJSIP_T4_TIMEOUT/1000, 136 138 PJSIP_T4_TIMEOUT%1000 }; … … 1397 1399 1398 1400 /* 1399 * Set the UAC absolute transaction timeout.1400 */1401 PJ_DEF(pj_status_t) pjsip_tsx_set_uac_timeout(pjsip_transaction *tsx,1402 unsigned msec_time,1403 pjsip_tsx_timeout_policy policy)1404 {1405 PJ_ASSERT_RETURN(tsx && tsx->role==PJSIP_ROLE_UAC &&1406 tsx->state==PJSIP_TSX_STATE_NULL, PJ_EINVALIDOP);1407 1408 tsx->msec_timeout = msec_time;1409 tsx->timeout_policy = policy;1410 1411 return PJ_SUCCESS;1412 }1413 1414 1415 /*1416 1401 * Set transaction status code and reason. 1417 1402 */ … … 1810 1795 pj_assert((tsx->transport_flag & TSX_HAS_PENDING_TRANSPORT) == 0); 1811 1796 1812 msec_time = (1 << (tsx->retransmit_count)) * PJSIP_T1_TIMEOUT; 1797 if (tsx->role==PJSIP_ROLE_UAC && tsx->status_code >= 100) 1798 msec_time = PJSIP_T2_TIMEOUT; 1799 else 1800 msec_time = (1 << (tsx->retransmit_count)) * PJSIP_T1_TIMEOUT; 1813 1801 1814 1802 if (tsx->role == PJSIP_ROLE_UAC) { 1803 pj_assert(tsx->status_code < 200); 1815 1804 /* Retransmission for non-INVITE transaction caps-off at T2 */ 1816 1805 if (msec_time>PJSIP_T2_TIMEOUT && tsx->method.id!=PJSIP_INVITE_METHOD) … … 1914 1903 1915 1904 /* Start Timer B (or called timer F for non-INVITE) for transaction 1916 * timeout. If user has configured the timeout value with 1917 * pjsip_tsx_set_uac_timeout(), use the timeout value there. 1905 * timeout. 1918 1906 */ 1919 if (tsx->msec_timeout > 0) { 1920 pj_time_val timeout; 1921 1922 timeout.sec = tsx->msec_timeout / 1000; 1923 timeout.msec = tsx->msec_timeout % 1000; 1924 1925 pjsip_endpt_schedule_timer( tsx->endpt, &tsx->timeout_timer, 1926 &timeout); 1927 1928 } else { 1929 pjsip_endpt_schedule_timer( tsx->endpt, &tsx->timeout_timer, 1930 &timeout_timer_val); 1931 } 1907 pjsip_endpt_schedule_timer( tsx->endpt, &tsx->timeout_timer, 1908 &timeout_timer_val); 1932 1909 1933 1910 /* Start Timer A (or timer E) for retransmission only if unreliable … … 2006 1983 return PJSIP_ENOTRESPONSEMSG; 2007 1984 2008 /* Cancel retransmission timer A. */ 2009 if (tsx->retransmit_timer._timer_id != -1) { 2010 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); 2011 tsx->retransmit_timer._timer_id = -1; 2012 } 1985 code = msg->line.status.code; 1986 1987 /* If the response is final, cancel both retransmission and timeout 1988 * timer. 1989 */ 1990 if (code >= 200) { 1991 if (tsx->retransmit_timer._timer_id != -1) { 1992 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); 1993 tsx->retransmit_timer._timer_id = -1; 1994 } 1995 1996 if (tsx->timeout_timer._timer_id != -1) { 1997 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->timeout_timer); 1998 tsx->timeout_timer._timer_id = -1; 1999 } 2000 2001 } else { 2002 /* Cancel retransmit timer (for non-INVITE transaction, the 2003 * retransmit timer will be rescheduled at T2. 2004 */ 2005 if (tsx->retransmit_timer._timer_id != -1) { 2006 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); 2007 tsx->retransmit_timer._timer_id = -1; 2008 } 2009 2010 /* For provisional response, only cancel retransmit when this 2011 * is an INVITE transaction. For non-INVITE, section 17.1.2.1 2012 * of RFC 3261 says that: 2013 * - retransmit timer is set to T2 2014 * - timeout timer F is not deleted. 2015 */ 2016 if (tsx->method.id == PJSIP_INVITE_METHOD) { 2017 2018 /* Cancel timeout timer */ 2019 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->timeout_timer); 2020 2021 } else { 2022 if (!tsx->is_reliable) { 2023 pjsip_endpt_schedule_timer(tsx->endpt, 2024 &tsx->retransmit_timer, 2025 &t2_timer_val); 2026 } 2027 } 2028 } 2029 2013 2030 tsx->transport_flag &= ~(TSX_HAS_PENDING_RESCHED); 2014 2031 2015 2016 /* Cancel timer B (transaction timeout) but look at the timeout policy2017 * as set by pjsip_tsx_set_uac_timeout().2018 */2019 code = msg->line.status.code;2020 if ((code==100 && tsx->timeout_policy==PJSIP_TSX_IGNORE_100) ||2021 (code<200 && tsx->timeout_policy==PJSIP_TSX_IGNORE_1xx))2022 {2023 /* Don't cancel the timeout timer */2024 }2025 else {2026 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->timeout_timer);2027 }2028 2032 2029 2033 /* Discard retransmission message if it is not INVITE. … … 2368 2372 2369 2373 } else { 2370 tsx_set_status_code(tsx, PJSIP_SC_TSX_TIMEOUT, NULL); 2374 if (event->body.timer.entry == &tsx->retransmit_timer) { 2375 /* Retransmit message. */ 2376 pj_status_t status; 2377 2378 status = tsx_retransmit( tsx, 1 ); 2379 2380 return status; 2381 2382 } else { 2383 tsx_set_status_code(tsx, PJSIP_SC_TSX_TIMEOUT, NULL); 2384 } 2371 2385 } 2372 2386 … … 2407 2421 &timeout); 2408 2422 2423 /* Cancel retransmission timer */ 2424 if (tsx->retransmit_timer._timer_id != -1) { 2425 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); 2426 tsx->retransmit_timer._timer_id = -1; 2427 } 2428 2409 2429 /* Move state to Completed, inform TU. */ 2410 2430 tsx_set_state( tsx, PJSIP_TSX_STATE_COMPLETED, -
pjproject/branches/split-3rd-party/pjsip/src/pjsip/sip_util_statefull.c
r974 r1210 95 95 PJ_ASSERT_RETURN(mod_stateful_util.id != -1, PJ_EINVALIDOP); 96 96 97 PJ_UNUSED_ARG(timeout); 97 98 98 99 status = pjsip_tsx_create_uac(&mod_stateful_util, tdata, &tsx); … … 105 106 tsx_data->token = token; 106 107 tsx_data->cb = cb; 107 108 if (timeout >= 0) {109 status = pjsip_tsx_set_uac_timeout(tsx, timeout, PJSIP_TSX_IGNORE_1xx);110 pj_assert(status == PJ_SUCCESS);111 }112 108 113 109 tsx->mod_data[mod_stateful_util.id] = tsx_data; -
pjproject/branches/split-3rd-party/pjsip/src/pjsua-lib/pjsua_core.c
r1179 r1210 679 679 */ 680 680 if (pjsua_var.ua_cfg.stun_host.slen) { 681 pj_str_t str_host, str_port; 682 int port; 681 683 pj_hostent he; 682 684 683 pjsua_var.stun_status = pj_gethostbyname(&pjsua_var.ua_cfg.stun_host, &he); 685 str_port.ptr = pj_strchr(&pjsua_var.ua_cfg.stun_host, ':'); 686 if (str_port.ptr != NULL) { 687 str_host.ptr = pjsua_var.ua_cfg.stun_host.ptr; 688 str_host.slen = (str_port.ptr - str_host.ptr); 689 str_port.ptr++; 690 str_port.slen = pjsua_var.ua_cfg.stun_host.slen - 691 str_host.slen - 1; 692 port = (int)pj_strtoul(&str_port); 693 if (port < 1 || port > 65535) { 694 pjsua_perror(THIS_FILE, "Invalid STUN server", PJ_EINVAL); 695 pjsua_var.stun_status = PJ_EINVAL; 696 return; 697 } 698 } else { 699 str_host = pjsua_var.ua_cfg.stun_host; 700 port = 3478; 701 } 702 703 pjsua_var.stun_status = pj_gethostbyname(&str_host, &he); 684 704 685 705 if (pjsua_var.stun_status == PJ_SUCCESS) { 686 706 pj_sockaddr_in_init(&pjsua_var.stun_srv.ipv4, NULL, 0); 687 707 pjsua_var.stun_srv.ipv4.sin_addr = *(pj_in_addr*)he.h_addr; 688 pjsua_var.stun_srv.ipv4.sin_port = pj_htons((pj_uint16_t) 3478);708 pjsua_var.stun_srv.ipv4.sin_port = pj_htons((pj_uint16_t)port); 689 709 690 710 PJ_LOG(3,(THIS_FILE, … … 773 793 */ 774 794 else if (pjsua_var.ua_cfg.stun_host.slen) { 795 pj_str_t str_host, str_port; 796 int port; 775 797 pj_hostent he; 776 798 777 pjsua_var.stun_status = pj_gethostbyname(&pjsua_var.ua_cfg.stun_host, &he); 799 str_port.ptr = pj_strchr(&pjsua_var.ua_cfg.stun_host, ':'); 800 if (str_port.ptr != NULL) { 801 str_host.ptr = pjsua_var.ua_cfg.stun_host.ptr; 802 str_host.slen = (str_port.ptr - str_host.ptr); 803 str_port.ptr++; 804 str_port.slen = pjsua_var.ua_cfg.stun_host.slen - 805 str_host.slen - 1; 806 port = (int)pj_strtoul(&str_port); 807 if (port < 1 || port > 65535) { 808 pjsua_perror(THIS_FILE, "Invalid STUN server", PJ_EINVAL); 809 pjsua_var.stun_status = PJ_EINVAL; 810 return pjsua_var.stun_status; 811 } 812 } else { 813 str_host = pjsua_var.ua_cfg.stun_host; 814 port = 3478; 815 } 816 817 818 pjsua_var.stun_status = pj_gethostbyname(&str_host, &he); 778 819 779 820 if (pjsua_var.stun_status == PJ_SUCCESS) { 780 821 pj_sockaddr_in_init(&pjsua_var.stun_srv.ipv4, NULL, 0); 781 822 pjsua_var.stun_srv.ipv4.sin_addr = *(pj_in_addr*)he.h_addr; 782 pjsua_var.stun_srv.ipv4.sin_port = pj_htons((pj_uint16_t) 3478);823 pjsua_var.stun_srv.ipv4.sin_port = pj_htons((pj_uint16_t)port); 783 824 784 825 PJ_LOG(3,(THIS_FILE, … … 1056 1097 */ 1057 1098 status = pjstun_get_mapped_addr(&pjsua_var.cp.factory, 1, &sock, 1058 &stun_srv, 3478,1059 &stun_srv, 3478,1099 &stun_srv, pj_ntohs(pjsua_var.stun_srv.ipv4.sin_port), 1100 &stun_srv, pj_ntohs(pjsua_var.stun_srv.ipv4.sin_port), 1060 1101 p_pub_addr); 1061 1102 if (status != PJ_SUCCESS) { -
pjproject/branches/split-3rd-party/pjsip/src/pjsua-lib/pjsua_media.c
r1177 r1210 290 290 291 291 status=pjstun_get_mapped_addr(&pjsua_var.cp.factory, 2, sock, 292 &stun_srv, 3478,293 &stun_srv, 3478,292 &stun_srv, pj_ntohs(pjsua_var.stun_srv.ipv4.sin_port), 293 &stun_srv, pj_ntohs(pjsua_var.stun_srv.ipv4.sin_port), 294 294 mapped_addr); 295 295 if (status != PJ_SUCCESS) {
Note: See TracChangeset
for help on using the changeset viewer.