From a181e534e02fdbdceacff856f810148764dea81b Mon Sep 17 00:00:00 2001 From: "David M. Lee" Date: Thu, 31 Oct 2013 14:43:44 +0000 Subject: [PATCH] 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402276 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/stasis/app.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/res/stasis/app.c b/res/stasis/app.c index a4592b0585..99af6ee57e 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; +} -- 2.47.2