Changeset 4543
- Timestamp:
- Jun 24, 2013 9:53:16 AM (11 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r4534 r4543 3032 3032 3033 3033 /** 3034 * This option controls whether the IP address in SDP should be replaced 3035 * with the IP address found in Via header of the REGISTER response, ONLY 3036 * when STUN and ICE are not used. If the value is FALSE (the original 3037 * behavior), then the local IP address will be used. If TRUE, and when 3038 * STUN and ICE are disabled, then the IP address found in registration 3039 * response will be used. 3040 * 3041 * Default: PJ_FALSE (no) 3042 */ 3043 pj_bool_t allow_sdp_nat_rewrite; 3044 3045 /** 3034 3046 * Control the use of SIP outbound feature. SIP outbound is described in 3035 3047 * RFC 5626 to enable proxies or registrar to send inbound requests back -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r4542 r4543 230 230 int reg_last_code; /**< Last status last register. */ 231 231 232 pj_str_t reg_mapped_addr;/**< Our addr as seen by reg srv. 233 Only if allow_sdp_nat_rewrite 234 is set */ 235 232 236 struct { 233 237 pj_bool_t active; /**< Flag of reregister status. */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r4542 r4543 651 651 acc->valid = PJ_FALSE; 652 652 acc->contact.slen = 0; 653 acc->reg_mapped_addr.slen = 0; 653 654 pj_bzero(&acc->via_addr, sizeof(acc->via_addr)); 654 655 acc->via_tp = NULL; … … 1256 1257 acc->regc = NULL; 1257 1258 acc->contact.slen = 0; 1259 acc->reg_mapped_addr.slen = 0; 1258 1260 } 1259 1261 } … … 1464 1466 &acc->via_addr, acc->via_tp); 1465 1467 } 1468 } 1469 1470 /* Save mapped address if needed */ 1471 if (acc->cfg.allow_sdp_nat_rewrite && 1472 pj_strcmp(&acc->reg_mapped_addr, via_addr)) 1473 { 1474 pj_strdup(acc->pool, &acc->reg_mapped_addr, via_addr); 1466 1475 } 1467 1476 … … 1990 1999 acc->regc = NULL; 1991 2000 acc->contact.slen = 0; 2001 acc->reg_mapped_addr.slen = 0; 1992 2002 1993 2003 /* Stop keep-alive timer if any. */ … … 2001 2011 acc->regc = NULL; 2002 2012 acc->contact.slen = 0; 2013 acc->reg_mapped_addr.slen = 0; 2003 2014 2004 2015 /* Stop keep-alive timer if any. */ … … 2015 2026 acc->regc = NULL; 2016 2027 acc->contact.slen = 0; 2028 acc->reg_mapped_addr.slen = 0; 2017 2029 2018 2030 /* Stop keep-alive timer if any. */ … … 2120 2132 acc->regc = NULL; 2121 2133 acc->contact.slen = 0; 2134 acc->reg_mapped_addr.slen = 0; 2122 2135 } 2123 2136 … … 2168 2181 acc->regc = NULL; 2169 2182 acc->contact.slen = 0; 2183 acc->reg_mapped_addr.slen = 0; 2170 2184 return status; 2171 2185 } -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r4542 r4543 240 240 pj_status_t status = PJ_SUCCESS; 241 241 char addr_buf[PJ_INET6_ADDRSTRLEN+10]; 242 pjsua_acc *acc; 242 243 pj_sock_t sock[2]; 243 pjsua_acc *acc = &pjsua_var.acc[call_med->call->acc_id];244 244 245 245 use_ipv6 = (acc->cfg.ipv6_media_use != PJSUA_IPV6_DISABLED); 246 246 af = use_ipv6 ? pj_AF_INET6() : pj_AF_INET(); 247 248 acc = &pjsua_var.acc[call_med->call->acc_id]; 247 249 248 250 /* Make sure STUN server resolution has completed */ … … 424 426 425 427 } else { 428 if (acc->cfg.allow_sdp_nat_rewrite && acc->reg_mapped_addr.slen) { 429 pj_status_t status; 430 431 /* Take the address from mapped addr as seen by registrar */ 432 status = pj_sockaddr_set_str_addr(af, &bound_addr, 433 &acc->reg_mapped_addr); 434 if (status != PJ_SUCCESS) { 435 /* just leave bound_addr with whatever it was 436 pj_bzero(pj_sockaddr_get_addr(&bound_addr), 437 pj_sockaddr_get_addr_len(&bound_addr)); 438 */ 439 } 440 } 426 441 427 442 if (!pj_sockaddr_has_addr(&bound_addr)) {
Note: See TracChangeset
for help on using the changeset viewer.