[asterisk-bugs] [Asterisk 0017758]: [patch] Asterisk just reads the first "Accept" header

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Aug 27 17:39:46 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17758 
====================================================================== 
Reported By:                ibc
Assigned To:                dvossel
====================================================================== 
Project:                    Asterisk
Issue ID:                   17758
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Target Version:             1.4.37
Asterisk Version:           SVN 
JIRA:                       SWP-1993 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2010-07-29 16:31 CDT
Last Modified:              2010-08-27 17:39 CDT
====================================================================== 
Summary:                    [patch] Asterisk just reads the first "Accept"
header
Description: 
When a SUBSCRIBE "Event: dialog" comes to Asterisk it takes the first
"Accept" header value as the only one, discarding all the rest, so it
replies "489 Bad Event" if it doesn't recognize the first "Accept" value.

Real example:


This is a SUBSCRIBE coming from a Linksys SPA phone without using the
specific "asterisk BLF mode" (a mode which shouldn't exist as "event"
subscription is a RFC standard):

SUBSCRIBE sip:8888 at 222.222.19.1 SIP/2.0'
Via: SIP/2.0/UDP 192.168.1.14:25060;branch=z9hG4bK-f443274c;rport'
From: <sip:cliente8888 at 222.222.19.1>;tag=a833e3091d78eb5'
To: <sip:8888 at 222.222.19.1>'
Call-ID: 7645f40c-c2e2f289 at 192.168.1.14'
CSeq: 63626 SUBSCRIBE'
Max-Forwards: 70'
Contact: <sip:cliente8888 at 192.168.1.14:25060>'
Accept: multipart/related'
Accept: application/rlmi+xml'
Accept: application/dialog-info+xml'
Expires: 1800'
Event: dialog'
User-Agent: Linksys/SPA942-6.1.5(a)'
Content-Length: 0'
Supported: replaces, eventlist'

Asterisk replies 489 Bad Event (format multipart/related).


This is a SUBSCRIBE coming from the same SPA phone by using "asterisk BLF
mode":

SUBSCRIBE sip:8888 at 222.222.19.1 SIP/2.0'
Via: SIP/2.0/UDP 192.168.1.14:25060;branch=z9hG4bK-3733da3b;rport'
From: <sip:cliente8169 at 212.230.19.1>;tag=d041391aac7ac1b5'
To: <sip:8888 at 222.222.19.1>'
Call-ID: 70dd34be-24845a61 at 192.168.1.14'
CSeq: 50627 SUBSCRIBE'
Max-Forwards: 70'
Contact: <sip:cliente8169 at 192.168.1.14:25060>'
Accept: application/dialog-info+xml'
Expires: 1800'
Event: dialog'
User-Agent: Linksys/SPA942-6.1.5(a)'
Content-Length: 0

In this case Asterisk replies "200 OK" as it understands
application/dialog-info+xml.



The differences are:

1)
 Accept: multipart/related'
 Accept: application/rlmi+xml'
 Accept: application/dialog-info+xml'
 Supported: replaces, eventlist'

2)
 Accept: application/dialog-info+xml'


Of course, the expected behavior is Asterisk to inspect *all* the "Accept"
headers and *all* the possible comma separated values in each "Accept"
header. There is no "preference" based on the Accept value position as
Asterisk should select its preferred value.
====================================================================== 

---------------------------------------------------------------------- 
 (0126417) svnbot (reporter) - 2010-08-27 17:39
 https://issues.asterisk.org/view.php?id=17758#c126417 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 284033

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r284033 | dvossel | 2010-08-27 17:39:46 -0500 (Fri, 27 Aug 2010) | 28
lines

Merged revisions 284032 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r284032 | dvossel | 2010-08-27 17:37:11 -0500 (Fri, 27 Aug 2010) | 21
lines
  
  Merged revisions 284002 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r284002 | dvossel | 2010-08-27 17:27:50 -0500 (Fri, 27 Aug 2010) | 14
lines
    
    Merged revisions 283960 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r283960 | dvossel | 2010-08-27 17:17:26 -0500 (Fri, 27 Aug 2010) | 8
lines
      
      Parse all "Accept" headers for SIP SUBSCRIBE requests.
      
      (closes issue https://issues.asterisk.org/view.php?id=17758)
      Reported by: ibc
      Patches:
            multiple_accept_headers_1.4.diff uploaded by dvossel (license
671)
    ........
  ................
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=284033 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-08-27 17:39 svnbot         Checkin                                      
2010-08-27 17:39 svnbot         Note Added: 0126417                          
======================================================================




More information about the asterisk-bugs mailing list