Asterisk - The Open Source Telephony Project
18.5.0
|
/api-docs/applications.{format} implementation - Stasis application resources More...
Go to the source code of this file.
Functions | |
static int | append_json (void *obj, void *arg, int flags) |
void | ast_ari_applications_filter (struct ast_variable *headers, struct ast_ari_applications_filter_args *args, struct ast_ari_response *response) |
Filter application events types. More... | |
void | ast_ari_applications_get (struct ast_variable *headers, struct ast_ari_applications_get_args *args, struct ast_ari_response *response) |
Get details of an application. More... | |
void | ast_ari_applications_list (struct ast_variable *headers, struct ast_ari_applications_list_args *args, struct ast_ari_response *response) |
List all applications. More... | |
void | ast_ari_applications_subscribe (struct ast_variable *headers, struct ast_ari_applications_subscribe_args *args, struct ast_ari_response *response) |
Subscribe an application to a event source. More... | |
void | ast_ari_applications_unsubscribe (struct ast_variable *headers, struct ast_ari_applications_unsubscribe_args *args, struct ast_ari_response *response) |
Unsubscribe an application from an event source. More... | |
/api-docs/applications.{format} implementation - Stasis application resources
Definition in file resource_applications.c.
|
static |
Definition at line 32 of file resource_applications.c.
References app, array(), ast_json_array_append(), and stasis_app_to_json().
Referenced by ast_ari_applications_list().
void ast_ari_applications_filter | ( | struct ast_variable * | headers, |
struct ast_ari_applications_filter_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Filter application events types.
Allowed and/or disallowed event type filtering can be done. The body (parameter) should specify a JSON key/value object that describes the type of event filtering needed. One, or both of the following keys can be designated:
"allowed" - Specifies an allowed list of event types
"disallowed" - Specifies a disallowed list of event types
Further, each of those key's value should be a JSON array that holds zero, or more JSON key/value objects. Each of these objects must contain the following key with an associated value:
"type" - The type name of the event to filter
The value must be the string name (case sensitive) of the event type that needs filtering. For example:
{ "allowed": [ { "type": "StasisStart" }, { "type": "StasisEnd" } ] }
As this specifies only an allowed list, then only those two event type messages are sent to the application. No other event messages are sent.
The following rules apply:
* If the body is empty, both the allowed and disallowed filters are set empty.
* If both list types are given then both are set to their respective values (note, specifying an empty array for a given type sets that type to empty).
* If only one list type is given then only that type is set. The other type is not updated.
* An empty "allowed" list means all events are allowed.
* An empty "disallowed" list means no events are disallowed.
* Disallowed events take precedence over allowed events if the event type is specified in both lists.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 172 of file resource_applications.c.
References ao2_ref, app, ast_ari_applications_filter_args::application_name, ast_ari_response_error(), ast_ari_response_ok(), ast_ari_applications_filter_args::filter, stasis_app_event_filter_set(), stasis_app_get_by_name(), and stasis_app_object_to_json().
Referenced by ast_ari_applications_filter_cb().
void ast_ari_applications_get | ( | struct ast_variable * | headers, |
struct ast_ari_applications_get_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Get details of an application.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 72 of file resource_applications.c.
References ast_ari_applications_get_args::application_name, ast_ari_response_error(), ast_ari_response_ok(), and stasis_app_to_json().
Referenced by ast_ari_applications_get_cb().
void ast_ari_applications_list | ( | struct ast_variable * | headers, |
struct ast_ari_applications_list_args * | args, | ||
struct ast_ari_response * | response | ||
) |
List all applications.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 42 of file resource_applications.c.
References ao2_callback, ao2_cleanup, ao2_container_count(), ao2_lock, ao2_unlock, append_json(), ast_ari_response_error(), ast_ari_response_ok(), ast_json_array_create(), ast_json_array_size(), ast_json_ref(), ast_json_unref(), NULL, OBJ_NODATA, OBJ_NOLOCK, RAII_VAR, and stasis_app_get_all().
Referenced by ast_ari_applications_list_cb().
void ast_ari_applications_subscribe | ( | struct ast_variable * | headers, |
struct ast_ari_applications_subscribe_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Subscribe an application to a event source.
Returns the state of the application after the subscriptions have changed
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 89 of file resource_applications.c.
References ast_ari_applications_subscribe_args::application_name, ast_ari_response_error(), ast_ari_response_ok(), ast_json_ref(), ast_json_unref(), ast_strlen_zero, ast_ari_applications_subscribe_args::event_source, ast_ari_applications_subscribe_args::event_source_count, NULL, RAII_VAR, stasis_app_subscribe(), STASIS_ASR_APP_NOT_FOUND, STASIS_ASR_EVENT_SOURCE_BAD_SCHEME, STASIS_ASR_EVENT_SOURCE_NOT_FOUND, STASIS_ASR_INTERNAL_ERROR, and STASIS_ASR_OK.
Referenced by ast_ari_applications_subscribe_cb().
void ast_ari_applications_unsubscribe | ( | struct ast_variable * | headers, |
struct ast_ari_applications_unsubscribe_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Unsubscribe an application from an event source.
Returns the state of the application after the subscriptions have changed
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 134 of file resource_applications.c.
References ast_ari_applications_unsubscribe_args::application_name, ast_ari_response_error(), ast_ari_response_ok(), ast_json_ref(), ast_json_unref(), ast_ari_applications_unsubscribe_args::event_source, ast_ari_applications_unsubscribe_args::event_source_count, NULL, RAII_VAR, stasis_app_unsubscribe(), STASIS_ASR_APP_NOT_FOUND, STASIS_ASR_EVENT_SOURCE_BAD_SCHEME, STASIS_ASR_EVENT_SOURCE_NOT_FOUND, STASIS_ASR_INTERNAL_ERROR, and STASIS_ASR_OK.
Referenced by ast_ari_applications_unsubscribe_cb().