Changeset 6044 for pjproject


Ignore:
Timestamp:
Jul 26, 2019 5:40:42 AM (5 years ago)
Author:
nanang
Message:

Fix #2216: reverted back changes in ticket #2198: r6025, r5998, r5995.

Location:
pjproject/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r6035 r6044  
    12551255{ 
    12561256    pjsua_transport_id transport_id = -1; 
    1257     pjsua_transport_id udp6_tp_id = -1, tcp6_tp_id = -1, tls6_tp_id = -1; 
    12581257    pjsua_transport_config tcp_cfg; 
    12591258    unsigned i; 
     
    12841283        return status; 
    12851284    } 
    1286      
    1287     if (app_config.ipv6) 
    1288         app_config.cfg.stun_try_ipv6 = PJ_TRUE; 
    12891285 
    12901286    /* Initialize application callbacks */ 
     
    16131609        if (status != PJ_SUCCESS) 
    16141610            goto on_error; 
    1615         udp6_tp_id = transport_id; 
    16161611 
    16171612        /* Add local account */ 
     
    16791674        if (status != PJ_SUCCESS) 
    16801675            goto on_error; 
    1681         tcp6_tp_id = transport_id; 
    16821676 
    16831677        /* Add local account */ 
     
    17191713        if (status != PJ_SUCCESS) 
    17201714            goto on_error; 
    1721         tls6_tp_id = transport_id; 
    17221715         
    17231716        /* Add local account */ 
     
    17821775        app_config.acc_cfg[i].reg_retry_interval = 300; 
    17831776        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 network 
    1790             // 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         } 
    18361777 
    18371778        app_config_init_video(&app_config.acc_cfg[i]); 
  • pjproject/trunk/pjsip/src/pjsip/sip_resolve.c

    r6025 r6044  
    277277            svr_addr.count = 1; 
    278278            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()) { 
    290280                    /* Generate a synthesized IPv6 address, if possible. */ 
    291281                    unsigned int count = 1; 
     
    298288                        ai[0].ai_addr.addr.sa_family == pj_AF_INET6()) 
    299289                    { 
    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                         } 
    307290                        pj_sockaddr_init(pj_AF_INET6(), 
    308                                          &svr_addr.entry[idx].addr, 
     291                                         &svr_addr.entry[0].addr, 
    309292                                         NULL, 0); 
    310                         svr_addr.entry[idx].addr.ipv6.sin6_addr = 
     293                        svr_addr.entry[0].addr.ipv6.sin6_addr = 
    311294                            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); 
    316300                    } 
     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); 
    317306                } 
    318307            } else { 
  • pjproject/trunk/pjsip/src/test/dns_test.c

    r6025 r6044  
    363363        unsigned i; 
    364364 
    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) { 
    369366            PJ_LOG(3,(THIS_FILE, "  test_resolve() error 10: result count mismatch")); 
    370367            return 10; 
Note: See TracChangeset for help on using the changeset viewer.