From 7f8b7ace724e8c67e161763b721afbb605166f0e Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Wed, 19 Nov 2014 12:50:47 +0000 Subject: res_pjsip_sdp_rtp: Add support for optimistic SRTP. Optimistic SRTP is the ability to enable SRTP but not have it be a fatal requirement. If SRTP can be used it will be, if not it won't be. This gives you a better chance of using it without having your sessions fail when it can't be. Encrypt all the things! Review: https://reviewboard.asterisk.org/r/3992/ ........ Merged revisions 428222 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428224 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_pjsip_session.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'res/res_pjsip_session.c') diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c index ebe321958..85c4b6121 100644 --- a/res/res_pjsip_session.c +++ b/res/res_pjsip_session.c @@ -1000,6 +1000,7 @@ static int add_session_media(void *obj, void *arg, int flags) if (!session_media) { return CMP_STOP; } + session_media->encryption = session->endpoint->media.rtp.encryption; /* Safe use of strcpy */ strcpy(session_media->stream_type, handler_list->stream_type); ao2_link(session->media, session_media); @@ -1046,6 +1047,8 @@ struct ast_sip_session *ast_sip_session_alloc(struct ast_sip_endpoint *endpoint, return NULL; } + session->endpoint = ao2_bump(endpoint); + session->media = ao2_container_alloc(MEDIA_BUCKETS, session_media_hash, session_media_cmp); if (!session->media) { return NULL; @@ -1061,7 +1064,6 @@ struct ast_sip_session *ast_sip_session_alloc(struct ast_sip_endpoint *endpoint, ast_sip_dialog_set_endpoint(inv_session->dlg, endpoint); pjsip_dlg_inc_session(inv_session->dlg, &session_module); inv_session->mod_data[session_module.id] = ao2_bump(session); - session->endpoint = ao2_bump(endpoint); session->contact = ao2_bump(contact); session->inv_session = inv_session; session->req_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT); -- cgit v1.2.3