summaryrefslogtreecommitdiff
path: root/res/res_pjsip_sdp_rtp.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-11-10 16:57:49 +0000
committerJoshua Colp <jcolp@digium.com>2016-11-10 16:57:49 +0000
commitb70eb07c53d041e868ced079759471220f78bf50 (patch)
tree13cc401ca499fc2742c02aa3ccd2ed3b64b2f2e4 /res/res_pjsip_sdp_rtp.c
parentccc8a37584e367ec29965af76b66cd997b922647 (diff)
res_pjsip_sdp_rtp: Reject offer of required SRTP without res_srtp.
When optimistic SRTP was on it was possible for us to still set up a call without an audio stream if an offer was received with required SRTP. This change makes it so this scenario will now fail with a 488 response. ASTERISK-26575 Change-Id: I7d14187037681f48879bd20319ac79d0877318f3
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r--res/res_pjsip_sdp_rtp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 6a8b43d72..66550a2fd 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -896,9 +896,11 @@ static int negotiate_incoming_sdp_stream(struct ast_sip_session *session, struct
res = setup_media_encryption(session, session_media, sdp, stream);
if (res) {
- if (!session->endpoint->media.rtp.encryption_optimistic) {
+ if (!session->endpoint->media.rtp.encryption_optimistic ||
+ !pj_strncmp2(&stream->desc.transport, "RTP/SAVP", 8)) {
/* If optimistic encryption is disabled and crypto should have been enabled
- * but was not this session must fail.
+ * but was not this session must fail. This must also fail if crypto was
+ * required in the offer but could not be set up.
*/
return -1;
}