Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Generated file - declares stubs to be implemented in res/ari/resource_applications.c. More...
#include "asterisk/ari.h"
Go to the source code of this file.
Data Structures | |
struct | ast_ari_applications_filter_args |
struct | ast_ari_applications_get_args |
struct | ast_ari_applications_list_args |
struct | ast_ari_applications_subscribe_args |
struct | ast_ari_applications_unsubscribe_args |
Functions | |
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... | |
int | ast_ari_applications_filter_parse_body (struct ast_json *body, struct ast_ari_applications_filter_args *args) |
Body parsing function for /applications/{applicationName}/eventFilter. 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... | |
int | ast_ari_applications_subscribe_parse_body (struct ast_json *body, struct ast_ari_applications_subscribe_args *args) |
Body parsing function for /applications/{applicationName}/subscription. 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... | |
int | ast_ari_applications_unsubscribe_parse_body (struct ast_json *body, struct ast_ari_applications_unsubscribe_args *args) |
Body parsing function for /applications/{applicationName}/subscription. More... | |
Generated file - declares stubs to be implemented in res/ari/resource_applications.c.
Stasis application resources
Definition in file resource_applications.h.
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, args, ast_ari_response_error(), ast_ari_response_ok(), stasis_app_event_filter_set(), stasis_app_get_by_name(), and stasis_app_object_to_json().
Referenced by ast_ari_applications_filter_cb().
int ast_ari_applications_filter_parse_body | ( | struct ast_json * | body, |
struct ast_ari_applications_filter_args * | args | ||
) |
Body parsing function for /applications/{applicationName}/eventFilter.
body | The JSON body from which to parse parameters. | |
[out] | args | The args structure to parse into. |
zero | on success |
non-zero | on failure |
Definition at line 470 of file res_ari_applications.c.
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 args, 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 args, ast_ari_response_error(), ast_ari_response_ok(), ast_json_ref(), ast_json_unref(), ast_strlen_zero(), 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().
int ast_ari_applications_subscribe_parse_body | ( | struct ast_json * | body, |
struct ast_ari_applications_subscribe_args * | args | ||
) |
Body parsing function for /applications/{applicationName}/subscription.
body | The JSON body from which to parse parameters. | |
[out] | args | The args structure to parse into. |
zero | on success |
non-zero | on failure |
Definition at line 165 of file res_ari_applications.c.
References args, ast_free, AST_JSON_ARRAY, ast_json_array_get(), ast_json_array_size(), ast_json_object_get(), ast_json_string_get(), ast_json_typeof(), and ast_malloc.
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 args, ast_ari_response_error(), ast_ari_response_ok(), ast_json_ref(), ast_json_unref(), 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().
int ast_ari_applications_unsubscribe_parse_body | ( | struct ast_json * | body, |
struct ast_ari_applications_unsubscribe_args * | args | ||
) |
Body parsing function for /applications/{applicationName}/subscription.
body | The JSON body from which to parse parameters. | |
[out] | args | The args structure to parse into. |
zero | on success |
non-zero | on failure |
Definition at line 317 of file res_ari_applications.c.
References args, ast_free, AST_JSON_ARRAY, ast_json_array_get(), ast_json_array_size(), ast_json_object_get(), ast_json_string_get(), ast_json_typeof(), and ast_malloc.
Referenced by ast_ari_applications_unsubscribe_cb().