Don't process re-subscribes as new subscriptions.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@16804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
BJ Weschke 20 years ago
parent b7c52b3416
commit 225d8d5270

@ -6534,6 +6534,10 @@ static int cb_extensionstate(char *context, char* exten, int state, void *data)
{ {
struct sip_pvt *p = data; struct sip_pvt *p = data;
if (p == (struct sip_pvt *) NULL) {
ast_log(LOG_ERROR, "We're sent state change for channel we don't know... Major issue!!!!! Notify management!!!\n");
return 0;
}
switch(state) { switch(state) {
case AST_EXTENSION_DEACTIVATED: /* Retry after a while */ case AST_EXTENSION_DEACTIVATED: /* Retry after a while */
case AST_EXTENSION_REMOVED: /* Extension is gone */ case AST_EXTENSION_REMOVED: /* Extension is gone */
@ -11024,6 +11028,9 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
} else if (debug && ignore) } else if (debug && ignore)
ast_verbose("Ignoring this SUBSCRIBE request\n"); ast_verbose("Ignoring this SUBSCRIBE request\n");
/* Don't treat this SUBSCRIBE request as new if it isn't */
if (!p->lastinvite) {
/* Find parameters to Event: header value and remove them for now */ /* Find parameters to Event: header value and remove them for now */
if ((eventparam = strchr(event, ';'))) if ((eventparam = strchr(event, ';')))
*eventparam++ = '\0'; *eventparam++ = '\0';
@ -11112,6 +11119,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
if (p->subscribed != MWI_NOTIFICATION) if (p->subscribed != MWI_NOTIFICATION)
p->stateid = ast_extension_state_add(p->context, p->exten, cb_extensionstate, p); p->stateid = ast_extension_state_add(p->context, p->exten, cb_extensionstate, p);
} }
}
if (!ignore && p) if (!ignore && p)
p->lastinvite = seqno; p->lastinvite = seqno;

Loading…
Cancel
Save