[Home]

Summary:ASTERISK-09801: Record-Route fields are not copied when the response is 18x
Reporter:Makoto Dei (makoto)Labels:
Date Opened:2007-07-03 23:47:56Date Closed:2007-10-22 11:16:05
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:In respprep function of chan_sip.c, Record-Route fields are copied
from the request to the response header when the response is 2xx.
But according to RFC 3261 (Table 3: Summary of header fields, P--Z),
Record-Route fields should be also copied when the response is 18x
and should not be copied when the request is REGISTER.

Header field              where       proxy ACK BYE CAN INV OPT REG
Record-Route                R          ar    o   o   o   o   o   -
Record-Route             2xx,18x       mr    -   o   o   o   o   -


One of our partner said that there was a SIP server which this problem
affected.
Comments:By: Joshua C. Colp (jcolp) 2007-07-08 22:10:50

Can you give a final yay or nay on this oej?

By: alienpenguin (alienpenguin) 2007-08-09 07:55:48

Hi, I can confirm this behaviour affects asterisk 1.4.6 as well (it indeed breaks some of our customer's set up).
I have a doubt, doesn't RFC 3261 states that even 1xx (not just 18x) need to have the record route header copied?
However a patch as simple as the following one solves the issue:

--- chan_sip.c  2007-08-09 14:55:29.000000000 +0200
+++ chan_sip.c.new      2007-08-09 14:59:19.000000000 +0200
@@ -5636,7 +5636,8 @@

       init_resp(resp, msg);
       copy_via_headers(p, resp, req, "Via");
-       if (msg[0] == '2')
+       /*  Line below was patched to add record route to 1xx responses as well */
+       if ( (msg[0] == '2') || (msg[0]=='1') )
               copy_all_header(resp, req, "Record-Route");
       copy_header(resp, req, "From");
       ot = get_header(req, "To");

By: Digium Subversion (svnbot) 2007-10-22 11:14:28

Repository: asterisk
Revision: 86756

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r86756 | file | 2007-10-22 11:14:27 -0500 (Mon, 22 Oct 2007) | 4 lines

After reading online I have confirmed that Record-Route headers should be copied to 1xx responses as well.
(closes issue ASTERISK-9801)
Reported by: makoto

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

By: Digium Subversion (svnbot) 2007-10-22 11:16:05

Repository: asterisk
Revision: 86757

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r86757 | file | 2007-10-22 11:16:01 -0500 (Mon, 22 Oct 2007) | 12 lines

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

........
r86756 | file | 2007-10-22 13:35:22 -0300 (Mon, 22 Oct 2007) | 4 lines

After reading online I have confirmed that Record-Route headers should be copied to 1xx responses as well.
(closes issue ASTERISK-9801)
Reported by: makoto

........

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