[Home]

Summary:ASTERISK-12813: [patch] Bad handling of Contact header, which should not be present in 1XX responses to REGISTER, but also in several other case
Reporter:Herve JOURDAIN (hjourdain)Labels:
Date Opened:2008-10-02 07:42:05Date Closed:2009-02-06 11:05:07.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bug13602-1.diff
( 1) bug13602-2.diff
( 2) chan_sip.c.contact.diff
Description:When Asterisk sends a response to a UA, the algorithm to include the Contact header that's use in resprep is flawed.
This leads to sending the contact header in 100 Trying responses to REGISTER.
But this is also true in many other cases, depending on the type of response (1xx, 2xx, 3xx 485 or other) and the type of request.

****** ADDITIONAL INFORMATION ******

- Version used is 1.4.22-rc5
- A "header" table, present in each relevant RFC for new requests, specifies how each header is supposed to be dealt with. This includes behaviour in responses.
- The proposed patch is supposed to strictly follow what is defined in the tables in RFCs 2976 (INFO), 3261 (ACK, BYE, CANCEL, INVITE, OPTIONS, REGISTER), 3262 (PRACK), 3265 (SUBSCRIBE, NOTIFY), 3311 (UPDATE), 3428 (MESSAGE), 3515 (REFER), 3903 (PUBLISH).
- The proposed patch has been tested only in the case of 100 response to a REGISTER request...
Comments:By: Matthew Nicholson (mnicholson) 2008-12-16 18:32:51.000-0600

I am going to take a look at this issue and your patch.

By: Matthew Nicholson (mnicholson) 2008-12-19 13:54:26.000-0600

hjourdain,

Can you test the patch I just uploaded and let me know if it causes any problems for you.  It is basically a reworked version of your patch.

By: Digium Subversion (svnbot) 2009-02-06 10:20:31.000-0600

Repository: asterisk
Revision: 173917

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r173917 | mnicholson | 2009-02-06 10:20:31 -0600 (Fri, 06 Feb 2009) | 7 lines

Limit the addition of the Contact header in SIP responses according to various
SIP RFCs.

(closes issue ASTERISK-12813)
Reported by: hjourdain
Tested by: mnicholson

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

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

By: Digium Subversion (svnbot) 2009-02-06 10:28:41.000-0600

Repository: asterisk
Revision: 173952

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r173952 | mnicholson | 2009-02-06 10:28:41 -0600 (Fri, 06 Feb 2009) | 14 lines

Merged revisions 173917 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r173917 | mnicholson | 2009-02-06 10:20:23 -0600 (Fri, 06 Feb 2009) | 7 lines
 
 Limit the addition of the Contact header in SIP responses according to various
 SIP RFCs.
 
 (closes issue ASTERISK-12813)
 Reported by: hjourdain
 Tested by: mnicholson
........

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

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

By: Digium Subversion (svnbot) 2009-02-06 10:33:14.000-0600

Repository: asterisk
Revision: 173963

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_sip.c

------------------------------------------------------------------------
r173963 | mnicholson | 2009-02-06 10:33:14 -0600 (Fri, 06 Feb 2009) | 21 lines

Merged revisions 173952 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r173952 | mnicholson | 2009-02-06 10:28:19 -0600 (Fri, 06 Feb 2009) | 14 lines
 
 Merged revisions 173917 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r173917 | mnicholson | 2009-02-06 10:20:23 -0600 (Fri, 06 Feb 2009) | 7 lines
   
   Limit the addition of the Contact header in SIP responses according to various
   SIP RFCs.
   
   (closes issue ASTERISK-12813)
   Reported by: hjourdain
   Tested by: mnicholson
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-02-06 10:39:22.000-0600

Repository: asterisk
Revision: 173964

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_sip.c
U   branches/1.6.1/main/ast_expr2.c
U   branches/1.6.1/main/ast_expr2.h

------------------------------------------------------------------------
r173964 | mnicholson | 2009-02-06 10:39:22 -0600 (Fri, 06 Feb 2009) | 21 lines

Merged revisions 173952 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r173952 | mnicholson | 2009-02-06 10:28:19 -0600 (Fri, 06 Feb 2009) | 14 lines
 
 Merged revisions 173917 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r173917 | mnicholson | 2009-02-06 10:20:23 -0600 (Fri, 06 Feb 2009) | 7 lines
   
   Limit the addition of the Contact header in SIP responses according to various
   SIP RFCs.
   
   (closes issue ASTERISK-12813)
   Reported by: hjourdain
   Tested by: mnicholson
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-02-06 11:05:06.000-0600

Repository: asterisk
Revision: 173966

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_sip.c

------------------------------------------------------------------------
r173966 | mnicholson | 2009-02-06 11:05:06 -0600 (Fri, 06 Feb 2009) | 21 lines

Merged revisions 173952 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r173952 | mnicholson | 2009-02-06 10:28:19 -0600 (Fri, 06 Feb 2009) | 14 lines
 
 Merged revisions 173917 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r173917 | mnicholson | 2009-02-06 10:20:23 -0600 (Fri, 06 Feb 2009) | 7 lines
   
   Limit the addition of the Contact header in SIP responses according to various
   SIP RFCs.
   
   (closes issue ASTERISK-12813)
   Reported by: hjourdain
   Tested by: mnicholson
 ........
................

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

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