Changeset 3585 for pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Jun 16, 2011 5:10:45 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_media.c
r3571 r3585 1175 1175 pjsua_call *call = &pjsua_var.calls[call_id]; 1176 1176 pj_status_t status; 1177 pj_bool_t use_custom_med_tp = PJ_FALSE; 1178 unsigned custom_med_tp_flags = 0; 1177 1179 1178 1180 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) … … 1193 1195 } 1194 1196 1197 if (!call->med_orig && 1198 pjsua_var.ua_cfg.cb.on_create_media_transport) 1199 { 1200 use_custom_med_tp = PJ_TRUE; 1201 } 1202 1195 1203 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 1196 1204 /* This function may be called when SRTP transport already exists 1197 1205 * (e.g: in re-invite, update), don't need to destroy/re-create. 1198 1206 */ 1199 if (!call->med_orig || call->med_tp == call->med_orig) {1207 if (!call->med_orig) { 1200 1208 1201 1209 /* Check if SRTP requires secure signaling */ … … 1211 1219 pjmedia_srtp_setting_default(&srtp_opt); 1212 1220 srtp_opt.close_member_tp = PJ_FALSE; 1221 if (use_custom_med_tp) 1222 custom_med_tp_flags |= PJSUA_MED_TP_CLOSE_MEMBER; 1213 1223 /* If media session has been ever established, let's use remote's 1214 1224 * preference in SRTP usage policy, especially when it is stricter. … … 1268 1278 PJ_LOG(4,(THIS_FILE, "Media index %d selected for call %d", 1269 1279 call->audio_idx, call->index)); 1280 1281 if (use_custom_med_tp) { 1282 /* Use custom media transport returned by the application */ 1283 call->med_tp = (*pjsua_var.ua_cfg.cb.on_create_media_transport)( 1284 call_id, call->audio_idx, call->med_tp, 1285 custom_med_tp_flags); 1286 if (!call->med_tp) { 1287 if (sip_err_code) *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE; 1288 pjsua_media_channel_deinit(call_id); 1289 return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE); 1290 } 1291 } 1270 1292 1271 1293 /* Create the media transport */ … … 1544 1566 pjmedia_transport_close(call->med_tp); 1545 1567 call->med_tp = call->med_orig; 1568 call->med_orig = NULL; 1546 1569 } 1547 1570
Note: See TracChangeset
for help on using the changeset viewer.