summaryrefslogtreecommitdiff
path: root/res/res_stasis.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-11-02 15:52:13 +0000
committerJoshua Colp <jcolp@digium.com>2016-11-07 10:02:25 -0500
commitd30415bfa15989ae0477e374d37daae9694d7ad4 (patch)
tree133520c0aa0b0e7d5849d50c1146911a983420fb /res/res_stasis.c
parent876c6b0c96ce67221ecdbbc31c67c3f4a344061d (diff)
res_stasis: Don't unsubscribe from a NULL bridge.
A NULL bridge has special meaning in res_stasis for unsubscribing. It means that a subscription to ALL bridges should be removed. This should not be done as part of the normal subscription management in the res_stasis channel loop. ASTERISK-26468 Change-Id: I6d5bea8246dd13a22ef86b736aefbf2a39c15af0
Diffstat (limited to 'res/res_stasis.c')
-rw-r--r--res/res_stasis.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_stasis.c b/res/res_stasis.c
index f3d940e2d..e77cdb073 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -1327,7 +1327,9 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc,
bridge = ao2_bump(stasis_app_get_bridge(control));
if (bridge != last_bridge) {
- app_unsubscribe_bridge(app, last_bridge);
+ if (last_bridge) {
+ app_unsubscribe_bridge(app, last_bridge);
+ }
if (bridge) {
app_subscribe_bridge(app, bridge);
}
@@ -1388,7 +1390,9 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc,
ast_bridge_depart(chan);
}
- app_unsubscribe_bridge(app, stasis_app_get_bridge(control));
+ if (stasis_app_get_bridge(control)) {
+ app_unsubscribe_bridge(app, stasis_app_get_bridge(control));
+ }
ao2_cleanup(bridge);
/* Only publish a stasis_end event if it hasn't already been published */