diff options
Diffstat (limited to 'res/ari')
-rw-r--r-- | res/ari/resource_applications.h | 4 | ||||
-rw-r--r-- | res/ari/resource_endpoints.c | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/res/ari/resource_applications.h b/res/ari/resource_applications.h index 888f513de..be62e9d5f 100644 --- a/res/ari/resource_applications.h +++ b/res/ari/resource_applications.h @@ -67,7 +67,7 @@ void ast_ari_applications_get(struct ast_variable *headers, struct ast_ari_appli struct ast_ari_applications_subscribe_args { /*! Application's name */ const char *application_name; - /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName} */ + /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName} */ const char **event_source; /*! Length of event_source array. */ size_t event_source_count; @@ -99,7 +99,7 @@ void ast_ari_applications_subscribe(struct ast_variable *headers, struct ast_ari struct ast_ari_applications_unsubscribe_args { /*! Application's name */ const char *application_name; - /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName} */ + /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName} */ const char **event_source; /*! Length of event_source array. */ size_t event_source_count; diff --git a/res/ari/resource_endpoints.c b/res/ari/resource_endpoints.c index 16b7ebd8d..ff2b150dd 100644 --- a/res/ari/resource_endpoints.c +++ b/res/ari/resource_endpoints.c @@ -34,6 +34,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/stasis_app.h" #include "asterisk/stasis_endpoints.h" #include "asterisk/channel.h" +#include "asterisk/message.h" void ast_ari_endpoints_list(struct ast_variable *headers, struct ast_ari_endpoints_list_args *args, @@ -82,6 +83,7 @@ void ast_ari_endpoints_list(struct ast_variable *headers, ast_ari_response_ok(response, ast_json_ref(json)); } + void ast_ari_endpoints_list_by_tech(struct ast_variable *headers, struct ast_ari_endpoints_list_by_tech_args *args, struct ast_ari_response *response) @@ -89,14 +91,17 @@ void ast_ari_endpoints_list_by_tech(struct ast_variable *headers, RAII_VAR(struct stasis_cache *, cache, NULL, ao2_cleanup); RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup); RAII_VAR(struct ast_json *, json, NULL, ast_json_unref); + struct ast_endpoint *tech_endpoint; struct ao2_iterator i; void *obj; - if (!ast_get_channel_tech(args->tech)) { + tech_endpoint = ast_endpoint_find_by_id(args->tech); + if (!tech_endpoint) { ast_ari_response_error(response, 404, "Not Found", "No Endpoints found - invalid tech %s", args->tech); return; } + ao2_ref(tech_endpoint, -1); cache = ast_endpoint_cache(); if (!cache) { @@ -146,6 +151,7 @@ void ast_ari_endpoints_list_by_tech(struct ast_variable *headers, ao2_iterator_destroy(&i); ast_ari_response_ok(response, ast_json_ref(json)); } + void ast_ari_endpoints_get(struct ast_variable *headers, struct ast_ari_endpoints_get_args *args, struct ast_ari_response *response) |