aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-07 22:31:25 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-07 22:31:25 +0000
commit994c837c0516d87d00c72856b3dbf7ffe8b4b44b (patch)
tree108c2647163b8af9933d46ad886668a9eb0eadbe
parent0eff10fc13aa0a6a906c53d1023c12ae86a7c8c4 (diff)
Merged revisions 306619 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r306619 | twilson | 2011-02-07 14:15:27 -0800 (Mon, 07 Feb 2011) | 24 lines Merged revisions 306618 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r306618 | twilson | 2011-02-07 13:59:54 -0800 (Mon, 07 Feb 2011) | 17 lines Merged revisions 306617 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r306617 | twilson | 2011-02-07 13:51:43 -0800 (Mon, 07 Feb 2011) | 10 lines Don't allow a REFER w/replaces to replace its own dialog Asterisk currently accepts a REFER with a Refer-To with an embedded Replaces header that matches the dialog of the REFER. This would be a situation like A calls B, A calls C, A transfers B to A, which is just silly. This patch makes the transfer fail instead of making Asterisk freak out and forget to hang other channels up. Review: https://reviewboard.asterisk.org/r/1093/ ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@306670 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a741520c6..14f1cfe2a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14959,6 +14959,14 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi
ast_copy_string(referdata->replaces_callid_fromtag, ptr, sizeof(referdata->replaces_callid_fromtag));
}
+ if (!strcmp(referdata->replaces_callid, transferer->callid) &&
+ (!sip_cfg.pedanticsipchecking ||
+ (!strcmp(referdata->replaces_callid_fromtag, transferer->tag) &&
+ !strcmp(referdata->replaces_callid_totag, transferer->theirtag)))) {
+ ast_log(LOG_WARNING, "Got an attempt to replace own Call-ID on %s\n", transferer->callid);
+ return -4;
+ }
+
if (!sip_cfg.pedanticsipchecking) {
ast_debug(2, "Attended transfer: Will use Replace-Call-ID : %s (No check of from/to tags)\n", referdata->replaces_callid );
} else {