aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--channels/chan_sip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 92b29c9da..a3b127a84 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14624,8 +14624,11 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
return 0;
}
- if (p->subscribed != MWI_NOTIFICATION && !resubscribe)
+ if (p->subscribed != MWI_NOTIFICATION && !resubscribe) {
+ if (p->stateid > -1)
+ ast_extension_state_del(p->stateid, cb_extensionstate);
p->stateid = ast_extension_state_add(p->context, p->exten, cb_extensionstate, p);
+ }
if (!ast_test_flag(req, SIP_PKT_IGNORE) && p)
p->lastinvite = seqno;