Changeset 5342 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Jun 13, 2016 7:11:41 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r5339 r5342 824 824 unsigned comp_cnt; 825 825 pj_status_t status; 826 pj_bool_t use_ipv6; 826 827 827 828 acc_cfg = &pjsua_var.acc[call_med->call->acc_id].cfg; 829 use_ipv6 = (acc_cfg->ipv6_media_use != PJSUA_IPV6_DISABLED); 828 830 829 831 /* Make sure STUN server resolution has completed */ … … 856 858 ice_cfg.stun_tp_cnt = 1; 857 859 pj_ice_strans_stun_cfg_default(&ice_cfg.stun_tp[0]); 860 if (use_ipv6 && PJ_ICE_MAX_STUN >= 2) { 861 ice_cfg.stun_tp_cnt = 2; 862 pj_ice_strans_stun_cfg_default(&ice_cfg.stun_tp[1]); 863 ice_cfg.stun_tp[1].af = pj_AF_INET6(); 864 } 858 865 } 859 866 … … 866 873 ice_cfg.stun_tp[0].port = pj_sockaddr_get_port(&pjsua_var.stun_srv); 867 874 } 868 if (acc_cfg->ice_cfg.ice_max_host_cands >= 0) 869 ice_cfg.stun_tp[0].max_host_cands = acc_cfg->ice_cfg.ice_max_host_cands; 875 if (acc_cfg->ice_cfg.ice_max_host_cands >= 0) { 876 ice_cfg.stun_tp[0].max_host_cands = 877 acc_cfg->ice_cfg.ice_max_host_cands; 878 if (use_ipv6) 879 ice_cfg.stun_tp[1].max_host_cands = 880 acc_cfg->ice_cfg.ice_max_host_cands; 881 } 870 882 871 883 /* Copy binding port setting to STUN setting */ … … 873 885 &cfg->bound_addr, (pj_uint16_t)cfg->port); 874 886 ice_cfg.stun_tp[0].cfg.port_range = (pj_uint16_t)cfg->port_range; 875 if (cfg->port != 0 && ice_cfg.stun_tp[0].cfg.port_range == 0) 887 if (cfg->port != 0 && ice_cfg.stun_tp[0].cfg.port_range == 0) { 876 888 ice_cfg.stun_tp[0].cfg.port_range = 877 889 (pj_uint16_t)(pjsua_var.ua_cfg.max_calls * 10); 890 } 891 if (use_ipv6) { 892 pj_str_t IN6_ADDR_ANY = {"0", 1}; 893 pj_sockaddr_init(pj_AF_INET6(), &ice_cfg.stun_tp[1].cfg.bound_addr, 894 &IN6_ADDR_ANY, (pj_uint16_t)cfg->port); 895 ice_cfg.stun_tp[1].cfg.port_range = ice_cfg.stun_tp[0].cfg.port_range; 896 } 878 897 879 898 /* Copy QoS setting to STUN setting */ … … 881 900 pj_memcpy(&ice_cfg.stun_tp[0].cfg.qos_params, &cfg->qos_params, 882 901 sizeof(cfg->qos_params)); 902 if (use_ipv6) { 903 ice_cfg.stun_tp[1].cfg.qos_type = cfg->qos_type; 904 pj_memcpy(&ice_cfg.stun_tp[1].cfg.qos_params, &cfg->qos_params, 905 sizeof(cfg->qos_params)); 906 } 883 907 884 908 /* Configure TURN settings */ … … 917 941 ice_cfg.stun_tp[0].cfg.max_pkt_size = PJMEDIA_MAX_MRU; 918 942 ice_cfg.turn_tp[0].cfg.max_pkt_size = PJMEDIA_MAX_MRU; 943 944 if (use_ipv6) { 945 ice_cfg.stun_tp[1].cfg.max_pkt_size = PJMEDIA_MAX_MRU; 946 } 919 947 920 948 pj_bzero(&ice_cb, sizeof(pjmedia_ice_cb));
Note: See TracChangeset
for help on using the changeset viewer.