summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2012-06-01 20:42:10 +0000
committerKevin P. Fleming <kpfleming@digium.com>2012-06-01 20:42:10 +0000
commitdd02d976f59bd85844ea9a4d35d716843aec3923 (patch)
tree3b372ff3a764a8ce3ea1bf28fe04b42fb916edc6 /channels/chan_sip.c
parent66e5c30716e268f3cf0e95c79ca10143de152a3d (diff)
Improve SDP offer/answer RFC compliance
Asterisk should not accept SDP offers that contain unknown RTP profiles (for audio/video streams) or unknown top-level media types. When it does, it answers with an SDP that does not match the offer properly, and this will nearly always result in a broken call. This patch causes such offers to be rejected. Review: https://reviewboard.asterisk.org/r/1811/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index c4a5d0e25..289a807cf 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9225,7 +9225,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
secure_audio = 1;
} else if (strcmp(protocol, "AVP")) {
ast_log(LOG_WARNING, "Unknown RTP profile in audio offer: %s\n", m);
- continue;
+ res = -1;
+ goto process_sdp_cleanup;
}
if (p->offered_media[SDP_AUDIO].order_offered) {
@@ -9277,7 +9278,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
secure_video = 1;
} else if (strcmp(protocol, "AVP")) {
ast_log(LOG_WARNING, "Unknown RTP profile in video offer: %s\n", m);
- continue;
+ res = -1;
+ goto process_sdp_cleanup;
}
if (p->offered_media[SDP_VIDEO].order_offered) {
@@ -9398,7 +9400,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
}
} else {
ast_log(LOG_WARNING, "Unsupported top-level media type in offer: %s\n", m);
- continue;
+ res = -1;
+ goto process_sdp_cleanup;
}
/* Media stream specific parameters */