Changeset 3370


Ignore:
Timestamp:
Nov 17, 2010 9:05:10 AM (13 years ago)
Author:
bennylp
Message:

Re #1151 (misc): also enable plain UDP SIP transport when enabling IPv6, since many UA will use IPv4 in their Contacts (keyword: sipit27)

File:
1 edited

Legend:

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

    r3365 r3370  
    48184818        pjsip_transport_type_e type = PJSIP_TRANSPORT_UDP; 
    48194819 
    4820         if (app_config.ipv6) 
    4821             type = PJSIP_TRANSPORT_UDP6; 
    4822  
    48234820        status = pjsua_transport_create(type, 
    4824                                         &app_config.udp_cfg,  
     4821                                        &app_config.udp_cfg, 
     4822                                        &transport_id); 
     4823        if (status != PJ_SUCCESS) 
     4824            goto on_error; 
     4825 
     4826        /* Add local account */ 
     4827        pjsua_acc_add_local(transport_id, PJ_TRUE, &aid); 
     4828        //pjsua_acc_set_transport(aid, transport_id); 
     4829        pjsua_acc_set_online_status(current_acc, PJ_TRUE); 
     4830 
     4831        if (app_config.udp_cfg.port == 0) { 
     4832            pjsua_transport_info ti; 
     4833            pj_sockaddr_in *a; 
     4834 
     4835            pjsua_transport_get_info(transport_id, &ti); 
     4836            a = (pj_sockaddr_in*)&ti.local_addr; 
     4837 
     4838            tcp_cfg.port = pj_ntohs(a->sin_port); 
     4839        } 
     4840    } 
     4841 
     4842    /* Add UDP IPv6 transport unless it's disabled. */ 
     4843    if (!app_config.no_udp && app_config.ipv6) { 
     4844        pjsua_acc_id aid; 
     4845        pjsip_transport_type_e type = PJSIP_TRANSPORT_UDP6; 
     4846        pjsua_transport_config udp_cfg; 
     4847 
     4848        udp_cfg = app_config.udp_cfg; 
     4849        if (udp_cfg.port == 0) 
     4850            udp_cfg.port = 5060; 
     4851        else 
     4852            udp_cfg.port += 10; 
     4853        status = pjsua_transport_create(type, 
     4854                                        &udp_cfg, 
    48254855                                        &transport_id); 
    48264856        if (status != PJ_SUCCESS) 
Note: See TracChangeset for help on using the changeset viewer.