[Home]

Summary:ASTERISK-13803: Asterisk doesn't add Route headers in NOTIFY when the SUBSCRIBE came from a proxy
Reporter:Iñaki Baz Castillo (ibc)Labels:
Date Opened:2009-03-23 12:05:47Date Closed:2009-07-10 12:55:00
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Interoperability
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) no_Route_in_NOTIFY_from_Asterisk.ngrep.txt
Description:Client ---- Proxy ---- Asterisk

The Client sends a SUBSCRIBE (Event: dialog) and the Proxy routes it to Asterisk adding "Record-Route" header.

The correct behaviour would be:
1) Client sends SUBSCRIBE to Proxy
2) Proxy routes SUBSCRIBE to Asterisk adding Record-Route
3) Asterisk replies 200 and mirrors Record-Route in the reply (correct)
4) Proxy routes teh 200 to the Client
5) Asterisk sends an in-dialog NOTIFY containing a Route header (with the value of the received Record-Route).
6) The proxy routes the NOTIFY to the client.

But Asterisk fails in step 5 since the NOTIFY generated by Asterisk doesn't contain a Route header.

Of course, that NOTIFY MUST contain a Route header since it's in fact an in-dialog request, and the dialog was created using loose_route (the request forming the dialog, the SUBSCRIBE, had Record-Route inserted by the proxy).

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

I attach a ngrep capture showing the issue.
Comments:By: Iñaki Baz Castillo (ibc) 2009-03-23 14:23:48

However the NOTIFY is sent from Asterisk to the proxy even if it doesn't contain the required Route header. Anyway it *should* contain the Route header.

By: Dan Moschuk (dnatural) 2009-03-24 21:18:19

Hi!
This bug has bugged me for a long time, and seeing this report finally made me do something about it.  
I can't upload a patch because I do not have a license on file (nor will I ever sign one) but I'm happy to email you what I came up with today.  You only need to add two lines:

chan_sip.c around line 7265        

       add_header(req, "Via", p->via);
       /* SLD: FIXME?: do Route: here too?  I think not cos this is the first request.
        * OTOH, then we won't have anything in p->route anyway */
       add_route(req, p->route);
       ^^^^^^^^^^^^^^^^^^^^^^^^^

chan_sip.c around line 15563

               copy_request(&p->initreq, req);
               check_via(p, req);
               build_route(p, req, 0);
               ^^^^^^^^^^^^^^^^^^^^^^^

I've tested this very briefly, and so far it appears to be correct, but who knows.



By: Iñaki Baz Castillo (ibc) 2009-03-25 05:53:23

I've applied it it 1.4.23.2 and seems to work. I will check it properly and tell here the result.

Thanks a lot!

By: Digium Subversion (svnbot) 2009-07-10 10:51:37

Repository: asterisk
Revision: 205775

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r205775 | mmichelson | 2009-07-10 10:51:37 -0500 (Fri, 10 Jul 2009) | 10 lines

Ensure that outbound NOTIFY requests are properly routed through stateful proxies.

With this change, we make note of Record-Route headers present in any SUBSCRIBE
request that we receive so that our outbound NOTIFY requests will have the proper
Route headers in them.

(closes issue ASTERISK-13803)
Reported by: ibc


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

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

By: Digium Subversion (svnbot) 2009-07-10 10:56:46

Repository: asterisk
Revision: 205776

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r205776 | mmichelson | 2009-07-10 10:56:45 -0500 (Fri, 10 Jul 2009) | 16 lines

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

........
 r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
 
 Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
 
 With this change, we make note of Record-Route headers present in any SUBSCRIBE
 request that we receive so that our outbound NOTIFY requests will have the proper
 Route headers in them.
 
 (closes issue ASTERISK-13803)
 Reported by: ibc
........

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

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

By: Digium Subversion (svnbot) 2009-07-10 10:57:09

Repository: asterisk
Revision: 205777

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

------------------------------------------------------------------------
r205777 | mmichelson | 2009-07-10 10:57:09 -0500 (Fri, 10 Jul 2009) | 23 lines

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

................
 r205776 | mmichelson | 2009-07-10 10:56:45 -0500 (Fri, 10 Jul 2009) | 16 lines
 
 Merged revisions 205775 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
   
   Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
   
   With this change, we make note of Record-Route headers present in any SUBSCRIBE
   request that we receive so that our outbound NOTIFY requests will have the proper
   Route headers in them.
   
   (closes issue ASTERISK-13803)
   Reported by: ibc
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-07-10 10:57:45

Repository: asterisk
Revision: 205778

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

------------------------------------------------------------------------
r205778 | mmichelson | 2009-07-10 10:57:45 -0500 (Fri, 10 Jul 2009) | 23 lines

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

................
 r205776 | mmichelson | 2009-07-10 10:56:45 -0500 (Fri, 10 Jul 2009) | 16 lines
 
 Merged revisions 205775 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
   
   Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
   
   With this change, we make note of Record-Route headers present in any SUBSCRIBE
   request that we receive so that our outbound NOTIFY requests will have the proper
   Route headers in them.
   
   (closes issue ASTERISK-13803)
   Reported by: ibc
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-07-10 10:58:28

Repository: asterisk
Revision: 205779

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

------------------------------------------------------------------------
r205779 | mmichelson | 2009-07-10 10:58:27 -0500 (Fri, 10 Jul 2009) | 23 lines

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

................
 r205776 | mmichelson | 2009-07-10 10:56:45 -0500 (Fri, 10 Jul 2009) | 16 lines
 
 Merged revisions 205775 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
   
   Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
   
   With this change, we make note of Record-Route headers present in any SUBSCRIBE
   request that we receive so that our outbound NOTIFY requests will have the proper
   Route headers in them.
   
   (closes issue ASTERISK-13803)
   Reported by: ibc
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-07-10 12:39:14

Repository: asterisk
Revision: 205877

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r205877 | mmichelson | 2009-07-10 12:39:14 -0500 (Fri, 10 Jul 2009) | 23 lines

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

................
 r205776 | mmichelson | 2009-07-10 10:56:45 -0500 (Fri, 10 Jul 2009) | 16 lines
 
 Merged revisions 205775 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
   
   Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
   
   With this change, we make note of Record-Route headers present in any SUBSCRIBE
   request that we receive so that our outbound NOTIFY requests will have the proper
   Route headers in them.
   
   (closes issue ASTERISK-13803)
   Reported by: ibc
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-07-10 12:39:58

Repository: asterisk
Revision: 205878

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r205878 | mmichelson | 2009-07-10 12:39:58 -0500 (Fri, 10 Jul 2009) | 30 lines

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

................
 r205877 | mmichelson | 2009-07-10 12:39:13 -0500 (Fri, 10 Jul 2009) | 23 lines
 
 Merged revisions 205776 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/trunk
 
 ................
   r205776 | mmichelson | 2009-07-10 10:56:45 -0500 (Fri, 10 Jul 2009) | 16 lines
   
   Merged revisions 205775 via svnmerge from
   https://origsvn.digium.com/svn/asterisk/branches/1.4
   
   ........
     r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
     
     Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
     
     With this change, we make note of Record-Route headers present in any SUBSCRIBE
     request that we receive so that our outbound NOTIFY requests will have the proper
     Route headers in them.
     
     (closes issue ASTERISK-13803)
     Reported by: ibc
   ........
 ................
................

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

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

By: Digium Subversion (svnbot) 2009-07-10 12:42:20

Repository: asterisk
Revision: 205879

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

------------------------------------------------------------------------
r205879 | mmichelson | 2009-07-10 12:42:20 -0500 (Fri, 10 Jul 2009) | 37 lines

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

................
 r205878 | mmichelson | 2009-07-10 12:39:57 -0500 (Fri, 10 Jul 2009) | 30 lines
 
 Merged revisions 205877 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ................
   r205877 | mmichelson | 2009-07-10 12:39:13 -0500 (Fri, 10 Jul 2009) | 23 lines
   
   Merged revisions 205776 via svnmerge from
   https://origsvn.digium.com/svn/asterisk/trunk
   
   ................
     r205776 | mmichelson | 2009-07-10 10:56:45 -0500 (Fri, 10 Jul 2009) | 16 lines
     
     Merged revisions 205775 via svnmerge from
     https://origsvn.digium.com/svn/asterisk/branches/1.4
     
     ........
       r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
       
       Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
       
       With this change, we make note of Record-Route headers present in any SUBSCRIBE
       request that we receive so that our outbound NOTIFY requests will have the proper
       Route headers in them.
       
       (closes issue ASTERISK-13803)
       Reported by: ibc
     ........
   ................
 ................
................

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

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

By: Digium Subversion (svnbot) 2009-07-10 12:50:16

Repository: asterisk
Revision: 205881

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

------------------------------------------------------------------------
r205881 | mmichelson | 2009-07-10 12:50:15 -0500 (Fri, 10 Jul 2009) | 37 lines

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

................
 r205878 | mmichelson | 2009-07-10 12:39:57 -0500 (Fri, 10 Jul 2009) | 30 lines
 
 Merged revisions 205877 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ................
   r205877 | mmichelson | 2009-07-10 12:39:13 -0500 (Fri, 10 Jul 2009) | 23 lines
   
   Merged revisions 205776 via svnmerge from
   https://origsvn.digium.com/svn/asterisk/trunk
   
   ................
     r205776 | mmichelson | 2009-07-10 10:56:45 -0500 (Fri, 10 Jul 2009) | 16 lines
     
     Merged revisions 205775 via svnmerge from
     https://origsvn.digium.com/svn/asterisk/branches/1.4
     
     ........
       r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
       
       Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
       
       With this change, we make note of Record-Route headers present in any SUBSCRIBE
       request that we receive so that our outbound NOTIFY requests will have the proper
       Route headers in them.
       
       (closes issue ASTERISK-13803)
       Reported by: ibc
     ........
   ................
 ................
................

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

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

By: Digium Subversion (svnbot) 2009-07-10 12:54:59

Repository: asterisk
Revision: 205882

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

------------------------------------------------------------------------
r205882 | mmichelson | 2009-07-10 12:54:59 -0500 (Fri, 10 Jul 2009) | 37 lines

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

................
 r205878 | mmichelson | 2009-07-10 12:39:57 -0500 (Fri, 10 Jul 2009) | 30 lines
 
 Merged revisions 205877 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ................
   r205877 | mmichelson | 2009-07-10 12:39:13 -0500 (Fri, 10 Jul 2009) | 23 lines
   
   Merged revisions 205776 via svnmerge from
   https://origsvn.digium.com/svn/asterisk/trunk
   
   ................
     r205776 | mmichelson | 2009-07-10 10:56:45 -0500 (Fri, 10 Jul 2009) | 16 lines
     
     Merged revisions 205775 via svnmerge from
     https://origsvn.digium.com/svn/asterisk/branches/1.4
     
     ........
       r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
       
       Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
       
       With this change, we make note of Record-Route headers present in any SUBSCRIBE
       request that we receive so that our outbound NOTIFY requests will have the proper
       Route headers in them.
       
       (closes issue ASTERISK-13803)
       Reported by: ibc
     ........
   ................
 ................
................

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

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