aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-25 16:18:46 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-25 16:18:46 +0000
commit27101419f11b16bbd1cf771363d548f46a75ffe4 (patch)
treebff253507ea43a155763863205c19fd8c3bf37e0 /channels
parent4e42228cd2e78522916656c084543bb6af287ebd (diff)
Merged revisions 104084 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104084 | file | 2008-02-25 12:16:13 -0400 (Mon, 25 Feb 2008) | 6 lines If a resubscription comes in for a dialog we no longer know about tell the remote side that the dialog does not exist so they subscribe again using a new dialog. (closes issue #10727) Reported by: s0l4rb03 Patches: 10727-2.diff uploaded by file (license 11) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104085 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 84a52c420..25071518c 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -17392,6 +17392,18 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
}
if (!req->ignore && !resubscribe) { /* Set up dialog, new subscription */
+ const char *to = get_header(req, "To");
+ char totag[128];
+
+ /* Check to see if a tag was provided, if so this is actually a resubscription of a dialog we no longer know about */
+ if (!ast_strlen_zero(to) && gettag(req, "To", totag, sizeof(totag))) {
+ if (req->debug)
+ ast_verbose("Received resubscription for a dialog we no longer know about. Telling remote side to subscribe again.\n");
+ transmit_response(p, "481 Subscription does not exist", req);
+ p->needdestroy = 1;
+ return 0;
+ }
+
/* Use this as the basis */
if (req->debug)
ast_verbose("Creating new subscription\n");