diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-21 18:32:12 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-21 18:32:12 +0000 |
commit | 647db17e2a26daaf3c7bb6d726f972451afab2f4 (patch) | |
tree | 1a0c36ee06a883d1652abc2122e3a48eed52e630 /channels | |
parent | 3d42bb87825837d7cfd49f0238cec5b72d80d44d (diff) |
Send a "415 Unsupported Media Type" after failure to process sdp due to unknown Content-Encoding header.
ABE-2258
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@287929 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2abe39819..00576dfba 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -21099,7 +21099,14 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int /* Handle SDP here if we already have an owner */ if (find_sdp(req)) { if (process_sdp(p, req, SDP_T38_INITIATE)) { - transmit_response_reliable(p, "488 Not acceptable here", req); + if (!ast_strlen_zero(get_header(req, "Content-Encoding"))) { + /* Asterisk does not yet support any Content-Encoding methods. Always + * attempt to process the sdp, but return a 415 if a Content-Encoding header + * was present after processing failed. */ + transmit_response_reliable(p, "415 Unsupported Media type", req); + } else { + transmit_response_reliable(p, "488 Not acceptable here", req); + } if (!p->lastinvite) sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); res = -1; @@ -21164,8 +21171,15 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int /* We have a successful authentication, process the SDP portion if there is one */ if (find_sdp(req)) { if (process_sdp(p, req, SDP_T38_INITIATE)) { - /* Unacceptable codecs */ - transmit_response_reliable(p, "488 Not acceptable here", req); + /* Asterisk does not yet support any Content-Encoding methods. Always + * attempt to process the sdp, but return a 415 if a Content-Encoding header + * was present after processing fails. */ + if (!ast_strlen_zero(get_header(req, "Content-Encoding"))) { + transmit_response_reliable(p, "415 Unsupported Media type", req); + } else { + /* Unacceptable codecs */ + transmit_response_reliable(p, "488 Not acceptable here", req); + } p->invitestate = INV_COMPLETED; sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); ast_debug(1, "No compatible codecs for this SIP call.\n"); |