[Home]

Summary:ASTERISK-13462: [patch] CANCEL gets different via header branch than INVITE
Reporter:Olle Johansson (oej)Labels:
Date Opened:2009-01-27 06:05:05.000-0600Date Closed:2009-01-27 09:19:20.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Interoperability
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bug14346.diff
Description:Asterisk 1.4 sends one branch in INVITE and one in CANCEL. THis is not compliant with RFC 3261, that says clearly that the cancel needs the same branch.

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

INVITE sip:00468964020@sip.edvina.net SIP/2.0
Via: SIP/2.0/UDP 212.3.14.231:5060;branch=z9hG4bK5dde1136;rport

CANCEL sip:00468964020@sip.edvina.net SIP/2.0
Via: SIP/2.0/UDP 212.3.14.231:5060;branch=z9hG4bK7215d7d1;rport

Comments:By: Olle Johansson (oej) 2009-01-27 08:22:57.000-0600

Seems like the patch in revision 142079 somehow did not make it properly, as the code now creates TWO different branches before the first INVITE, one stored in p->invite_branch and one in p->branch. This is no good.

Attaching patch that through extra logging clearly shows that this is the case.

By: Olle Johansson (oej) 2009-01-27 08:27:36.000-0600

Index: channels/chan_sip.c
===================================================================
--- channels/chan_sip.c (revision 171522)
+++ channels/chan_sip.c (working copy)
@@ -7200,7 +7200,7 @@
if (init > 1)
initreqprep(&req, p, sipmethod);
else
- reqprep(&req, p, sipmethod, 0, 1);
+ reqprep(&req, p, sipmethod, 0, 0);
} else
reqprep(&req, p, sipmethod, 0, 1);

Patch committed. Sometimes it's simple.

By: Digium Subversion (svnbot) 2009-01-27 08:32:40.000-0600

Repository: asterisk
Revision: 171527

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r171527 | oej | 2009-01-27 08:32:40 -0600 (Tue, 27 Jan 2009) | 13 lines

Use the same branch tag in CANCEL as in INVITE

Originally putnopvut implemented some changes in revision 142079 that according to the bug report seemed to have worked then, but somehow fails now.
I guess code, as humans, get old and forget stuff. Anyway, this bug caused CANCEL not to work with picky systems.

Thanks Fredrik for pointing out where the bug in the SIP messaging was.

(closes issue ASTERISK-13462)
Reported by: oej
Patches:
     bug14346.diff uploaded by oej (license 306)
Tested by: oej

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

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

By: Olle Johansson (oej) 2009-01-27 08:48:56.000-0600

The code in trunk is a bit different. I need to test if this problem exists there as well separately. Re-opening this bug report.

By: Digium Subversion (svnbot) 2009-01-27 08:59:39.000-0600

Repository: asterisk
Revision: 171528

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r171528 | oej | 2009-01-27 08:59:39 -0600 (Tue, 27 Jan 2009) | 23 lines

Solving the same issue, but a bit different in trunk...

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

........
r171527 | oej | 2009-01-27 15:33:20 +0100 (Tis, 27 Jan 2009) | 13 lines

Use the same branch tag in CANCEL as in INVITE

Originally putnopvut implemented some changes in revision 142079 that according to the bug report seemed to have worked then, but somehow fails now.
I guess code, as humans, get old and forget stuff. Anyway, this bug caused CANCEL not to work with picky systems.

Thanks Fredrik for pointing out where the bug in the SIP messaging was.

(closes issue ASTERISK-13462)
Reported by: oej
Patches:
     bug14346.diff uploaded by oej (license 306)
Tested by: oej

........

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

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

By: Digium Subversion (svnbot) 2009-01-27 09:12:30.000-0600

Repository: asterisk
Revision: 171529

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

------------------------------------------------------------------------
r171529 | oej | 2009-01-27 09:12:30 -0600 (Tue, 27 Jan 2009) | 31 lines

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

................
r171528 | oej | 2009-01-27 16:00:19 +0100 (Tis, 27 Jan 2009) | 23 lines

Solving the same issue, but a bit different in trunk...

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

........
r171527 | oej | 2009-01-27 15:33:20 +0100 (Tis, 27 Jan 2009) | 13 lines

Use the same branch tag in CANCEL as in INVITE

Originally putnopvut implemented some changes in revision 142079 that according to the bug report seemed to have worked then, but somehow fails now.
I guess code, as humans, get old and forget stuff. Anyway, this bug caused CANCEL not to work with picky systems.

Thanks Fredrik for pointing out where the bug in the SIP messaging was.

(closes issue ASTERISK-13462)
Reported by: oej
Patches:
     bug14346.diff uploaded by oej (license 306)
Tested by: oej

........

................

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

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

By: Digium Subversion (svnbot) 2009-01-27 09:19:19.000-0600

Repository: asterisk
Revision: 171540

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

------------------------------------------------------------------------
r171540 | oej | 2009-01-27 09:19:19 -0600 (Tue, 27 Jan 2009) | 31 lines

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

................
r171528 | oej | 2009-01-27 16:00:19 +0100 (Tis, 27 Jan 2009) | 23 lines

Solving the same issue, but a bit different in trunk...

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

........
r171527 | oej | 2009-01-27 15:33:20 +0100 (Tis, 27 Jan 2009) | 13 lines

Use the same branch tag in CANCEL as in INVITE

Originally putnopvut implemented some changes in revision 142079 that according to the bug report seemed to have worked then, but somehow fails now.
I guess code, as humans, get old and forget stuff. Anyway, this bug caused CANCEL not to work with picky systems.

Thanks Fredrik for pointing out where the bug in the SIP messaging was.

(closes issue ASTERISK-13462)
Reported by: oej
Patches:
     bug14346.diff uploaded by oej (license 306)
Tested by: oej

........

................

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

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