34 const char *
app = obj;
82 "Application not found");
96 if (
args->event_source_count <= 0) {
98 "Missing parameter eventSource");
104 "Missing parameter applicationName");
109 args->event_source_count, &json);
117 "Application not found");
121 "Event source does not exist");
125 "Invalid event source URI scheme");
129 "Error processing request");
141 if (
args->event_source_count == 0) {
143 "Missing parameter eventSource");
148 args->event_source_count, &json);
156 "Application not found");
160 "Event source was not subscribed to");
164 "Invalid event source URI scheme");
168 "Error processing request");
void ast_ari_response_error(struct ast_ari_response *response, int response_code, const char *response_text, const char *message_fmt,...)
Fill in an error ast_ari_response.
void ast_ari_response_ok(struct ast_ari_response *response, struct ast_json *message)
Fill in an OK (200) ast_ari_response.
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
@ OBJ_NOLOCK
Assume that the ao2_container is already locked.
static int array(struct ast_channel *chan, const char *cmd, char *var, const char *value)
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
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.
static int append_json(void *obj, void *arg, int flags)
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.
void ast_ari_applications_list(struct ast_variable *headers, struct ast_ari_applications_list_args *args, struct ast_ari_response *response)
List all applications.
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.
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.
Generated file - declares stubs to be implemented in res/ari/resource_applications....
Stasis Application API. See Stasis Application API for detailed documentation.
struct ast_json * stasis_app_object_to_json(struct stasis_app *app)
Return the JSON representation of a Stasis application.
enum stasis_app_subscribe_res stasis_app_subscribe(const char *app_name, const char **event_source_uris, int event_sources_count, struct ast_json **json)
Subscribes an application to a list of event sources.
struct ast_json * stasis_app_to_json(const char *app_name)
Return the JSON representation of a Stasis application.
int stasis_app_event_filter_set(struct stasis_app *app, struct ast_json *filter)
Set the application's event type filter.
enum stasis_app_subscribe_res stasis_app_unsubscribe(const char *app_name, const char **event_source_uris, int event_sources_count, struct ast_json **json)
Unsubscribes an application from a list of event sources.
struct stasis_app * stasis_app_get_by_name(const char *name)
Retrieve a handle to a Stasis application by its name.
struct ao2_container * stasis_app_get_all(void)
Gets the names of all registered Stasis applications.
stasis_app_subscribe_res
Return code for stasis_app_[un]subscribe.
@ STASIS_ASR_EVENT_SOURCE_BAD_SCHEME
@ STASIS_ASR_INTERNAL_ERROR
@ STASIS_ASR_EVENT_SOURCE_NOT_FOUND
@ STASIS_ASR_APP_NOT_FOUND
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Registered applications container.
Abstract JSON element (object, array, string, int, ...).
Structure for variables, used for configurations and for channel variables.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.