diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-25 16:16:13 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-25 16:16:13 +0000 |
commit | eb7b5070af9380b2ff503706a59bd12ac0ac7b6a (patch) | |
tree | e4044197cb64885e216305791758aa999a642205 /channels | |
parent | b918dc4720aded052250add43cc961bfca64b806 (diff) |
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/branches/1.4@104084 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index de46b9b44..eca31b6fc 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -14812,6 +14812,18 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, } if (!ast_test_flag(req, SIP_PKT_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 (ast_test_flag(req, SIP_PKT_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); + ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); + return 0; + } + /* Use this as the basis */ if (ast_test_flag(req, SIP_PKT_DEBUG)) ast_verbose("Creating new subscription\n"); |