[svn-commits] mmichelson: branch 1.4 r211807 - /branches/1.4/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 12 13:46:12 CDT 2009


Author: mmichelson
Date: Wed Aug 12 13:46:09 2009
New Revision: 211807

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=211807
Log:
Backport fix so that outbound CANCEL requests have same branch as challenged INVITEs.

There already was code present to be sure that a CANCEL will contain the same branch-id
as the INVITE it is cancelling. However, for INVITES which are challenged downstream,
this mechanism did not work properly. Now this is taken care of.

This is a backport of a fix already present in all 1.6.X branches and in trunk. It also
fixes ABE-1907.


Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=211807&r1=211806&r2=211807
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Wed Aug 12 13:46:09 2009
@@ -6264,7 +6264,11 @@
 		seqno = p->ocseq;
 	}
 	
-	if (sipmethod == SIP_CANCEL) {
+	/* A CANCEL must have the same branch as the INVITE that it is canceling.
+	 * Similarly, if we need to re-send an INVITE with auth credentials, then we
+	 * need to use the same branch as we did the first time we sent the INVITE.
+	 */
+	if (sipmethod == SIP_CANCEL || (sipmethod == SIP_INVITE && p->options && !ast_strlen_zero(p->options->auth))) {
 		p->branch = p->invite_branch;
 		build_via(p);
 	} else if (newbranch) {




More information about the svn-commits mailing list