- Timestamp:
- Mar 25, 2014 4:08:44 AM (11 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_config.h
r4770 r4802 138 138 pj_bool_t req_has_via_alias; 139 139 140 /** 141 * Resolve hostname when trying to get the network interface to be put 142 * in Via or Contact header. 143 * 144 * Default is PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE. 145 */ 146 pj_bool_t resolve_hostname_to_get_interface; 147 140 148 } endpt; 141 149 … … 364 372 #endif 365 373 374 /** 375 * Resolve hostname when trying to get the network interface to be put in Via 376 * or Contact header. 377 * 378 * This option can also be controlled at run-time by the 379 * \a resolve_hostname_to_get_interface setting in pjsip_cfg_t. 380 * 381 * Default is PJ_FALSE. 382 */ 383 #ifndef PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE 384 # define PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE PJ_FALSE 385 #endif 366 386 367 387 /** -
pjproject/trunk/pjsip/src/pjsip/sip_config.c
r4770 r4802 33 33 PJSIP_DONT_SWITCH_TO_TLS, 34 34 PJSIP_FOLLOW_EARLY_MEDIA_FORK, 35 PJSIP_REQ_HAS_VIA_ALIAS 35 PJSIP_REQ_HAS_VIA_ALIAS, 36 PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE 36 37 }, 37 38 -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r4775 r4802 1292 1292 int af; 1293 1293 pj_sockaddr itf_addr; 1294 pj_status_t status ;1294 pj_status_t status = -1; 1295 1295 1296 1296 af = (tp_type & PJSIP_TRANSPORT_IPV6)? PJ_AF_INET6 : PJ_AF_INET; 1297 status = pj_getipinterface(af, dst, &itf_addr, PJ_FALSE, NULL); 1298 if (status != PJ_SUCCESS) { 1299 /* If it fails, e.g: on WM6 (http://support.microsoft.com/kb/129065), 1300 * just fallback using pj_gethostip(), see ticket #1660. 1301 */ 1302 PJ_LOG(5,(THIS_FILE,"Warning: unable to determine local " 1303 "interface, fallback to default interface!")); 1304 status = pj_gethostip(af, &itf_addr); 1305 if (status != PJ_SUCCESS) 1306 return status; 1297 1298 if (pjsip_cfg()->endpt.resolve_hostname_to_get_interface) { 1299 status = pj_getipinterface(af, dst, &itf_addr, PJ_TRUE, NULL); 1300 } 1301 1302 if (status != PJ_SUCCESS) { 1303 status = pj_getipinterface(af, dst, &itf_addr, PJ_FALSE, NULL); 1304 if (status != PJ_SUCCESS) { 1305 /* If it fails, e.g: on WM6(http://support.microsoft.com/kb/129065), 1306 * just fallback using pj_gethostip(), see ticket #1660. 1307 */ 1308 PJ_LOG(5,(THIS_FILE,"Warning: unable to determine local " 1309 "interface, fallback to default interface!")); 1310 status = pj_gethostip(af, &itf_addr); 1311 if (status != PJ_SUCCESS) 1312 return status; 1313 } 1307 1314 } 1308 1315
Note: See TracChangeset
for help on using the changeset viewer.