[asterisk-commits] mmichelson: trunk r199958 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 10 15:15:52 CDT 2009


Author: mmichelson
Date: Wed Jun 10 15:15:48 2009
New Revision: 199958

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199958
Log:
Only try to use the invite_branch on outgoing INVITEs with auth credentials.

I have added a comment to the code to help ease understanding of the logic here
as well.


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=199958&r1=199957&r2=199958
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jun 10 15:15:48 2009
@@ -8967,7 +8967,11 @@
 		seqno = p->ocseq;
 	}
 	
-	if (sipmethod == SIP_CANCEL || sipmethod == SIP_INVITE) {
+	/* 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 && !ast_strlen_zero(p->options->auth))) {
 		p->branch = p->invite_branch;
 		build_via(p);
 	} else if (newbranch) {




More information about the asterisk-commits mailing list