diff options
author | Olle Johansson <oej@edvina.net> | 2006-04-01 00:44:36 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2006-04-01 00:44:36 +0000 |
commit | 46a1b7c73b8d8d47efbd6fb7529562858ae883cf (patch) | |
tree | 43fcce0c87b8cdc7023a1e21f8716fd1d18e482e | |
parent | 2240245389e419771ba69198e5fa69291af806a3 (diff) |
Don't add ast_extension_state on re-subscribes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@16829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_sip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 8f46d4713..2661c900b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -10985,6 +10985,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, char *event = get_header(req, "Event"); /* Get Event package name */ char *accept = get_header(req, "Accept"); char *eventparam; + int resubscribe = (p->subscribed != NONE); if (p->initreq.headers) { /* We already have a dialog */ @@ -10996,7 +10997,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, ast_log(LOG_DEBUG, "Got a subscription within the context of another call, can't handle that - %s (Method %s)\n", p->callid, sip_methods[p->initreq.method].text); return 0; } else if (debug) { - if (p->subscribed != NONE) + if (resubscribe) ast_log(LOG_DEBUG, "Got a re-subscribe on existing subscription %s\n", p->callid); else ast_log(LOG_DEBUG, "Got a new subscription %s (possibly with auth)\n", p->callid); @@ -11109,7 +11110,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); return 0; } - if (p->subscribed != MWI_NOTIFICATION) + if (p->subscribed != MWI_NOTIFICATION && !resubscribe) p->stateid = ast_extension_state_add(p->context, p->exten, cb_extensionstate, p); } |