summaryrefslogtreecommitdiff
path: root/res/stasis
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2018-01-07 21:21:13 -0500
committerCorey Farrell <git@cfware.com>2018-01-07 21:21:13 -0500
commit6870ba5f26ff2019202168c99715c3aa7b6cd7d4 (patch)
tree026252450fa2cfdce564e88d850be5e9c713e367 /res/stasis
parent634d30fb9e1459ca0119d8ff7a75282f2d72bcd9 (diff)
res_stasis: Fix app_is_subscribed_bridge_id.
Instead of searching for bridge_id provided in an argument this function always searched for BRIDGE_ALL first. Rewrite this function to work like the similar functions for channel and endpoint functions. Change-Id: Ib5caca69e11727c5c8a7284a1d00621f40f1e60a
Diffstat (limited to 'res/stasis')
-rw-r--r--res/stasis/app.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/res/stasis/app.c b/res/stasis/app.c
index 667636ec0..5382aef1c 100644
--- a/res/stasis/app.c
+++ b/res/stasis/app.c
@@ -1429,25 +1429,15 @@ int app_unsubscribe_bridge_id(struct stasis_app *app, const char *bridge_id)
int app_is_subscribed_bridge_id(struct stasis_app *app, const char *bridge_id)
{
struct app_forwards *forwards;
- SCOPED_AO2LOCK(lock, app->forwards);
-
- forwards = ao2_find(app->forwards, BRIDGE_ALL, OBJ_SEARCH_KEY | OBJ_NOLOCK);
- if (forwards) {
- ao2_ref(forwards, -1);
- return 1;
- }
if (ast_strlen_zero(bridge_id)) {
bridge_id = BRIDGE_ALL;
}
- forwards = ao2_find(app->forwards, bridge_id, OBJ_SEARCH_KEY | OBJ_NOLOCK);
- if (forwards) {
- ao2_ref(forwards, -1);
- return 1;
- }
+ forwards = ao2_find(app->forwards, bridge_id, OBJ_SEARCH_KEY);
+ ao2_cleanup(forwards);
- return 0;
+ return forwards != NULL;
}
static void *bridge_find(const struct stasis_app *app, const char *id)