Summary: | ASTERISK-14259: [patch] RFC3261 Via-header branches not done right (section | ||
Reporter: | Vasil Kolev (maniax) | Labels: | |
Date Opened: | 2009-06-03 09:51:01 | Date Closed: | 2009-09-18 11:24:32 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_sip/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) asterisk-1.6.1.0-sip-branch.patch ( 1) asterisk_broken_transaction.pcap ( 2) invite_new_branch_trunk.diff | |
Description: | We're testing asterisk and res_fax against a Zoiper Communicator and got into a SIP issue. When there's a re-INVITE to T.38, the branch parameter is the same as for the INVITE, which in fact is wrong, because: RFC 3261, ASTERISK-4.1.1.7 : "...the branch ID was constructed in the fashion described by this specification (that is, globally unique)." ASTERISK-13.2.3: " The branch parameter in the topmost Via header field of the request is examined. If it is present and begins with the magic cookie "z9hG4bK", the request was generated by a client transaction compliant to this specification. Therefore, the branch parameter will be unique across all transactions sent by that client. " Attached is a packet capture that shows this - the re-invite is not accepted by the softphone as it has the same branch parameter and is treated as a retransmit. ****** ADDITIONAL INFORMATION ****** Test versions of Zoiper Communicator can be obtained from www.zoiper.com, and we're available for any further testing. | ||
Comments: | By: Ulf Theobald (tweety) 2009-06-15 01:32:43 Hi maniax, same problem here with OpenStage phones and Patton/Inalp Media Gateways. ReInvites get simply dropped, without any error signaling. I'm not sure which behavior is right, because some other Devices (e.g. Microsoft OCS Mediation Server) needs a the same branch parameter in reinvites. With the attached patch, you can control, if a new branch will be generated. By: Olle Johansson (oej) 2009-09-10 14:33:13 This is an issue from Asterisk 1.4 upwards. The branch needs to be updated for all transactions except ACK and CANCEL. By: Olle Johansson (oej) 2009-09-10 14:34:24 I don't agree with making this a configuration option though, it should be on by default. THanks for reporting this! By: Olle Johansson (oej) 2009-09-10 14:35:25 Btw - you missed reading the bug guidelines where we say "Please don't upload PCAPs". Read them again, so you are prepared for the next bug report. Thanks :-) /O By: Olle Johansson (oej) 2009-09-10 14:36:01 I can't believe that this bug report has been hanging since June. My apologies. By: Digium Subversion (svnbot) 2009-09-18 11:21:06 Repository: asterisk Revision: 219450 U branches/1.4/channels/chan_sip.c ------------------------------------------------------------------------ r219450 | dvossel | 2009-09-18 11:21:05 -0500 (Fri, 18 Sep 2009) | 14 lines via-header branches not updated correctly on INVITE INVITE requests must always contain a new unique branch id. When a new branch id is created for an INVITE, the dialog's invite_branch variable must be updated so CANCEL requests use the correct branch id. (closes issue ASTERISK-14259) Reported by: maniax Patches: asterisk-1.6.1.0-sip-branch.patch uploaded by tweety (license 608) invite_new_branch_trunk.diff uploaded by dvossel (license 671) Tested by: maniax, dvossel ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=219450 By: Digium Subversion (svnbot) 2009-09-18 11:22:32 Repository: asterisk Revision: 219451 _U trunk/ U trunk/channels/chan_sip.c ------------------------------------------------------------------------ r219451 | dvossel | 2009-09-18 11:22:31 -0500 (Fri, 18 Sep 2009) | 20 lines Merged revisions 219450 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r219450 | dvossel | 2009-09-18 11:19:15 -0500 (Fri, 18 Sep 2009) | 14 lines via-header branches not updated correctly on INVITE INVITE requests must always contain a new unique branch id. When a new branch id is created for an INVITE, the dialog's invite_branch variable must be updated so CANCEL requests use the correct branch id. (closes issue ASTERISK-14259) Reported by: maniax Patches: asterisk-1.6.1.0-sip-branch.patch uploaded by tweety (license 608) invite_new_branch_trunk.diff uploaded by dvossel (license 671) Tested by: maniax, dvossel ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=219451 By: Digium Subversion (svnbot) 2009-09-18 11:23:21 Repository: asterisk Revision: 219452 _U branches/1.6.2/ U branches/1.6.2/channels/chan_sip.c ------------------------------------------------------------------------ r219452 | dvossel | 2009-09-18 11:23:21 -0500 (Fri, 18 Sep 2009) | 27 lines Merged revisions 219451 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r219451 | dvossel | 2009-09-18 11:20:41 -0500 (Fri, 18 Sep 2009) | 20 lines Merged revisions 219450 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r219450 | dvossel | 2009-09-18 11:19:15 -0500 (Fri, 18 Sep 2009) | 14 lines via-header branches not updated correctly on INVITE INVITE requests must always contain a new unique branch id. When a new branch id is created for an INVITE, the dialog's invite_branch variable must be updated so CANCEL requests use the correct branch id. (closes issue ASTERISK-14259) Reported by: maniax Patches: asterisk-1.6.1.0-sip-branch.patch uploaded by tweety (license 608) invite_new_branch_trunk.diff uploaded by dvossel (license 671) Tested by: maniax, dvossel ........ ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=219452 By: Digium Subversion (svnbot) 2009-09-18 11:23:52 Repository: asterisk Revision: 219453 _U branches/1.6.1/ U branches/1.6.1/channels/chan_sip.c ------------------------------------------------------------------------ r219453 | dvossel | 2009-09-18 11:23:51 -0500 (Fri, 18 Sep 2009) | 27 lines Merged revisions 219451 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r219451 | dvossel | 2009-09-18 11:20:41 -0500 (Fri, 18 Sep 2009) | 20 lines Merged revisions 219450 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r219450 | dvossel | 2009-09-18 11:19:15 -0500 (Fri, 18 Sep 2009) | 14 lines via-header branches not updated correctly on INVITE INVITE requests must always contain a new unique branch id. When a new branch id is created for an INVITE, the dialog's invite_branch variable must be updated so CANCEL requests use the correct branch id. (closes issue ASTERISK-14259) Reported by: maniax Patches: asterisk-1.6.1.0-sip-branch.patch uploaded by tweety (license 608) invite_new_branch_trunk.diff uploaded by dvossel (license 671) Tested by: maniax, dvossel ........ ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=219453 By: Digium Subversion (svnbot) 2009-09-18 11:24:31 Repository: asterisk Revision: 219454 _U branches/1.6.0/ U branches/1.6.0/channels/chan_sip.c ------------------------------------------------------------------------ r219454 | dvossel | 2009-09-18 11:24:31 -0500 (Fri, 18 Sep 2009) | 27 lines Merged revisions 219451 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r219451 | dvossel | 2009-09-18 11:20:41 -0500 (Fri, 18 Sep 2009) | 20 lines Merged revisions 219450 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r219450 | dvossel | 2009-09-18 11:19:15 -0500 (Fri, 18 Sep 2009) | 14 lines via-header branches not updated correctly on INVITE INVITE requests must always contain a new unique branch id. When a new branch id is created for an INVITE, the dialog's invite_branch variable must be updated so CANCEL requests use the correct branch id. (closes issue ASTERISK-14259) Reported by: maniax Patches: asterisk-1.6.1.0-sip-branch.patch uploaded by tweety (license 608) invite_new_branch_trunk.diff uploaded by dvossel (license 671) Tested by: maniax, dvossel ........ ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=219454 |