diff options
author | David M. Lee <dlee@digium.com> | 2013-10-31 14:45:03 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-10-31 14:45:03 +0000 |
commit | 069da1e75afc22db5c004ebb9b67f83d2a72e8d7 (patch) | |
tree | 5f743ea6364a6ab8a32274291d2c450b7c6ab9ea | |
parent | 4746c068dc99303b7b97456ba6a0df173f8fe526 (diff) |
stasis: add functions embarrassingly missing from r400522
I neglected to implement two of the endpoint subscription functions when
I did the work. Normally, you'll only hit that when you unsubscribe from
a specific endpoint.
........
Merged revisions 402276 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | res/stasis/app.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/res/stasis/app.c b/res/stasis/app.c index a4592b058..99af6ee57 100644 --- a/res/stasis/app.c +++ b/res/stasis/app.c @@ -934,3 +934,19 @@ int app_subscribe_endpoint(struct app *app, struct ast_endpoint *endpoint) return 0; } } + +int app_unsubscribe_endpoint_id(struct app *app, const char *endpoint_id) +{ + if (!app || !endpoint_id) { + return -1; + } + + return unsubscribe(app, "endpoint", endpoint_id); +} + +int app_is_subscribed_endpoint_id(struct app *app, const char *endpoint_id) +{ + RAII_VAR(struct app_forwards *, forwards, NULL, ao2_cleanup); + forwards = ao2_find(app->forwards, endpoint_id, OBJ_SEARCH_KEY); + return forwards != NULL; +} |