Changeset 2064 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Jun 26, 2008 7:12:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r2061 r2064 889 889 pjmedia_srtp_setting_default(&srtp_opt); 890 890 srtp_opt.close_member_tp = PJ_FALSE; 891 srtp_opt.use = acc->cfg.use_srtp; 891 /* If media session has been ever established, let's use remote's 892 * preference in SRTP usage policy, especially when it is stricter. 893 */ 894 if (call->rem_srtp_use > acc->cfg.use_srtp) 895 srtp_opt.use = call->rem_srtp_use; 896 else 897 srtp_opt.use = acc->cfg.use_srtp; 898 892 899 status = pjmedia_transport_srtp_create(pjsua_var.med_endpt, 893 900 call->med_tp, … … 1144 1151 1145 1152 } else { 1153 pjmedia_srtp_info srtp_info; 1154 pjmedia_transport_info tp_info; 1155 1146 1156 /* Start/restart media transport */ 1147 1157 status = pjmedia_transport_media_start(call->med_tp, … … 1152 1162 1153 1163 call->med_tp_st = PJSUA_MED_TP_RUNNING; 1164 1165 /* Get remote SRTP usage policy */ 1166 pjmedia_transport_info_init(&tp_info); 1167 pjmedia_transport_get_info(call->med_tp, &tp_info); 1168 if (tp_info.specific_info_cnt > 0) { 1169 int i; 1170 for (i = 0; i < tp_info.specific_info_cnt; ++i) { 1171 if (tp_info.spc_info[i].type == PJMEDIA_TRANSPORT_TYPE_SRTP) 1172 { 1173 pjmedia_srtp_info *srtp_info = 1174 (pjmedia_srtp_info*) tp_info.spc_info[i].buffer; 1175 1176 call->rem_srtp_use = srtp_info->peer_use; 1177 break; 1178 } 1179 } 1180 } 1154 1181 1155 1182 /* Override ptime, if this option is specified. */
Note: See TracChangeset
for help on using the changeset viewer.