Changeset 1742 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Jan 24, 2008 7:20:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r1735 r1742 747 747 pj_status_t pjsua_media_channel_init(pjsua_call_id call_id, 748 748 pjsip_role_e role, 749 int security_level) 749 int security_level, 750 int *sip_err_code) 750 751 { 751 752 pjsua_call *call = &pjsua_var.calls[call_id]; … … 774 775 if (acc->cfg.use_srtp != PJMEDIA_SRTP_DISABLED) { 775 776 if (security_level < acc->cfg.srtp_secure_signaling) { 777 if (sip_err_code) 778 *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE; 776 779 return PJSIP_ESESSIONINSECURE; 777 780 } … … 785 788 call->med_tp, 786 789 &srtp_opt, &srtp); 787 if (status != PJ_SUCCESS) 788 return status; 790 if (status != PJ_SUCCESS) { 791 if (sip_err_code) 792 *sip_err_code = PJSIP_SC_INTERNAL_SERVER_ERROR; 793 return status; 794 } 789 795 790 796 /* Set SRTP as current media transport */ … … 802 808 pj_pool_t *pool, 803 809 const pjmedia_sdp_session *rem_sdp, 804 pjmedia_sdp_session **p_sdp) 810 pjmedia_sdp_session **p_sdp, 811 int *sip_status_code) 805 812 { 806 813 enum { MAX_MEDIA = 1, MEDIA_IDX = 0 }; … … 823 830 status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, pool, MAX_MEDIA, 824 831 &skinfo, &sdp); 825 if (status != PJ_SUCCESS) 832 if (status != PJ_SUCCESS) { 833 if (sip_status_code) *sip_status_code = 500; 826 834 goto on_error; 835 } 827 836 828 837 /* Add NAT info in the SDP */ … … 853 862 status = pjmedia_transport_media_create(call->med_tp, pool, 854 863 sdp, rem_sdp, MEDIA_IDX); 855 if (status != PJ_SUCCESS) 864 if (status != PJ_SUCCESS) { 865 if (sip_status_code) *sip_status_code = PJSIP_SC_NOT_ACCEPTABLE; 856 866 goto on_error; 867 } 857 868 858 869 *p_sdp = sdp;
Note: See TracChangeset
for help on using the changeset viewer.