From: Mark Michelson Date: Wed, 10 Jun 2009 20:18:21 +0000 (+0000) Subject: Merged revisions 199958 via svnmerge from X-Git-Tag: 1.6.1.3-rc1~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b95f51e4fcb07472b17c673161eb13f9d6c919fe;p=thirdparty%2Fasterisk.git Merged revisions 199958 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r199958 | mmichelson | 2009-06-10 15:15:48 -0500 (Wed, 10 Jun 2009) | 6 lines 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. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@199963 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1a3292d25f..0d6a1a5115 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -8167,7 +8167,11 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in 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) {