Changeset 5755 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Mar 15, 2018 3:00:59 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r5748 r5755 1536 1536 if (!call_med->tp_orig) { 1537 1537 pjmedia_srtp_setting srtp_opt; 1538 pjsua_srtp_opt *acc_srtp_opt = &acc->cfg.srtp_opt; 1538 1539 pjmedia_transport *srtp = NULL; 1540 unsigned i; 1539 1541 1540 1542 /* Check if SRTP requires secure signaling */ … … 1552 1554 srtp_opt.cb.on_srtp_nego_complete = &on_srtp_nego_complete; 1553 1555 srtp_opt.user_data = call_med; 1556 1557 /* Get crypto and keying settings from account settings */ 1558 srtp_opt.crypto_count = acc_srtp_opt->crypto_count; 1559 for (i = 0; i < srtp_opt.crypto_count; ++i) 1560 srtp_opt.crypto[i] = acc_srtp_opt->crypto[i]; 1561 srtp_opt.keying_count = acc_srtp_opt->keying_count; 1562 for (i = 0; i < srtp_opt.keying_count; ++i) 1563 srtp_opt.keying[i] = acc_srtp_opt->keying[i]; 1554 1564 1555 1565 /* If media session has been ever established, let's use remote's … … 1560 1570 else 1561 1571 srtp_opt.use = acc->cfg.use_srtp; 1562 1572 1563 1573 if (pjsua_var.ua_cfg.cb.on_create_media_transport_srtp) { 1574 pjmedia_srtp_setting srtp_opt2 = srtp_opt; 1564 1575 pjsua_call *call = call_med->call; 1565 pjmedia_srtp_use srtp_use = srtp_opt.use; 1576 1577 /* Warn that this callback is deprecated (see also #2100) */ 1578 PJ_LOG(1,(THIS_FILE, "Warning: on_create_media_transport_srtp " 1579 "is deprecated and will be removed in the " 1580 "future release")); 1566 1581 1567 1582 (*pjsua_var.ua_cfg.cb.on_create_media_transport_srtp) 1568 (call->index, call_med->idx, &srtp_opt); 1569 1570 /* Close_member_tp must not be overwritten by app */ 1571 srtp_opt.close_member_tp = PJ_TRUE; 1572 1573 /* Revert SRTP usage policy if media is reinitialized */ 1574 if (call->inv && call->inv->state == PJSIP_INV_STATE_CONFIRMED) { 1575 srtp_opt.use = srtp_use; 1576 } 1583 (call->index, call_med->idx, &srtp_opt2); 1584 1585 /* Only apply SRTP usage policy if this is initial INVITE */ 1586 if (call->inv && call->inv->state < PJSIP_INV_STATE_CONFIRMED) { 1587 srtp_opt.use = srtp_opt2.use; 1588 } 1589 1590 /* Apply crypto and keying settings from callback */ 1591 srtp_opt.crypto_count = srtp_opt2.crypto_count; 1592 for (i = 0; i < srtp_opt.crypto_count; ++i) 1593 srtp_opt.crypto[i] = srtp_opt2.crypto[i]; 1594 srtp_opt.keying_count = srtp_opt2.keying_count; 1595 for (i = 0; i < srtp_opt.keying_count; ++i) 1596 srtp_opt.keying[i] = srtp_opt2.keying[i]; 1577 1597 } 1578 1598
Note: See TracChangeset
for help on using the changeset viewer.