Changeset 1636 for pjproject/trunk
- Timestamp:
- Dec 20, 2007 11:23:07 AM (17 years ago)
- Location:
- pjproject/trunk/pjsip/src/pjsua-lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r1621 r1636 1300 1300 pj_bzero(p_pub_addr, sizeof(pj_sockaddr)); 1301 1301 1302 status = pj_gethostip(af, p_pub_addr); 1303 if (status != PJ_SUCCESS) { 1304 pjsua_perror(THIS_FILE, "Unable to get local host IP", status); 1305 pj_sock_close(sock); 1306 return status; 1302 if (pj_sockaddr_has_addr(&bind_addr)) { 1303 pj_sockaddr_copy_addr(p_pub_addr, &bind_addr); 1304 } else { 1305 status = pj_gethostip(af, p_pub_addr); 1306 if (status != PJ_SUCCESS) { 1307 pjsua_perror(THIS_FILE, "Unable to get local host IP", status); 1308 pj_sock_close(sock); 1309 return status; 1310 } 1307 1311 } 1308 1312 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r1625 r1636 347 347 348 348 } else { 349 pj_sockaddr addr; 350 351 /* Get local IP address. */ 352 status = pj_gethostip(pj_AF_INET(), &addr); 353 if (status != PJ_SUCCESS) 354 goto on_error; 349 350 if (bound_addr.sin_addr.s_addr == 0) { 351 pj_sockaddr addr; 352 353 /* Get local IP address. */ 354 status = pj_gethostip(pj_AF_INET(), &addr); 355 if (status != PJ_SUCCESS) 356 goto on_error; 357 358 bound_addr.sin_addr.s_addr = addr.ipv4.sin_addr.s_addr; 359 } 355 360 356 361 for (i=0; i<2; ++i) { 357 362 pj_sockaddr_in_init(&mapped_addr[i], NULL, 0); 358 mapped_addr[i].sin_addr.s_addr = addr.ipv4.sin_addr.s_addr;363 mapped_addr[i].sin_addr.s_addr = bound_addr.sin_addr.s_addr; 359 364 } 360 365
Note: See TracChangeset
for help on using the changeset viewer.