summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2007-07-06 23:05:24 +0000
committerRussell Bryant <russell@russellbryant.com>2007-07-06 23:05:24 +0000
commit1da115c8d997bd60b5e31a89e8d79ea8fc775e79 (patch)
tree4d369e1a66555fefb1a8668e03f72f4489dbb505
parent80f8dd3f812acb9c8a9bde16297411dcc6675fed (diff)
Merged revisions 73769 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r73769 | russell | 2007-07-06 18:02:58 -0500 (Fri, 06 Jul 2007) | 12 lines Merged revisions 73768 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r73768 | russell | 2007-07-06 18:01:22 -0500 (Fri, 06 Jul 2007) | 4 lines If a sip_pvt struct has already registered an extension state callback, remove the old one before adding a new one. If this isn't done, Asterisk will crash. (issue #10120) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-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 53e637993..d156b7dc0 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -15400,8 +15400,11 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
}
/* Add subscription for extension state from the PBX core */
- 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;