Changeset 6044
- Timestamp:
- Jul 26, 2019 5:40:42 AM (4 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r6035 r6044 1255 1255 { 1256 1256 pjsua_transport_id transport_id = -1; 1257 pjsua_transport_id udp6_tp_id = -1, tcp6_tp_id = -1, tls6_tp_id = -1;1258 1257 pjsua_transport_config tcp_cfg; 1259 1258 unsigned i; … … 1284 1283 return status; 1285 1284 } 1286 1287 if (app_config.ipv6)1288 app_config.cfg.stun_try_ipv6 = PJ_TRUE;1289 1285 1290 1286 /* Initialize application callbacks */ … … 1613 1609 if (status != PJ_SUCCESS) 1614 1610 goto on_error; 1615 udp6_tp_id = transport_id;1616 1611 1617 1612 /* Add local account */ … … 1679 1674 if (status != PJ_SUCCESS) 1680 1675 goto on_error; 1681 tcp6_tp_id = transport_id;1682 1676 1683 1677 /* Add local account */ … … 1719 1713 if (status != PJ_SUCCESS) 1720 1714 goto on_error; 1721 tls6_tp_id = transport_id;1722 1715 1723 1716 /* Add local account */ … … 1782 1775 app_config.acc_cfg[i].reg_retry_interval = 300; 1783 1776 app_config.acc_cfg[i].reg_first_retry_interval = 60; 1784 if (app_config.ipv6) {1785 pj_str_t *dst_uri = NULL;1786 pj_str_t tmp;1787 pjsip_uri *uri;1788 1789 // Uncomment this for testing in a NAT64 network1790 // app_config.acc_cfg[i].nat64_opt = PJSUA_NAT64_ENABLED;1791 app_config.acc_cfg[i].ipv6_media_use = PJSUA_IPV6_ENABLED;1792 1793 if ((app_config.cfg.outbound_proxy_cnt > 0) &&1794 (app_config.acc_cfg[i].reg_use_proxy == 1 /* outbound */ ||1795 app_config.acc_cfg[i].reg_use_proxy == 3 /* all */))1796 {1797 dst_uri = &app_config.cfg.outbound_proxy[0];1798 } else if ((app_config.acc_cfg[i].proxy_cnt > 0) &&1799 (app_config.acc_cfg[i].reg_use_proxy == 2 /* acc */ ||1800 app_config.acc_cfg[i].reg_use_proxy == 3 /* all */))1801 {1802 dst_uri = &app_config.acc_cfg[i].proxy[0];1803 } else if (app_config.acc_cfg[i].reg_uri.slen > 0) {1804 dst_uri = &app_config.acc_cfg[i].reg_uri;1805 }1806 1807 pj_strdup_with_null(app_config.pool, &tmp, dst_uri);1808 1809 uri = pjsip_parse_uri(app_config.pool, tmp.ptr, tmp.slen, 0);1810 if (uri != NULL) {1811 pjsip_sip_uri *sip_uri;1812 pjsip_transport_type_e tp_type = PJSIP_TRANSPORT_UNSPECIFIED;1813 1814 sip_uri = (pjsip_sip_uri*)pjsip_uri_get_uri(uri);1815 1816 /* Get transport type of the URI */1817 if (PJSIP_URI_SCHEME_IS_SIPS(sip_uri)) {1818 tp_type = PJSIP_TRANSPORT_TLS;1819 } else if (sip_uri->transport_param.slen == 0) {1820 tp_type = PJSIP_TRANSPORT_UDP;1821 } else {1822 tp_type = pjsip_transport_get_type_from_name(1823 &sip_uri->transport_param);1824 tp_type &= ~ PJSIP_TRANSPORT_IPV6;1825 }1826 1827 if (tp_type == PJSIP_TRANSPORT_UDP) {1828 app_config.acc_cfg[i].transport_id = udp6_tp_id;1829 } else if (tp_type == PJSIP_TRANSPORT_TCP) {1830 app_config.acc_cfg[i].transport_id = tcp6_tp_id;1831 } else if (tp_type == PJSIP_TRANSPORT_TLS) {1832 app_config.acc_cfg[i].transport_id = tls6_tp_id;1833 }1834 }1835 }1836 1777 1837 1778 app_config_init_video(&app_config.acc_cfg[i]); -
pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
r6025 r6044 277 277 svr_addr.count = 1; 278 278 if (ip_addr_ver == 4) { 279 if (af == pj_AF_INET()) { 280 pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr, 281 NULL, 0); 282 pj_inet_pton(pj_AF_INET(), &target->addr.host, 283 &svr_addr.entry[0].addr.ipv4.sin_addr); 284 } 285 286 if (af == pj_AF_INET6() || 287 (type != PJSIP_TRANSPORT_LOOP_DGRAM && 288 PJSIP_MAX_RESOLVED_ADDRESSES > 1)) 289 { 279 if (af == pj_AF_INET6()) { 290 280 /* Generate a synthesized IPv6 address, if possible. */ 291 281 unsigned int count = 1; … … 298 288 ai[0].ai_addr.addr.sa_family == pj_AF_INET6()) 299 289 { 300 unsigned idx = 0;301 302 if (af != pj_AF_INET6()) {303 /* Return IPv4 and IPv6 addresses */304 idx = 1;305 svr_addr.count++;306 }307 290 pj_sockaddr_init(pj_AF_INET6(), 308 &svr_addr.entry[ idx].addr,291 &svr_addr.entry[0].addr, 309 292 NULL, 0); 310 svr_addr.entry[ idx].addr.ipv6.sin6_addr =293 svr_addr.entry[0].addr.ipv6.sin6_addr = 311 294 ai[0].ai_addr.ipv6.sin6_addr; 312 } else if (af == pj_AF_INET6()) { 313 svr_addr.count = 0; 314 status = PJ_ERESOLVE; 315 goto on_error; 295 } else { 296 pj_sockaddr_init(pj_AF_INET(), 297 &svr_addr.entry[0].addr, NULL, 0); 298 pj_inet_pton(pj_AF_INET(), &target->addr.host, 299 &svr_addr.entry[0].addr.ipv4.sin_addr); 316 300 } 301 } else { 302 pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr, 303 NULL, 0); 304 pj_inet_pton(pj_AF_INET(), &target->addr.host, 305 &svr_addr.entry[0].addr.ipv4.sin_addr); 317 306 } 318 307 } else { -
pjproject/trunk/pjsip/src/test/dns_test.c
r6025 r6044 363 363 unsigned i; 364 364 365 /* Result may have double the number of addresses, for IPv4 and IPv6 */ 366 if (ref->count != result.servers.count && 367 2*ref->count != result.servers.count) 368 { 365 if (ref->count != result.servers.count) { 369 366 PJ_LOG(3,(THIS_FILE, " test_resolve() error 10: result count mismatch")); 370 367 return 10;
Note: See TracChangeset
for help on using the changeset viewer.