[asterisk-bugs] [JIRA] (ASTERISK-20720) Accept MWI subscriptions with several elements in Accept header

Alexei Gradinari (JIRA) noreply at issues.asterisk.org
Thu Nov 22 12:00:45 CST 2012


Alexei Gradinari created ASTERISK-20720:
-------------------------------------------

             Summary: Accept MWI subscriptions with several elements in Accept header
                 Key: ASTERISK-20720
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20720
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Channels/chan_sip/Subscriptions
    Affects Versions: 11.0.0, 10.10.0, 1.8.18.0
         Environment: Linux Slackware 13.0
Linux Kernel 3.1.0 i686


            Reporter: Alexei Gradinari
            Severity: Minor


There are SIP UAs which send SIP SUBSCRIBE with several elements in Accept header.

For example
================================
SUBSCRIBE sip:NAME at XXX.XXX.XXX.XXX:5060 SIP/2.0
From: <sip:NAME at XXX.XXX.XXX.XXX:5060>;tag=10f21b8-267564c2-13c4-45028-1a7-39b4fd5b-1a7
To: <sip:NAME at XXX.XXX.XXX.XXX:5060>
Call-ID: 10fa418-267564c2-13c4-45028-1a7-2c53e6e5-1a7
CSeq: 2 SUBSCRIBE
Via: SIP/2.0/UDP YYY.YYY.YYY.YYY:5060;branch=z9hG4bK-1a8-67a33-79138a66
Expires: 180
Event: message-summary
Max-Forwards: 70
Supported: replaces,100rel
User-Agent: Thomson TG784 Build 8.2.7.7
Contact: <sip:NAME at YYY.YYY.YYY.YYY:5060>
Accept: application/dtmf-relay, x-application/dtmf-relay, application/sdp,application/simple-message-summary
Content-Length: 0
================================

Asterisk does not support multiply elements in Accept header for MWI SUBSCRIBE.

This patch fixes it.

--- chan_sip.c  2012-11-05 11:29:46.000000000 -0500
+++ chan_sip.c-new      2012-11-22 12:58:04.527860807 -0500
@@ -27126,7 +27126,7 @@
 
                accept = __get_header(req, "Accept", &start);
                while (!found_supported && !ast_strlen_zero(accept)) {
-                       found_supported = strcmp(accept, "application/simple-message-summary") ? 0 : 1;
+                       found_supported = strstr(accept, "application/simple-message-summary") ? 1 : 0;
                        if (!found_supported && (option_debug > 2)) {
                                ast_debug(1, "Received SIP mailbox subscription for unknown format: %s\n", accept);
                        }


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list