mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user