Changeset 5462 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Oct 17, 2016 7:50:28 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r5417 r5462 927 927 ice_cfg.turn_tp_cnt = 1; 928 928 pj_ice_strans_turn_cfg_default(&ice_cfg.turn_tp[0]); 929 if (use_ipv6 && PJ_ICE_MAX_TURN >= 2) { 930 ice_cfg.turn_tp_cnt = 2; 931 pj_ice_strans_turn_cfg_default(&ice_cfg.turn_tp[1]); 932 ice_cfg.turn_tp[1].af = pj_AF_INET6(); 933 } 934 935 /* Configure TURN server */ 929 936 status = parse_host_port(&acc_cfg->turn_cfg.turn_server, 930 937 &ice_cfg.turn_tp[0].server, … … 934 941 return PJ_EINVAL; 935 942 } 943 944 /* Configure TURN connection settings and credential */ 936 945 if (ice_cfg.turn_tp[0].port == 0) 937 946 ice_cfg.turn_tp[0].port = 3479; … … 941 950 sizeof(ice_cfg.turn_tp[0].auth_cred)); 942 951 943 /* Copy QoS setting to TURN setting */ 952 if (use_ipv6 && ice_cfg.turn_tp_cnt > 1) { 953 ice_cfg.turn_tp[1].server = ice_cfg.turn_tp[0].server; 954 ice_cfg.turn_tp[1].port = ice_cfg.turn_tp[0].port; 955 ice_cfg.turn_tp[1].conn_type = ice_cfg.turn_tp[0].conn_type; 956 pj_memcpy(&ice_cfg.turn_tp[1].auth_cred, 957 &acc_cfg->turn_cfg.turn_auth_cred, 958 sizeof(ice_cfg.turn_tp[1].auth_cred)); 959 } 960 961 /* Configure QoS setting */ 944 962 ice_cfg.turn_tp[0].cfg.qos_type = cfg->qos_type; 945 963 pj_memcpy(&ice_cfg.turn_tp[0].cfg.qos_params, &cfg->qos_params, 946 964 sizeof(cfg->qos_params)); 947 948 /* Copy binding port setting to TURN setting */ 965 if (use_ipv6 && ice_cfg.turn_tp_cnt > 1) { 966 ice_cfg.turn_tp[1].cfg.qos_type = cfg->qos_type; 967 pj_memcpy(&ice_cfg.turn_tp[1].cfg.qos_params, &cfg->qos_params, 968 sizeof(cfg->qos_params)); 969 } 970 971 /* Configure binding address */ 949 972 pj_sockaddr_init(ice_cfg.turn_tp[0].af, &ice_cfg.turn_tp[0].cfg.bound_addr, 950 973 &cfg->bound_addr, (pj_uint16_t)cfg->port); … … 954 977 (pj_uint16_t)(pjsua_var.ua_cfg.max_calls * 10); 955 978 979 if (use_ipv6 && ice_cfg.turn_tp_cnt > 1) { 980 pj_str_t IN6_ADDR_ANY = {"0", 1}; 981 pj_sockaddr_init(pj_AF_INET6(), 982 &ice_cfg.turn_tp[1].cfg.bound_addr, 983 &IN6_ADDR_ANY, (pj_uint16_t)cfg->port); 984 ice_cfg.turn_tp[1].cfg.port_range = 985 ice_cfg.turn_tp[0].cfg.port_range; 986 } 987 956 988 /* Configure max packet size */ 957 989 ice_cfg.turn_tp[0].cfg.max_pkt_size = PJMEDIA_MAX_MRU; 990 if (use_ipv6 && ice_cfg.turn_tp_cnt > 1) 991 ice_cfg.turn_tp[1].cfg.max_pkt_size = PJMEDIA_MAX_MRU; 958 992 } 959 993
Note: See TracChangeset
for help on using the changeset viewer.