Changeset 1928
- Timestamp:
- Apr 14, 2008 2:57:29 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r1898 r1928 783 783 } 784 784 785 /* Stop media transport (for good measure!) */786 pjmedia_transport_media_stop(call->med_tp);787 788 /* Close upper entry of transport stack */789 if (call->med_orig && (call->med_tp != call->med_orig)) {790 pjmedia_transport_close(call->med_tp);791 call->med_tp = call->med_orig;792 }793 794 785 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 795 /* Check if SRTP requires secure signaling */ 796 if (acc->cfg.use_srtp != PJMEDIA_SRTP_DISABLED) { 797 if (security_level < acc->cfg.srtp_secure_signaling) { 786 /* This function may be called when SRTP transport already exists 787 * (e.g: in re-invite, update), don't need to destroy/re-create. 788 */ 789 if (!call->med_orig || call->med_tp == call->med_orig) { 790 791 /* Check if SRTP requires secure signaling */ 792 if (acc->cfg.use_srtp != PJMEDIA_SRTP_DISABLED) { 793 if (security_level < acc->cfg.srtp_secure_signaling) { 794 if (sip_err_code) 795 *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE; 796 return PJSIP_ESESSIONINSECURE; 797 } 798 } 799 800 /* Always create SRTP adapter */ 801 pjmedia_srtp_setting_default(&srtp_opt); 802 srtp_opt.close_member_tp = PJ_FALSE; 803 srtp_opt.use = acc->cfg.use_srtp; 804 status = pjmedia_transport_srtp_create(pjsua_var.med_endpt, 805 call->med_tp, 806 &srtp_opt, &srtp); 807 if (status != PJ_SUCCESS) { 798 808 if (sip_err_code) 799 *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE; 800 return PJSIP_ESESSIONINSECURE; 801 } 802 } 803 804 /* Always create SRTP adapter */ 805 pjmedia_srtp_setting_default(&srtp_opt); 806 srtp_opt.close_member_tp = PJ_FALSE; 807 srtp_opt.use = acc->cfg.use_srtp; 808 status = pjmedia_transport_srtp_create(pjsua_var.med_endpt, 809 call->med_tp, 810 &srtp_opt, &srtp); 811 if (status != PJ_SUCCESS) { 812 if (sip_err_code) 813 *sip_err_code = PJSIP_SC_INTERNAL_SERVER_ERROR; 814 return status; 815 } 816 817 /* Set SRTP as current media transport */ 818 call->med_orig = call->med_tp; 819 call->med_tp = srtp; 809 *sip_err_code = PJSIP_SC_INTERNAL_SERVER_ERROR; 810 return status; 811 } 812 813 /* Set SRTP as current media transport */ 814 call->med_orig = call->med_tp; 815 call->med_tp = srtp; 816 } 820 817 #else 821 818 call->med_orig = call->med_tp; … … 902 899 { 903 900 pjsua_call *call = &pjsua_var.calls[call_id]; 901 902 pjmedia_transport_media_stop(call->med_tp); 904 903 905 904 if (call->conf_slot != PJSUA_INVALID_ID) {
Note: See TracChangeset
for help on using the changeset viewer.