aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-06 23:01:22 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-06 23:01:22 +0000
commit3ca3c3b8bd9a1f748a6cc9b47787e0345a4cee8a (patch)
tree98e18109999f86145466b40b01a19e56738302ec
parent9fbc77488119d12eb182cbb3d10ec7a08a9058b5 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.2@73768 f38db490-d61c-443f-a65b-d21fe96a405b
-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 e01fbf9e3..eb8e55baa 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11191,8 +11191,11 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
ast_set_flag(p, SIP_NEEDDESTROY);
return 0;
}
- if (p->subscribed != NONE)
+ if (p->subscribed != NONE) {
+ 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);
+ }
}
}