aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-09 19:16:30 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-09 19:16:30 +0000
commit261feda01af47139efb40228aac1cd8db014e7d8 (patch)
tree25ab7dea118a70dd7fa7c338224f77175c0cab40 /channels
parentb1aec97696b025ee1627b1e2eeec23bbcd40c9fe (diff)
Merged revisions 142218 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r142218 | mmichelson | 2008-09-09 14:15:28 -0500 (Tue, 09 Sep 2008) | 14 lines Make sure that the branch sent in CANCEL requests matches the branch of the INVITE it is cancelling. (closes issue #13381) Reported by: atca_pres Patches: 13381v2.patch uploaded by putnopvut (license 60) Tested by: atca_pres (closes issue #13198) Reported by: rickead2000 Tested by: rickead2000 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@142219 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 40054a305..87af90bc5 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1316,6 +1316,7 @@ struct sip_pvt {
int authtries; /*!< Times we've tried to authenticate */
int expiry; /*!< How long we take to expire */
long branch; /*!< The branch identifier of this session */
+ long invite_branch; /*!< The branch used when we sent the initial INVITE */
char tag[11]; /*!< Our tag for this session */
int sessionid; /*!< SDP Session ID */
int sessionversion; /*!< SDP Session Version */
@@ -7715,7 +7716,10 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in
seqno = p->ocseq;
}
- if (newbranch) {
+ if (sipmethod == SIP_CANCEL) {
+ p->branch = p->invite_branch;
+ build_via(p);
+ } else if (newbranch) {
p->branch ^= ast_random();
build_via(p);
}
@@ -9088,6 +9092,7 @@ static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init)
req.method = sipmethod;
if (init) {/* Bump branch even on initial requests */
p->branch ^= ast_random();
+ p->invite_branch = p->branch;
build_via(p);
}
if (init > 1)