Changeset 5597 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Jun 3, 2017 9:22:34 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r5587 r5597 1275 1275 const pjmedia_sdp_media *m = sdp->media[i]; 1276 1276 const pjmedia_sdp_conn *c; 1277 static const pj_str_t ID_RTP_SAVP = { "RTP/SAVP", 8 }; 1277 1278 1278 1279 /* Skip different media */ … … 1285 1286 1286 1287 /* Supported transports */ 1287 if (pj_stri cmp2(&m->desc.transport, "RTP/SAVP")==0) {1288 if (pj_stristr(&m->desc.transport, &ID_RTP_SAVP)) { 1288 1289 switch (use_srtp) { 1289 1290 case PJMEDIA_SRTP_MANDATORY: … … 1494 1495 } 1495 1496 1497 1498 /* This callback is called when SRTP negotiation completes */ 1499 static void on_srtp_nego_complete(pjmedia_transport *tp, 1500 pj_status_t result) 1501 { 1502 pjsua_call_media *call_med = (pjsua_call_media*)tp->user_data; 1503 pjsua_call *call; 1504 1505 if (!call_med) 1506 return; 1507 1508 call = call_med->call; 1509 PJ_PERROR(4,(THIS_FILE, result, 1510 "Call %d: Media %d: SRTP negotiation completes", 1511 call->index, call_med->idx)); 1512 1513 if (result != PJ_SUCCESS) { 1514 call_med->state = PJSUA_CALL_MEDIA_ERROR; 1515 call_med->dir = PJMEDIA_DIR_NONE; 1516 if (call && pjsua_var.ua_cfg.cb.on_call_media_state) { 1517 /* Defer the callback to a timer */ 1518 pjsua_schedule_timer2(&ice_failed_nego_cb, 1519 (void*)(pj_ssize_t)call->index, 1); 1520 } 1521 } 1522 } 1523 1524 1496 1525 /* Callback to resume pjsua_call_media_init() after media transport 1497 1526 * creation is completed. … … 1547 1576 pjmedia_srtp_setting_default(&srtp_opt); 1548 1577 srtp_opt.close_member_tp = PJ_TRUE; 1578 srtp_opt.cb.on_srtp_nego_complete = &on_srtp_nego_complete; 1579 srtp_opt.user_data = call_med; 1549 1580 1550 1581 /* If media session has been ever established, let's use remote's
Note: See TracChangeset
for help on using the changeset viewer.