[general]
-enabled = yes ; When set to no, stasis-http support is disabled.
-;pretty = no ; When set to yes, responses from stasis-http are
+enabled = yes ; When set to no, ARI support is disabled.
+;pretty = no ; When set to yes, responses from ARI are
; ; formatted to be human readable.
;allowed_origins = ; Comma separated list of allowed origins, for
; ; Cross-Origin Resource Sharing. May be set to * to
* at the top of the source tree.
*/
-#ifndef _ASTERISK_STASIS_HTTP_H
-#define _ASTERISK_STASIS_HTTP_H
+#ifndef _ASTERISK_ARI_H
+#define _ASTERISK_ARI_H
/*! \file
*
* \brief Stasis RESTful API hooks.
*
* This header file is used mostly as glue code between generated declarations
- * and res_stasis_http.c.
+ * and res_ari.c.
*
* \author David M. Lee, II <dlee@digium.com>
*/
* \brief Configured encoding format for JSON output.
* \return JSON output encoding (compact, pretty, etc.)
*/
-enum ast_json_encoding_format stasis_http_json_format(void);
+enum ast_json_encoding_format ast_ari_json_format(void);
-struct stasis_http_response;
+struct ast_ari_response;
/*!
* \brief Callback type for RESTful method handlers.
typedef void (*stasis_rest_callback)(struct ast_variable *get_params,
struct ast_variable *path_vars,
struct ast_variable *headers,
- struct stasis_http_response *response);
+ struct ast_ari_response *response);
/*!
* \brief Handler for a single RESTful path segment.
/*!
* Response type for RESTful requests
*/
-struct stasis_http_response {
+struct ast_ari_response {
/*! Response message */
struct ast_json *message;
/*! \r\n seperated response headers */
* \return 0 on success.
* \return non-zero on failure.
*/
-int stasis_http_add_handler(struct stasis_rest_handlers *handler);
+int ast_ari_add_handler(struct stasis_rest_handlers *handler);
/*!
* Remove a resource for REST handling.
* \return 0 on success.
* \return non-zero on failure.
*/
-int stasis_http_remove_handler(struct stasis_rest_handlers *handler);
+int ast_ari_remove_handler(struct stasis_rest_handlers *handler);
/*!
* \internal
* \brief Stasis RESTful invocation handler.
*
- * Only call from res_stasis_http and test_stasis_http. Only public to allow
+ * Only call from res_ari and test_ari. Only public to allow
* for unit testing.
*
* \param ser TCP/TLS connection.
* \param headers HTTP headers.
* \param[out] response RESTful HTTP response.
*/
-void stasis_http_invoke(struct ast_tcptls_session_instance *ser,
+void ast_ari_invoke(struct ast_tcptls_session_instance *ser,
const char *uri, enum ast_http_method method,
struct ast_variable *get_params, struct ast_variable *headers,
- struct stasis_http_response *response);
+ struct ast_ari_response *response);
/*!
* \internal
* \brief Service function for API declarations.
*
- * Only call from res_stasis_http and test_stasis_http. Only public to allow
+ * Only call from res_ari and test_ari. Only public to allow
* for unit testing.
*
* \param uri Requested URI, relative to the docs path.
* \param headers HTTP headers.
* \param[out] response RESTful HTTP response.
*/
-void stasis_http_get_docs(const char *uri, struct ast_variable *headers, struct stasis_http_response *response);
+void ast_ari_get_docs(const char *uri, struct ast_variable *headers, struct ast_ari_response *response);
/*! \brief Abstraction for reading/writing JSON to a WebSocket */
-struct ari_websocket_session;
+struct ast_ari_websocket_session;
/*!
* \brief Create an ARI WebSocket session.
* \return New ARI WebSocket session.
* \return \c NULL on error.
*/
-struct ari_websocket_session *ari_websocket_session_create(
+struct ast_ari_websocket_session *ast_ari_websocket_session_create(
struct ast_websocket *ws_session, int (*validator)(struct ast_json *));
/*!
* \return Message received.
* \return \c NULL if WebSocket could not be read.
*/
-struct ast_json *ari_websocket_session_read(
- struct ari_websocket_session *session);
+struct ast_json *ast_ari_websocket_session_read(
+ struct ast_ari_websocket_session *session);
/*!
* \brief Send a message to an ARI WebSocket.
* \return 0 on success.
* \return Non-zero on error.
*/
-int ari_websocket_session_write(struct ari_websocket_session *session,
+int ast_ari_websocket_session_write(struct ast_ari_websocket_session *session,
struct ast_json *message);
/*!
*
* \return JSON message specifying an out-of-memory error.
*/
-struct ast_json *ari_oom_json(void);
+struct ast_json *ast_ari_oom_json(void);
/*!
- * \brief Fill in an error \a stasis_http_response.
+ * \brief Fill in an error \a ast_ari_response.
* \param response Response to fill in.
* \param response_code HTTP response code.
* \param response_text Text corresponding to the HTTP response code.
* \param message_fmt Error message format string.
*/
-void stasis_http_response_error(struct stasis_http_response *response,
+void ast_ari_response_error(struct ast_ari_response *response,
int response_code,
const char *response_text,
const char *message_fmt, ...)
__attribute__((format(printf, 4, 5)));
/*!
- * \brief Fill in an \c OK (200) \a stasis_http_response.
+ * \brief Fill in an \c OK (200) \a ast_ari_response.
* \param response Response to fill in.
* \param message JSON response. This reference is stolen, so just \ref
* ast_json_incref if you need to keep a reference to it.
*/
-void stasis_http_response_ok(struct stasis_http_response *response,
+void ast_ari_response_ok(struct ast_ari_response *response,
struct ast_json *message);
/*!
- * \brief Fill in a <tt>No Content</tt> (204) \a stasis_http_response.
+ * \brief Fill in a <tt>No Content</tt> (204) \a ast_ari_response.
*/
-void stasis_http_response_no_content(struct stasis_http_response *response);
+void ast_ari_response_no_content(struct ast_ari_response *response);
/*!
- * \brief Fill in a <tt>Created</tt> (201) \a stasis_http_response.
+ * \brief Fill in a <tt>Created</tt> (201) \a ast_ari_response.
*/
-void stasis_http_response_created(struct stasis_http_response *response,
+void ast_ari_response_created(struct ast_ari_response *response,
const char *url, struct ast_json *message);
/*!
* \brief Fill in \a response with a 500 message for allocation failures.
* \param response Response to fill in.
*/
-void stasis_http_response_alloc_failed(struct stasis_http_response *response);
+void ast_ari_response_alloc_failed(struct ast_ari_response *response);
-#endif /* _ASTERISK_STASIS_HTTP_H */
+#endif /* _ASTERISK_ARI_H */
struct stasis_threadpool_conf *threadpool;
};
-/*! \brief Mapping of the stasis http conf struct's globals to the
+/*! \brief Mapping of the stasis conf struct's globals to the
* threadpool context in the config file. */
static struct aco_type threadpool_option = {
.type = ACO_GLOBAL,
ael/pval.o: ael/pval.c
clean::
- rm -f snmp/*.[oi] ael/*.[oi] ais/*.[oi] stasis_http/*.[oi]
+ rm -f snmp/*.[oi] ael/*.[oi] ais/*.[oi] ari/*.[oi]
rm -f res_sip/*.[oi] stasis/*.[oi]
rm -f parking/*.o parking/*.i
$(if $(filter res_parking,$(EMBEDDED_MODS)),modules.link,res_parking.so): $(subst .c,.o,$(wildcard parking/*.c))
$(subst .c,.o,$(wildcard parking/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_parking)
-res_stasis_http.so: stasis_http/cli.o stasis_http/config.o stasis_http/ari_websockets.o
-stasis_http/cli.o stasis_http/config.o stasis_http/ari_websockets.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_stasis_http)
+res_ari.so: ari/cli.o ari/config.o ari/ari_websockets.o
+ari/cli.o ari/config.o ari/ari_websockets.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari)
-res_ari_model.so: stasis_http/ari_model_validators.o
-stasis_http/ari_model_validators.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_model)
+res_ari_model.so: ari/ari_model_validators.o
+ari/ari_model_validators.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_model)
-# Dependencies for res_stasis_http_*.so are generated, so they're in this file
-include stasis_http.make
+# Dependencies for res_ari_*.so are generated, so they're in this file
+include ari.make
--- /dev/null
+#
+# Asterisk -- A telephony toolkit for Linux.
+#
+# Generated Makefile for res_ari dependencies.
+#
+# Copyright (C) 2013, Digium, Inc.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+#
+# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+# !!!!! DO NOT EDIT !!!!!
+# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+# This file is generated by a template. Please see the original template at
+# rest-api-templates/ari.make.mustache
+#
+
+res_ari_asterisk.so: ari/resource_asterisk.o
+
+ari/resource_asterisk.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_asterisk)
+
+res_ari_endpoints.so: ari/resource_endpoints.o
+
+ari/resource_endpoints.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_endpoints)
+
+res_ari_channels.so: ari/resource_channels.o
+
+ari/resource_channels.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_channels)
+
+res_ari_bridges.so: ari/resource_bridges.o
+
+ari/resource_bridges.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_bridges)
+
+res_ari_recordings.so: ari/resource_recordings.o
+
+ari/resource_recordings.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_recordings)
+
+res_ari_sounds.so: ari/resource_sounds.o
+
+ari/resource_sounds.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_sounds)
+
+res_ari_playback.so: ari/resource_playback.o
+
+ari/resource_playback.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_playback)
+
+res_ari_events.so: ari/resource_events.o
+
+ari/resource_events.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_events)
+
#include "asterisk/module.h"
#include "ari_model_validators.h"
-int ari_validate_asterisk_info(struct ast_json *json)
+int ast_ari_validate_asterisk_info(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
return res;
}
-ari_validator ari_validate_asterisk_info_fn(void)
+ari_validator ast_ari_validate_asterisk_info_fn(void)
{
- return ari_validate_asterisk_info;
+ return ast_ari_validate_asterisk_info;
}
-int ari_validate_variable(struct ast_json *json)
+int ast_ari_validate_variable(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_value = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Variable field value failed validation\n");
return res;
}
-ari_validator ari_validate_variable_fn(void)
+ari_validator ast_ari_validate_variable_fn(void)
{
- return ari_validate_variable;
+ return ast_ari_validate_variable;
}
-int ari_validate_endpoint(struct ast_json *json)
+int ast_ari_validate_endpoint(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("channel_ids", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel_ids = 1;
- prop_is_valid = ari_validate_list(
+ prop_is_valid = ast_ari_validate_list(
ast_json_object_iter_value(iter),
- ari_validate_string);
+ ast_ari_validate_string);
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Endpoint field channel_ids failed validation\n");
res = 0;
if (strcmp("resource", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_resource = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Endpoint field resource failed validation\n");
} else
if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Endpoint field state failed validation\n");
if (strcmp("technology", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_technology = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Endpoint field technology failed validation\n");
return res;
}
-ari_validator ari_validate_endpoint_fn(void)
+ari_validator ast_ari_validate_endpoint_fn(void)
{
- return ari_validate_endpoint;
+ return ast_ari_validate_endpoint;
}
-int ari_validate_caller_id(struct ast_json *json)
+int ast_ari_validate_caller_id(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_name = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI CallerID field name failed validation\n");
if (strcmp("number", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_number = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI CallerID field number failed validation\n");
return res;
}
-ari_validator ari_validate_caller_id_fn(void)
+ari_validator ast_ari_validate_caller_id_fn(void)
{
- return ari_validate_caller_id;
+ return ast_ari_validate_caller_id;
}
-int ari_validate_channel(struct ast_json *json)
+int ast_ari_validate_channel(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("accountcode", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_accountcode = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Channel field accountcode failed validation\n");
if (strcmp("caller", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_caller = 1;
- prop_is_valid = ari_validate_caller_id(
+ prop_is_valid = ast_ari_validate_caller_id(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Channel field caller failed validation\n");
if (strcmp("connected", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_connected = 1;
- prop_is_valid = ari_validate_caller_id(
+ prop_is_valid = ast_ari_validate_caller_id(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Channel field connected failed validation\n");
if (strcmp("creationtime", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_creationtime = 1;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Channel field creationtime failed validation\n");
if (strcmp("dialplan", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_dialplan = 1;
- prop_is_valid = ari_validate_dialplan_cep(
+ prop_is_valid = ast_ari_validate_dialplan_cep(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Channel field dialplan failed validation\n");
if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_id = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Channel field id failed validation\n");
if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_name = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Channel field name failed validation\n");
if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_state = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Channel field state failed validation\n");
return res;
}
-ari_validator ari_validate_channel_fn(void)
+ari_validator ast_ari_validate_channel_fn(void)
{
- return ari_validate_channel;
+ return ast_ari_validate_channel;
}
-int ari_validate_dialed(struct ast_json *json)
+int ast_ari_validate_dialed(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
return res;
}
-ari_validator ari_validate_dialed_fn(void)
+ari_validator ast_ari_validate_dialed_fn(void)
{
- return ari_validate_dialed;
+ return ast_ari_validate_dialed;
}
-int ari_validate_dialplan_cep(struct ast_json *json)
+int ast_ari_validate_dialplan_cep(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("context", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_context = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI DialplanCEP field context failed validation\n");
if (strcmp("exten", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_exten = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI DialplanCEP field exten failed validation\n");
if (strcmp("priority", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_priority = 1;
- prop_is_valid = ari_validate_long(
+ prop_is_valid = ast_ari_validate_long(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI DialplanCEP field priority failed validation\n");
return res;
}
-ari_validator ari_validate_dialplan_cep_fn(void)
+ari_validator ast_ari_validate_dialplan_cep_fn(void)
{
- return ari_validate_dialplan_cep;
+ return ast_ari_validate_dialplan_cep;
}
-int ari_validate_bridge(struct ast_json *json)
+int ast_ari_validate_bridge(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("bridge_class", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_bridge_class = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Bridge field bridge_class failed validation\n");
if (strcmp("bridge_type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_bridge_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Bridge field bridge_type failed validation\n");
if (strcmp("channels", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channels = 1;
- prop_is_valid = ari_validate_list(
+ prop_is_valid = ast_ari_validate_list(
ast_json_object_iter_value(iter),
- ari_validate_string);
+ ast_ari_validate_string);
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Bridge field channels failed validation\n");
res = 0;
if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_id = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Bridge field id failed validation\n");
if (strcmp("technology", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_technology = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Bridge field technology failed validation\n");
return res;
}
-ari_validator ari_validate_bridge_fn(void)
+ari_validator ast_ari_validate_bridge_fn(void)
{
- return ari_validate_bridge;
+ return ast_ari_validate_bridge;
}
-int ari_validate_live_recording(struct ast_json *json)
+int ast_ari_validate_live_recording(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("format", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_format = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI LiveRecording field format failed validation\n");
if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_name = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI LiveRecording field name failed validation\n");
if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_state = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI LiveRecording field state failed validation\n");
return res;
}
-ari_validator ari_validate_live_recording_fn(void)
+ari_validator ast_ari_validate_live_recording_fn(void)
{
- return ari_validate_live_recording;
+ return ast_ari_validate_live_recording;
}
-int ari_validate_stored_recording(struct ast_json *json)
+int ast_ari_validate_stored_recording(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
if (strcmp("duration_seconds", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_int(
+ prop_is_valid = ast_ari_validate_int(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StoredRecording field duration_seconds failed validation\n");
if (strcmp("formats", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_formats = 1;
- prop_is_valid = ari_validate_list(
+ prop_is_valid = ast_ari_validate_list(
ast_json_object_iter_value(iter),
- ari_validate_string);
+ ast_ari_validate_string);
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StoredRecording field formats failed validation\n");
res = 0;
if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_id = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StoredRecording field id failed validation\n");
} else
if (strcmp("time", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StoredRecording field time failed validation\n");
return res;
}
-ari_validator ari_validate_stored_recording_fn(void)
+ari_validator ast_ari_validate_stored_recording_fn(void)
{
- return ari_validate_stored_recording;
+ return ast_ari_validate_stored_recording;
}
-int ari_validate_format_lang_pair(struct ast_json *json)
+int ast_ari_validate_format_lang_pair(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("format", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_format = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI FormatLangPair field format failed validation\n");
if (strcmp("language", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_language = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI FormatLangPair field language failed validation\n");
return res;
}
-ari_validator ari_validate_format_lang_pair_fn(void)
+ari_validator ast_ari_validate_format_lang_pair_fn(void)
{
- return ari_validate_format_lang_pair;
+ return ast_ari_validate_format_lang_pair;
}
-int ari_validate_sound(struct ast_json *json)
+int ast_ari_validate_sound(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("formats", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_formats = 1;
- prop_is_valid = ari_validate_list(
+ prop_is_valid = ast_ari_validate_list(
ast_json_object_iter_value(iter),
- ari_validate_format_lang_pair);
+ ast_ari_validate_format_lang_pair);
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Sound field formats failed validation\n");
res = 0;
if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_id = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Sound field id failed validation\n");
} else
if (strcmp("text", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Sound field text failed validation\n");
return res;
}
-ari_validator ari_validate_sound_fn(void)
+ari_validator ast_ari_validate_sound_fn(void)
{
- return ari_validate_sound;
+ return ast_ari_validate_sound;
}
-int ari_validate_playback(struct ast_json *json)
+int ast_ari_validate_playback(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_id = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Playback field id failed validation\n");
} else
if (strcmp("language", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Playback field language failed validation\n");
if (strcmp("media_uri", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_media_uri = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Playback field media_uri failed validation\n");
if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_state = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Playback field state failed validation\n");
if (strcmp("target_uri", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_target_uri = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Playback field target_uri failed validation\n");
return res;
}
-ari_validator ari_validate_playback_fn(void)
+ari_validator ast_ari_validate_playback_fn(void)
{
- return ari_validate_playback;
+ return ast_ari_validate_playback;
}
-int ari_validate_application_replaced(struct ast_json *json)
+int ast_ari_validate_application_replaced(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ApplicationReplaced field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ApplicationReplaced field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ApplicationReplaced field timestamp failed validation\n");
return res;
}
-ari_validator ari_validate_application_replaced_fn(void)
+ari_validator ast_ari_validate_application_replaced_fn(void)
{
- return ari_validate_application_replaced;
+ return ast_ari_validate_application_replaced;
}
-int ari_validate_bridge_created(struct ast_json *json)
+int ast_ari_validate_bridge_created(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeCreated field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeCreated field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeCreated field timestamp failed validation\n");
if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_bridge = 1;
- prop_is_valid = ari_validate_bridge(
+ prop_is_valid = ast_ari_validate_bridge(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeCreated field bridge failed validation\n");
return res;
}
-ari_validator ari_validate_bridge_created_fn(void)
+ari_validator ast_ari_validate_bridge_created_fn(void)
{
- return ari_validate_bridge_created;
+ return ast_ari_validate_bridge_created;
}
-int ari_validate_bridge_destroyed(struct ast_json *json)
+int ast_ari_validate_bridge_destroyed(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeDestroyed field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeDestroyed field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeDestroyed field timestamp failed validation\n");
if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_bridge = 1;
- prop_is_valid = ari_validate_bridge(
+ prop_is_valid = ast_ari_validate_bridge(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeDestroyed field bridge failed validation\n");
return res;
}
-ari_validator ari_validate_bridge_destroyed_fn(void)
+ari_validator ast_ari_validate_bridge_destroyed_fn(void)
{
- return ari_validate_bridge_destroyed;
+ return ast_ari_validate_bridge_destroyed;
}
-int ari_validate_bridge_merged(struct ast_json *json)
+int ast_ari_validate_bridge_merged(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeMerged field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeMerged field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeMerged field timestamp failed validation\n");
if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_bridge = 1;
- prop_is_valid = ari_validate_bridge(
+ prop_is_valid = ast_ari_validate_bridge(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeMerged field bridge failed validation\n");
if (strcmp("bridge_from", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_bridge_from = 1;
- prop_is_valid = ari_validate_bridge(
+ prop_is_valid = ast_ari_validate_bridge(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI BridgeMerged field bridge_from failed validation\n");
return res;
}
-ari_validator ari_validate_bridge_merged_fn(void)
+ari_validator ast_ari_validate_bridge_merged_fn(void)
{
- return ari_validate_bridge_merged;
+ return ast_ari_validate_bridge_merged;
}
-int ari_validate_channel_caller_id(struct ast_json *json)
+int ast_ari_validate_channel_caller_id(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCallerId field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCallerId field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCallerId field timestamp failed validation\n");
if (strcmp("caller_presentation", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_caller_presentation = 1;
- prop_is_valid = ari_validate_int(
+ prop_is_valid = ast_ari_validate_int(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation failed validation\n");
if (strcmp("caller_presentation_txt", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_caller_presentation_txt = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation_txt failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCallerId field channel failed validation\n");
return res;
}
-ari_validator ari_validate_channel_caller_id_fn(void)
+ari_validator ast_ari_validate_channel_caller_id_fn(void)
{
- return ari_validate_channel_caller_id;
+ return ast_ari_validate_channel_caller_id;
}
-int ari_validate_channel_created(struct ast_json *json)
+int ast_ari_validate_channel_created(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCreated field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCreated field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCreated field timestamp failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelCreated field channel failed validation\n");
return res;
}
-ari_validator ari_validate_channel_created_fn(void)
+ari_validator ast_ari_validate_channel_created_fn(void)
{
- return ari_validate_channel_created;
+ return ast_ari_validate_channel_created;
}
-int ari_validate_channel_destroyed(struct ast_json *json)
+int ast_ari_validate_channel_destroyed(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDestroyed field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDestroyed field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDestroyed field timestamp failed validation\n");
if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_cause = 1;
- prop_is_valid = ari_validate_int(
+ prop_is_valid = ast_ari_validate_int(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause failed validation\n");
if (strcmp("cause_txt", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_cause_txt = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause_txt failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDestroyed field channel failed validation\n");
return res;
}
-ari_validator ari_validate_channel_destroyed_fn(void)
+ari_validator ast_ari_validate_channel_destroyed_fn(void)
{
- return ari_validate_channel_destroyed;
+ return ast_ari_validate_channel_destroyed;
}
-int ari_validate_channel_dialplan(struct ast_json *json)
+int ast_ari_validate_channel_dialplan(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDialplan field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDialplan field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDialplan field timestamp failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDialplan field channel failed validation\n");
if (strcmp("dialplan_app", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_dialplan_app = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app failed validation\n");
if (strcmp("dialplan_app_data", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_dialplan_app_data = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app_data failed validation\n");
return res;
}
-ari_validator ari_validate_channel_dialplan_fn(void)
+ari_validator ast_ari_validate_channel_dialplan_fn(void)
{
- return ari_validate_channel_dialplan;
+ return ast_ari_validate_channel_dialplan;
}
-int ari_validate_channel_dtmf_received(struct ast_json *json)
+int ast_ari_validate_channel_dtmf_received(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field timestamp failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field channel failed validation\n");
if (strcmp("digit", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_digit = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field digit failed validation\n");
if (strcmp("duration_ms", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_duration_ms = 1;
- prop_is_valid = ari_validate_int(
+ prop_is_valid = ast_ari_validate_int(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field duration_ms failed validation\n");
return res;
}
-ari_validator ari_validate_channel_dtmf_received_fn(void)
+ari_validator ast_ari_validate_channel_dtmf_received_fn(void)
{
- return ari_validate_channel_dtmf_received;
+ return ast_ari_validate_channel_dtmf_received;
}
-int ari_validate_channel_entered_bridge(struct ast_json *json)
+int ast_ari_validate_channel_entered_bridge(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field timestamp failed validation\n");
if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_bridge = 1;
- prop_is_valid = ari_validate_bridge(
+ prop_is_valid = ast_ari_validate_bridge(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field bridge failed validation\n");
} else
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field channel failed validation\n");
return res;
}
-ari_validator ari_validate_channel_entered_bridge_fn(void)
+ari_validator ast_ari_validate_channel_entered_bridge_fn(void)
{
- return ari_validate_channel_entered_bridge;
+ return ast_ari_validate_channel_entered_bridge;
}
-int ari_validate_channel_hangup_request(struct ast_json *json)
+int ast_ari_validate_channel_hangup_request(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelHangupRequest field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelHangupRequest field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelHangupRequest field timestamp failed validation\n");
} else
if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_int(
+ prop_is_valid = ast_ari_validate_int(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelHangupRequest field cause failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelHangupRequest field channel failed validation\n");
} else
if (strcmp("soft", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_boolean(
+ prop_is_valid = ast_ari_validate_boolean(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelHangupRequest field soft failed validation\n");
return res;
}
-ari_validator ari_validate_channel_hangup_request_fn(void)
+ari_validator ast_ari_validate_channel_hangup_request_fn(void)
{
- return ari_validate_channel_hangup_request;
+ return ast_ari_validate_channel_hangup_request;
}
-int ari_validate_channel_left_bridge(struct ast_json *json)
+int ast_ari_validate_channel_left_bridge(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelLeftBridge field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelLeftBridge field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelLeftBridge field timestamp failed validation\n");
if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_bridge = 1;
- prop_is_valid = ari_validate_bridge(
+ prop_is_valid = ast_ari_validate_bridge(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelLeftBridge field bridge failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelLeftBridge field channel failed validation\n");
return res;
}
-ari_validator ari_validate_channel_left_bridge_fn(void)
+ari_validator ast_ari_validate_channel_left_bridge_fn(void)
{
- return ari_validate_channel_left_bridge;
+ return ast_ari_validate_channel_left_bridge;
}
-int ari_validate_channel_state_change(struct ast_json *json)
+int ast_ari_validate_channel_state_change(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelStateChange field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelStateChange field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelStateChange field timestamp failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelStateChange field channel failed validation\n");
return res;
}
-ari_validator ari_validate_channel_state_change_fn(void)
+ari_validator ast_ari_validate_channel_state_change_fn(void)
{
- return ari_validate_channel_state_change;
+ return ast_ari_validate_channel_state_change;
}
-int ari_validate_channel_userevent(struct ast_json *json)
+int ast_ari_validate_channel_userevent(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelUserevent field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelUserevent field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelUserevent field timestamp failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelUserevent field channel failed validation\n");
if (strcmp("eventname", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_eventname = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelUserevent field eventname failed validation\n");
return res;
}
-ari_validator ari_validate_channel_userevent_fn(void)
+ari_validator ast_ari_validate_channel_userevent_fn(void)
{
- return ari_validate_channel_userevent;
+ return ast_ari_validate_channel_userevent;
}
-int ari_validate_channel_varset(struct ast_json *json)
+int ast_ari_validate_channel_varset(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelVarset field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelVarset field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelVarset field timestamp failed validation\n");
} else
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelVarset field channel failed validation\n");
if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_value = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelVarset field value failed validation\n");
if (strcmp("variable", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_variable = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI ChannelVarset field variable failed validation\n");
return res;
}
-ari_validator ari_validate_channel_varset_fn(void)
+ari_validator ast_ari_validate_channel_varset_fn(void)
{
- return ari_validate_channel_varset;
+ return ast_ari_validate_channel_varset;
}
-int ari_validate_event(struct ast_json *json)
+int ast_ari_validate_event(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
/* Self type; fall through */
} else
if (strcmp("ApplicationReplaced", discriminator) == 0) {
- return ari_validate_application_replaced(json);
+ return ast_ari_validate_application_replaced(json);
} else
if (strcmp("BridgeCreated", discriminator) == 0) {
- return ari_validate_bridge_created(json);
+ return ast_ari_validate_bridge_created(json);
} else
if (strcmp("BridgeDestroyed", discriminator) == 0) {
- return ari_validate_bridge_destroyed(json);
+ return ast_ari_validate_bridge_destroyed(json);
} else
if (strcmp("BridgeMerged", discriminator) == 0) {
- return ari_validate_bridge_merged(json);
+ return ast_ari_validate_bridge_merged(json);
} else
if (strcmp("ChannelCallerId", discriminator) == 0) {
- return ari_validate_channel_caller_id(json);
+ return ast_ari_validate_channel_caller_id(json);
} else
if (strcmp("ChannelCreated", discriminator) == 0) {
- return ari_validate_channel_created(json);
+ return ast_ari_validate_channel_created(json);
} else
if (strcmp("ChannelDestroyed", discriminator) == 0) {
- return ari_validate_channel_destroyed(json);
+ return ast_ari_validate_channel_destroyed(json);
} else
if (strcmp("ChannelDialplan", discriminator) == 0) {
- return ari_validate_channel_dialplan(json);
+ return ast_ari_validate_channel_dialplan(json);
} else
if (strcmp("ChannelDtmfReceived", discriminator) == 0) {
- return ari_validate_channel_dtmf_received(json);
+ return ast_ari_validate_channel_dtmf_received(json);
} else
if (strcmp("ChannelEnteredBridge", discriminator) == 0) {
- return ari_validate_channel_entered_bridge(json);
+ return ast_ari_validate_channel_entered_bridge(json);
} else
if (strcmp("ChannelHangupRequest", discriminator) == 0) {
- return ari_validate_channel_hangup_request(json);
+ return ast_ari_validate_channel_hangup_request(json);
} else
if (strcmp("ChannelLeftBridge", discriminator) == 0) {
- return ari_validate_channel_left_bridge(json);
+ return ast_ari_validate_channel_left_bridge(json);
} else
if (strcmp("ChannelStateChange", discriminator) == 0) {
- return ari_validate_channel_state_change(json);
+ return ast_ari_validate_channel_state_change(json);
} else
if (strcmp("ChannelUserevent", discriminator) == 0) {
- return ari_validate_channel_userevent(json);
+ return ast_ari_validate_channel_userevent(json);
} else
if (strcmp("ChannelVarset", discriminator) == 0) {
- return ari_validate_channel_varset(json);
+ return ast_ari_validate_channel_varset(json);
} else
if (strcmp("PlaybackFinished", discriminator) == 0) {
- return ari_validate_playback_finished(json);
+ return ast_ari_validate_playback_finished(json);
} else
if (strcmp("PlaybackStarted", discriminator) == 0) {
- return ari_validate_playback_started(json);
+ return ast_ari_validate_playback_started(json);
} else
if (strcmp("StasisEnd", discriminator) == 0) {
- return ari_validate_stasis_end(json);
+ return ast_ari_validate_stasis_end(json);
} else
if (strcmp("StasisStart", discriminator) == 0) {
- return ari_validate_stasis_start(json);
+ return ast_ari_validate_stasis_start(json);
} else
{
ast_log(LOG_ERROR, "ARI Event has undocumented subtype %s\n",
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Event field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Event field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Event field timestamp failed validation\n");
return res;
}
-ari_validator ari_validate_event_fn(void)
+ari_validator ast_ari_validate_event_fn(void)
{
- return ari_validate_event;
+ return ast_ari_validate_event;
}
-int ari_validate_message(struct ast_json *json)
+int ast_ari_validate_message(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
/* Self type; fall through */
} else
if (strcmp("ApplicationReplaced", discriminator) == 0) {
- return ari_validate_application_replaced(json);
+ return ast_ari_validate_application_replaced(json);
} else
if (strcmp("BridgeCreated", discriminator) == 0) {
- return ari_validate_bridge_created(json);
+ return ast_ari_validate_bridge_created(json);
} else
if (strcmp("BridgeDestroyed", discriminator) == 0) {
- return ari_validate_bridge_destroyed(json);
+ return ast_ari_validate_bridge_destroyed(json);
} else
if (strcmp("BridgeMerged", discriminator) == 0) {
- return ari_validate_bridge_merged(json);
+ return ast_ari_validate_bridge_merged(json);
} else
if (strcmp("ChannelCallerId", discriminator) == 0) {
- return ari_validate_channel_caller_id(json);
+ return ast_ari_validate_channel_caller_id(json);
} else
if (strcmp("ChannelCreated", discriminator) == 0) {
- return ari_validate_channel_created(json);
+ return ast_ari_validate_channel_created(json);
} else
if (strcmp("ChannelDestroyed", discriminator) == 0) {
- return ari_validate_channel_destroyed(json);
+ return ast_ari_validate_channel_destroyed(json);
} else
if (strcmp("ChannelDialplan", discriminator) == 0) {
- return ari_validate_channel_dialplan(json);
+ return ast_ari_validate_channel_dialplan(json);
} else
if (strcmp("ChannelDtmfReceived", discriminator) == 0) {
- return ari_validate_channel_dtmf_received(json);
+ return ast_ari_validate_channel_dtmf_received(json);
} else
if (strcmp("ChannelEnteredBridge", discriminator) == 0) {
- return ari_validate_channel_entered_bridge(json);
+ return ast_ari_validate_channel_entered_bridge(json);
} else
if (strcmp("ChannelHangupRequest", discriminator) == 0) {
- return ari_validate_channel_hangup_request(json);
+ return ast_ari_validate_channel_hangup_request(json);
} else
if (strcmp("ChannelLeftBridge", discriminator) == 0) {
- return ari_validate_channel_left_bridge(json);
+ return ast_ari_validate_channel_left_bridge(json);
} else
if (strcmp("ChannelStateChange", discriminator) == 0) {
- return ari_validate_channel_state_change(json);
+ return ast_ari_validate_channel_state_change(json);
} else
if (strcmp("ChannelUserevent", discriminator) == 0) {
- return ari_validate_channel_userevent(json);
+ return ast_ari_validate_channel_userevent(json);
} else
if (strcmp("ChannelVarset", discriminator) == 0) {
- return ari_validate_channel_varset(json);
+ return ast_ari_validate_channel_varset(json);
} else
if (strcmp("Event", discriminator) == 0) {
- return ari_validate_event(json);
+ return ast_ari_validate_event(json);
} else
if (strcmp("MissingParams", discriminator) == 0) {
- return ari_validate_missing_params(json);
+ return ast_ari_validate_missing_params(json);
} else
if (strcmp("PlaybackFinished", discriminator) == 0) {
- return ari_validate_playback_finished(json);
+ return ast_ari_validate_playback_finished(json);
} else
if (strcmp("PlaybackStarted", discriminator) == 0) {
- return ari_validate_playback_started(json);
+ return ast_ari_validate_playback_started(json);
} else
if (strcmp("StasisEnd", discriminator) == 0) {
- return ari_validate_stasis_end(json);
+ return ast_ari_validate_stasis_end(json);
} else
if (strcmp("StasisStart", discriminator) == 0) {
- return ari_validate_stasis_start(json);
+ return ast_ari_validate_stasis_start(json);
} else
{
ast_log(LOG_ERROR, "ARI Message has undocumented subtype %s\n",
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI Message field type failed validation\n");
return res;
}
-ari_validator ari_validate_message_fn(void)
+ari_validator ast_ari_validate_message_fn(void)
{
- return ari_validate_message;
+ return ast_ari_validate_message;
}
-int ari_validate_missing_params(struct ast_json *json)
+int ast_ari_validate_missing_params(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI MissingParams field type failed validation\n");
if (strcmp("params", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_params = 1;
- prop_is_valid = ari_validate_list(
+ prop_is_valid = ast_ari_validate_list(
ast_json_object_iter_value(iter),
- ari_validate_string);
+ ast_ari_validate_string);
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI MissingParams field params failed validation\n");
res = 0;
return res;
}
-ari_validator ari_validate_missing_params_fn(void)
+ari_validator ast_ari_validate_missing_params_fn(void)
{
- return ari_validate_missing_params;
+ return ast_ari_validate_missing_params;
}
-int ari_validate_playback_finished(struct ast_json *json)
+int ast_ari_validate_playback_finished(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI PlaybackFinished field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI PlaybackFinished field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI PlaybackFinished field timestamp failed validation\n");
if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_playback = 1;
- prop_is_valid = ari_validate_playback(
+ prop_is_valid = ast_ari_validate_playback(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI PlaybackFinished field playback failed validation\n");
return res;
}
-ari_validator ari_validate_playback_finished_fn(void)
+ari_validator ast_ari_validate_playback_finished_fn(void)
{
- return ari_validate_playback_finished;
+ return ast_ari_validate_playback_finished;
}
-int ari_validate_playback_started(struct ast_json *json)
+int ast_ari_validate_playback_started(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI PlaybackStarted field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI PlaybackStarted field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI PlaybackStarted field timestamp failed validation\n");
if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_playback = 1;
- prop_is_valid = ari_validate_playback(
+ prop_is_valid = ast_ari_validate_playback(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI PlaybackStarted field playback failed validation\n");
return res;
}
-ari_validator ari_validate_playback_started_fn(void)
+ari_validator ast_ari_validate_playback_started_fn(void)
{
- return ari_validate_playback_started;
+ return ast_ari_validate_playback_started;
}
-int ari_validate_stasis_end(struct ast_json *json)
+int ast_ari_validate_stasis_end(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StasisEnd field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StasisEnd field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StasisEnd field timestamp failed validation\n");
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StasisEnd field channel failed validation\n");
return res;
}
-ari_validator ari_validate_stasis_end_fn(void)
+ari_validator ast_ari_validate_stasis_end_fn(void)
{
- return ari_validate_stasis_end;
+ return ast_ari_validate_stasis_end;
}
-int ari_validate_stasis_start(struct ast_json *json)
+int ast_ari_validate_stasis_start(struct ast_json *json)
{
int res = 1;
struct ast_json_iter *iter;
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_type = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StasisStart field type failed validation\n");
if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_application = 1;
- prop_is_valid = ari_validate_string(
+ prop_is_valid = ast_ari_validate_string(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StasisStart field application failed validation\n");
} else
if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
- prop_is_valid = ari_validate_date(
+ prop_is_valid = ast_ari_validate_date(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StasisStart field timestamp failed validation\n");
if (strcmp("args", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_args = 1;
- prop_is_valid = ari_validate_list(
+ prop_is_valid = ast_ari_validate_list(
ast_json_object_iter_value(iter),
- ari_validate_string);
+ ast_ari_validate_string);
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StasisStart field args failed validation\n");
res = 0;
if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_channel = 1;
- prop_is_valid = ari_validate_channel(
+ prop_is_valid = ast_ari_validate_channel(
ast_json_object_iter_value(iter));
if (!prop_is_valid) {
ast_log(LOG_ERROR, "ARI StasisStart field channel failed validation\n");
return res;
}
-ari_validator ari_validate_stasis_start_fn(void)
+ari_validator ast_ari_validate_stasis_start_fn(void)
{
- return ari_validate_stasis_start;
+ return ast_ari_validate_stasis_start;
}
* \brief Generated file - Build validators for ARI model objects.
*
* In addition to the normal validation functions one would normally expect,
- * each validator has a ari_validate_{id}_fn() companion function that returns
+ * each validator has a ast_ari_validate_{id}_fn() companion function that returns
* the validator's function pointer.
*
* The reason for this seamingly useless indirection is the way function
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_void(struct ast_json *json);
+int ast_ari_validate_void(struct ast_json *json);
/*!
* \brief Validator for native Swagger byte.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_byte(struct ast_json *json);
+int ast_ari_validate_byte(struct ast_json *json);
/*!
* \brief Validator for native Swagger boolean.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_boolean(struct ast_json *json);
+int ast_ari_validate_boolean(struct ast_json *json);
/*!
* \brief Validator for native Swagger int.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_int(struct ast_json *json);
+int ast_ari_validate_int(struct ast_json *json);
/*!
* \brief Validator for native Swagger long.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_long(struct ast_json *json);
+int ast_ari_validate_long(struct ast_json *json);
/*!
* \brief Validator for native Swagger float.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_float(struct ast_json *json);
+int ast_ari_validate_float(struct ast_json *json);
/*!
* \brief Validator for native Swagger double.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_double(struct ast_json *json);
+int ast_ari_validate_double(struct ast_json *json);
/*!
* \brief Validator for native Swagger string.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_string(struct ast_json *json);
+int ast_ari_validate_string(struct ast_json *json);
/*!
* \brief Validator for native Swagger date.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_date(struct ast_json *json);
+int ast_ari_validate_date(struct ast_json *json);
/*!
* \brief Validator for a Swagger List[]/JSON array.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_list(struct ast_json *json, int (*fn)(struct ast_json *));
+int ast_ari_validate_list(struct ast_json *json, int (*fn)(struct ast_json *));
/*! @} */
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_asterisk_info(struct ast_json *json);
+int ast_ari_validate_asterisk_info(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_asterisk_info().
+ * \brief Function pointer to ast_ari_validate_asterisk_info().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_asterisk_info_fn(void);
+ari_validator ast_ari_validate_asterisk_info_fn(void);
/*!
* \brief Validator for Variable.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_variable(struct ast_json *json);
+int ast_ari_validate_variable(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_variable().
+ * \brief Function pointer to ast_ari_validate_variable().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_variable_fn(void);
+ari_validator ast_ari_validate_variable_fn(void);
/*!
* \brief Validator for Endpoint.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_endpoint(struct ast_json *json);
+int ast_ari_validate_endpoint(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_endpoint().
+ * \brief Function pointer to ast_ari_validate_endpoint().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_endpoint_fn(void);
+ari_validator ast_ari_validate_endpoint_fn(void);
/*!
* \brief Validator for CallerID.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_caller_id(struct ast_json *json);
+int ast_ari_validate_caller_id(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_caller_id().
+ * \brief Function pointer to ast_ari_validate_caller_id().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_caller_id_fn(void);
+ari_validator ast_ari_validate_caller_id_fn(void);
/*!
* \brief Validator for Channel.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel(struct ast_json *json);
+int ast_ari_validate_channel(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel().
+ * \brief Function pointer to ast_ari_validate_channel().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_fn(void);
+ari_validator ast_ari_validate_channel_fn(void);
/*!
* \brief Validator for Dialed.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_dialed(struct ast_json *json);
+int ast_ari_validate_dialed(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_dialed().
+ * \brief Function pointer to ast_ari_validate_dialed().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_dialed_fn(void);
+ari_validator ast_ari_validate_dialed_fn(void);
/*!
* \brief Validator for DialplanCEP.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_dialplan_cep(struct ast_json *json);
+int ast_ari_validate_dialplan_cep(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_dialplan_cep().
+ * \brief Function pointer to ast_ari_validate_dialplan_cep().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_dialplan_cep_fn(void);
+ari_validator ast_ari_validate_dialplan_cep_fn(void);
/*!
* \brief Validator for Bridge.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_bridge(struct ast_json *json);
+int ast_ari_validate_bridge(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_bridge().
+ * \brief Function pointer to ast_ari_validate_bridge().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_bridge_fn(void);
+ari_validator ast_ari_validate_bridge_fn(void);
/*!
* \brief Validator for LiveRecording.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_live_recording(struct ast_json *json);
+int ast_ari_validate_live_recording(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_live_recording().
+ * \brief Function pointer to ast_ari_validate_live_recording().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_live_recording_fn(void);
+ari_validator ast_ari_validate_live_recording_fn(void);
/*!
* \brief Validator for StoredRecording.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_stored_recording(struct ast_json *json);
+int ast_ari_validate_stored_recording(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_stored_recording().
+ * \brief Function pointer to ast_ari_validate_stored_recording().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_stored_recording_fn(void);
+ari_validator ast_ari_validate_stored_recording_fn(void);
/*!
* \brief Validator for FormatLangPair.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_format_lang_pair(struct ast_json *json);
+int ast_ari_validate_format_lang_pair(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_format_lang_pair().
+ * \brief Function pointer to ast_ari_validate_format_lang_pair().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_format_lang_pair_fn(void);
+ari_validator ast_ari_validate_format_lang_pair_fn(void);
/*!
* \brief Validator for Sound.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_sound(struct ast_json *json);
+int ast_ari_validate_sound(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_sound().
+ * \brief Function pointer to ast_ari_validate_sound().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_sound_fn(void);
+ari_validator ast_ari_validate_sound_fn(void);
/*!
* \brief Validator for Playback.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_playback(struct ast_json *json);
+int ast_ari_validate_playback(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_playback().
+ * \brief Function pointer to ast_ari_validate_playback().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_playback_fn(void);
+ari_validator ast_ari_validate_playback_fn(void);
/*!
* \brief Validator for ApplicationReplaced.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_application_replaced(struct ast_json *json);
+int ast_ari_validate_application_replaced(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_application_replaced().
+ * \brief Function pointer to ast_ari_validate_application_replaced().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_application_replaced_fn(void);
+ari_validator ast_ari_validate_application_replaced_fn(void);
/*!
* \brief Validator for BridgeCreated.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_bridge_created(struct ast_json *json);
+int ast_ari_validate_bridge_created(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_bridge_created().
+ * \brief Function pointer to ast_ari_validate_bridge_created().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_bridge_created_fn(void);
+ari_validator ast_ari_validate_bridge_created_fn(void);
/*!
* \brief Validator for BridgeDestroyed.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_bridge_destroyed(struct ast_json *json);
+int ast_ari_validate_bridge_destroyed(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_bridge_destroyed().
+ * \brief Function pointer to ast_ari_validate_bridge_destroyed().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_bridge_destroyed_fn(void);
+ari_validator ast_ari_validate_bridge_destroyed_fn(void);
/*!
* \brief Validator for BridgeMerged.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_bridge_merged(struct ast_json *json);
+int ast_ari_validate_bridge_merged(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_bridge_merged().
+ * \brief Function pointer to ast_ari_validate_bridge_merged().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_bridge_merged_fn(void);
+ari_validator ast_ari_validate_bridge_merged_fn(void);
/*!
* \brief Validator for ChannelCallerId.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_caller_id(struct ast_json *json);
+int ast_ari_validate_channel_caller_id(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_caller_id().
+ * \brief Function pointer to ast_ari_validate_channel_caller_id().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_caller_id_fn(void);
+ari_validator ast_ari_validate_channel_caller_id_fn(void);
/*!
* \brief Validator for ChannelCreated.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_created(struct ast_json *json);
+int ast_ari_validate_channel_created(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_created().
+ * \brief Function pointer to ast_ari_validate_channel_created().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_created_fn(void);
+ari_validator ast_ari_validate_channel_created_fn(void);
/*!
* \brief Validator for ChannelDestroyed.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_destroyed(struct ast_json *json);
+int ast_ari_validate_channel_destroyed(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_destroyed().
+ * \brief Function pointer to ast_ari_validate_channel_destroyed().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_destroyed_fn(void);
+ari_validator ast_ari_validate_channel_destroyed_fn(void);
/*!
* \brief Validator for ChannelDialplan.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_dialplan(struct ast_json *json);
+int ast_ari_validate_channel_dialplan(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_dialplan().
+ * \brief Function pointer to ast_ari_validate_channel_dialplan().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_dialplan_fn(void);
+ari_validator ast_ari_validate_channel_dialplan_fn(void);
/*!
* \brief Validator for ChannelDtmfReceived.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_dtmf_received(struct ast_json *json);
+int ast_ari_validate_channel_dtmf_received(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_dtmf_received().
+ * \brief Function pointer to ast_ari_validate_channel_dtmf_received().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_dtmf_received_fn(void);
+ari_validator ast_ari_validate_channel_dtmf_received_fn(void);
/*!
* \brief Validator for ChannelEnteredBridge.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_entered_bridge(struct ast_json *json);
+int ast_ari_validate_channel_entered_bridge(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_entered_bridge().
+ * \brief Function pointer to ast_ari_validate_channel_entered_bridge().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_entered_bridge_fn(void);
+ari_validator ast_ari_validate_channel_entered_bridge_fn(void);
/*!
* \brief Validator for ChannelHangupRequest.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_hangup_request(struct ast_json *json);
+int ast_ari_validate_channel_hangup_request(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_hangup_request().
+ * \brief Function pointer to ast_ari_validate_channel_hangup_request().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_hangup_request_fn(void);
+ari_validator ast_ari_validate_channel_hangup_request_fn(void);
/*!
* \brief Validator for ChannelLeftBridge.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_left_bridge(struct ast_json *json);
+int ast_ari_validate_channel_left_bridge(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_left_bridge().
+ * \brief Function pointer to ast_ari_validate_channel_left_bridge().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_left_bridge_fn(void);
+ari_validator ast_ari_validate_channel_left_bridge_fn(void);
/*!
* \brief Validator for ChannelStateChange.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_state_change(struct ast_json *json);
+int ast_ari_validate_channel_state_change(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_state_change().
+ * \brief Function pointer to ast_ari_validate_channel_state_change().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_state_change_fn(void);
+ari_validator ast_ari_validate_channel_state_change_fn(void);
/*!
* \brief Validator for ChannelUserevent.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_userevent(struct ast_json *json);
+int ast_ari_validate_channel_userevent(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_userevent().
+ * \brief Function pointer to ast_ari_validate_channel_userevent().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_userevent_fn(void);
+ari_validator ast_ari_validate_channel_userevent_fn(void);
/*!
* \brief Validator for ChannelVarset.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_channel_varset(struct ast_json *json);
+int ast_ari_validate_channel_varset(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_channel_varset().
+ * \brief Function pointer to ast_ari_validate_channel_varset().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_channel_varset_fn(void);
+ari_validator ast_ari_validate_channel_varset_fn(void);
/*!
* \brief Validator for Event.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_event(struct ast_json *json);
+int ast_ari_validate_event(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_event().
+ * \brief Function pointer to ast_ari_validate_event().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_event_fn(void);
+ari_validator ast_ari_validate_event_fn(void);
/*!
* \brief Validator for Message.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_message(struct ast_json *json);
+int ast_ari_validate_message(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_message().
+ * \brief Function pointer to ast_ari_validate_message().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_message_fn(void);
+ari_validator ast_ari_validate_message_fn(void);
/*!
* \brief Validator for MissingParams.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_missing_params(struct ast_json *json);
+int ast_ari_validate_missing_params(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_missing_params().
+ * \brief Function pointer to ast_ari_validate_missing_params().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_missing_params_fn(void);
+ari_validator ast_ari_validate_missing_params_fn(void);
/*!
* \brief Validator for PlaybackFinished.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_playback_finished(struct ast_json *json);
+int ast_ari_validate_playback_finished(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_playback_finished().
+ * \brief Function pointer to ast_ari_validate_playback_finished().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_playback_finished_fn(void);
+ari_validator ast_ari_validate_playback_finished_fn(void);
/*!
* \brief Validator for PlaybackStarted.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_playback_started(struct ast_json *json);
+int ast_ari_validate_playback_started(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_playback_started().
+ * \brief Function pointer to ast_ari_validate_playback_started().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_playback_started_fn(void);
+ari_validator ast_ari_validate_playback_started_fn(void);
/*!
* \brief Validator for StasisEnd.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_stasis_end(struct ast_json *json);
+int ast_ari_validate_stasis_end(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_stasis_end().
+ * \brief Function pointer to ast_ari_validate_stasis_end().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_stasis_end_fn(void);
+ari_validator ast_ari_validate_stasis_end_fn(void);
/*!
* \brief Validator for StasisStart.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
-int ari_validate_stasis_start(struct ast_json *json);
+int ast_ari_validate_stasis_start(struct ast_json *json);
/*!
- * \brief Function pointer to ari_validate_stasis_start().
+ * \brief Function pointer to ast_ari_validate_stasis_start().
*
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
*/
-ari_validator ari_validate_stasis_start_fn(void);
+ari_validator ast_ari_validate_stasis_start_fn(void);
/*
* JSON models
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/astobj2.h"
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
/*! \file
*
* \author David M. Lee, II <dlee@digium.com>
*/
-struct ari_websocket_session {
+struct ast_ari_websocket_session {
struct ast_websocket *ws_session;
int (*validator)(struct ast_json *);
};
static void websocket_session_dtor(void *obj)
{
- struct ari_websocket_session *session = obj;
+ struct ast_ari_websocket_session *session = obj;
ast_websocket_unref(session->ws_session);
session->ws_session = NULL;
return 1;
}
-struct ari_websocket_session *ari_websocket_session_create(
+struct ast_ari_websocket_session *ast_ari_websocket_session_create(
struct ast_websocket *ws_session, int (*validator)(struct ast_json *))
{
- RAII_VAR(struct ari_websocket_session *, session, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_websocket_session *, session, NULL, ao2_cleanup);
if (ws_session == NULL) {
return NULL;
return session;
}
-struct ast_json *ari_websocket_session_read(
- struct ari_websocket_session *session)
+struct ast_json *ast_ari_websocket_session_read(
+ struct ast_ari_websocket_session *session)
{
RAII_VAR(struct ast_json *, message, NULL, ast_json_unref);
" \"message\": \"Message validation failed\"" \
"}"
-int ari_websocket_session_write(struct ari_websocket_session *session,
+int ast_ari_websocket_session_write(struct ast_ari_websocket_session *session,
struct ast_json *message)
{
RAII_VAR(char *, str, NULL, ast_free);
}
#endif
- str = ast_json_dump_string_format(message, stasis_http_json_format());
+ str = ast_json_dump_string_format(message, ast_ari_json_format());
if (str == NULL) {
ast_log(LOG_ERROR, "Failed to encode JSON object\n");
static char *ari_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- RAII_VAR(struct ari_conf *, conf, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf *, conf, NULL, ao2_cleanup);
switch (cmd) {
case CLI_INIT:
return CLI_SHOWUSAGE;
}
- conf = ari_config_get();
+ conf = ast_ari_config_get();
if (!conf) {
ast_cli(a->fd, "Error getting ARI configuration\n");
static int show_users_cb(void *obj, void *arg, int flags)
{
- struct ari_conf_user *user = obj;
+ struct ast_ari_conf_user *user = obj;
struct ast_cli_args *a = arg;
ast_cli(a->fd, "%-4s %s\n",
static char *ari_show_users(struct ast_cli_entry *e, int cmd,
struct ast_cli_args *a)
{
- RAII_VAR(struct ari_conf *, conf, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf *, conf, NULL, ao2_cleanup);
switch (cmd) {
case CLI_INIT:
return CLI_SHOWUSAGE;
}
- conf = ari_config_get();
+ conf = ast_ari_config_get();
if (!conf) {
ast_cli(a->fd, "Error getting ARI configuration\n");
return CLI_FAILURE;
static char *complete_ari_user(struct ast_cli_args *a)
{
- RAII_VAR(struct ari_conf *, conf, NULL, ao2_cleanup);
- RAII_VAR(struct ari_conf_user *, user, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf *, conf, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf_user *, user, NULL, ao2_cleanup);
struct user_complete search = {
.state = a->n,
};
- conf = ari_config_get();
+ conf = ast_ari_config_get();
if (!conf) {
ast_cli(a->fd, "Error getting ARI configuration\n");
return CLI_FAILURE;
static char *ari_show_user(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- RAII_VAR(struct ari_conf *, conf, NULL, ao2_cleanup);
- RAII_VAR(struct ari_conf_user *, user, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf *, conf, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf_user *, user, NULL, ao2_cleanup);
switch (cmd) {
case CLI_INIT:
return CLI_SHOWUSAGE;
}
- conf = ari_config_get();
+ conf = ast_ari_config_get();
if (!conf) {
ast_cli(a->fd, "Error getting ARI configuration\n");
AST_CLI_DEFINE(ari_mkpasswd, "Encrypts a password"),
};
-int ari_cli_register(void) {
+int ast_ari_cli_register(void) {
return ast_cli_register_multiple(cli_ari, ARRAY_LEN(cli_ari));
}
-void ari_cli_unregister(void) {
+void ast_ari_cli_unregister(void) {
ast_cli_unregister_multiple(cli_ari, ARRAY_LEN(cli_ari));
}
/*! \brief Locking container for safe configuration access. */
static AO2_GLOBAL_OBJ_STATIC(confs);
-/*! \brief Mapping of the stasis http conf struct's globals to the
+/*! \brief Mapping of the ARI conf struct's globals to the
* general context in the config file. */
static struct aco_type general_option = {
.type = ACO_GLOBAL,
.name = "general",
- .item_offset = offsetof(struct ari_conf, general),
+ .item_offset = offsetof(struct ast_ari_conf, general),
.category = "^general$",
.category_match = ACO_WHITELIST,
};
static int encoding_format_handler(const struct aco_option *opt,
struct ast_variable *var, void *obj)
{
- struct ari_conf_general *general = obj;
+ struct ast_ari_conf_general *general = obj;
if (!strcasecmp(var->name, "pretty")) {
general->format = ast_true(var->value) ?
return 0;
}
-/*! \brief Parses the ari_password_format enum from a config file */
+/*! \brief Parses the ast_ari_password_format enum from a config file */
static int password_format_handler(const struct aco_option *opt,
struct ast_variable *var, void *obj)
{
- struct ari_conf_user *user = obj;
+ struct ast_ari_conf_user *user = obj;
if (strcasecmp(var->value, "plain") == 0) {
user->password_format = ARI_PASSWORD_FORMAT_PLAIN;
return 0;
}
-/*! \brief Destructor for \ref ari_conf_user */
+/*! \brief Destructor for \ref ast_ari_conf_user */
static void user_dtor(void *obj)
{
- struct ari_conf_user *user = obj;
+ struct ast_ari_conf_user *user = obj;
ast_debug(3, "Disposing of user %s\n", user->username);
ast_free(user->username);
}
-/*! \brief Allocate an \ref ari_conf_user for config parsing */
+/*! \brief Allocate an \ref ast_ari_conf_user for config parsing */
static void *user_alloc(const char *cat)
{
- RAII_VAR(struct ari_conf_user *, user, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf_user *, user, NULL, ao2_cleanup);
if (!cat) {
return NULL;
/*! \brief Sorting function for use with red/black tree */
static int user_sort_cmp(const void *obj_left, const void *obj_right, int flags)
{
- const struct ari_conf_user *user_left = obj_left;
+ const struct ast_ari_conf_user *user_left = obj_left;
if (flags & OBJ_PARTIAL_KEY) {
const char *key_right = obj_right;
const char *key_right = obj_right;
return strcasecmp(user_left->username, key_right);
} else {
- const struct ari_conf_user *user_right = obj_right;
+ const struct ast_ari_conf_user *user_right = obj_right;
const char *key_right = user_right->username;
return strcasecmp(user_left->username, key_right);
}
.matchvalue = "user",
.item_alloc = user_alloc,
.item_find = user_find,
- .item_offset = offsetof(struct ari_conf, users),
+ .item_offset = offsetof(struct ast_ari_conf, users),
};
static struct aco_type *user[] = ACO_TYPES(&user_option);
-/*! \brief \ref ari_conf destructor. */
+/*! \brief \ref ast_ari_conf destructor. */
static void conf_destructor(void *obj)
{
- struct ari_conf *cfg = obj;
+ struct ast_ari_conf *cfg = obj;
ast_string_field_free_memory(cfg->general);
ao2_cleanup(cfg->users);
}
-/*! \brief Allocate an \ref ari_conf for config parsing */
+/*! \brief Allocate an \ref ast_ari_conf for config parsing */
static void *conf_alloc(void)
{
- RAII_VAR(struct ari_conf *, cfg, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf *, cfg, NULL, ao2_cleanup);
cfg = ao2_alloc_options(sizeof(*cfg), conf_destructor,
AO2_ALLOC_OPT_LOCK_NOLOCK);
CONFIG_INFO_STANDARD(cfg_info, confs, conf_alloc,
.files = ACO_FILES(&conf_file));
-struct ari_conf *ari_config_get(void)
+struct ast_ari_conf *ast_ari_config_get(void)
{
- struct ari_conf *res = ao2_global_obj_ref(confs);
+ struct ast_ari_conf *res = ao2_global_obj_ref(confs);
if (!res) {
ast_log(LOG_ERROR,
"Error obtaining config from " CONF_FILENAME "\n");
return res;
}
-struct ari_conf_user *ari_config_validate_user(const char *username,
+struct ast_ari_conf_user *ast_ari_config_validate_user(const char *username,
const char *password)
{
- RAII_VAR(struct ari_conf *, conf, NULL, ao2_cleanup);
- RAII_VAR(struct ari_conf_user *, user, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf *, conf, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf_user *, user, NULL, ao2_cleanup);
int is_valid = 0;
- conf = ari_config_get();
+ conf = ast_ari_config_get();
if (!conf) {
return NULL;
}
/*! \brief Callback to validate a user object */
static int validate_user_cb(void *obj, void *arg, int flags)
{
- struct ari_conf_user *user = obj;
+ struct ast_ari_conf_user *user = obj;
if (ast_strlen_zero(user->password)) {
ast_log(LOG_WARNING, "User '%s' missing password\n",
/*! \brief Load (or reload) configuration. */
static int process_config(int reload)
{
- RAII_VAR(struct ari_conf *, conf, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_ari_conf *, conf, NULL, ao2_cleanup);
switch (aco_process_config(&cfg_info, reload)) {
case ACO_PROCESS_ERROR:
break;
}
- conf = ari_config_get();
+ conf = ast_ari_config_get();
if (!conf) {
ast_assert(0); /* We just configured; it should be there */
return -1;
return 0;
}
-int ari_config_init(void)
+int ast_ari_config_init(void)
{
if (aco_info_init(&cfg_info)) {
aco_info_destroy(&cfg_info);
aco_option_register(&cfg_info, "enabled", ACO_EXACT, general_options,
"yes", OPT_BOOL_T, 1,
- FLDSET(struct ari_conf_general, enabled));
+ FLDSET(struct ast_ari_conf_general, enabled));
aco_option_register_custom(&cfg_info, "pretty", ACO_EXACT,
general_options, "no", encoding_format_handler, 0);
aco_option_register(&cfg_info, "auth_realm", ACO_EXACT, general_options,
"Asterisk REST Interface", OPT_CHAR_ARRAY_T, 0,
- FLDSET(struct ari_conf_general, auth_realm),
+ FLDSET(struct ast_ari_conf_general, auth_realm),
ARI_AUTH_REALM_LEN);
aco_option_register(&cfg_info, "allowed_origins", ACO_EXACT, general_options,
"", OPT_STRINGFIELD_T, 0,
- STRFLDSET(struct ari_conf_general, allowed_origins));
+ STRFLDSET(struct ast_ari_conf_general, allowed_origins));
aco_option_register(&cfg_info, "type", ACO_EXACT, user, NULL,
OPT_NOOP_T, 0, 0);
aco_option_register(&cfg_info, "read_only", ACO_EXACT, user,
"no", OPT_BOOL_T, 1,
- FLDSET(struct ari_conf_user, read_only));
+ FLDSET(struct ast_ari_conf_user, read_only));
aco_option_register(&cfg_info, "password", ACO_EXACT, user,
"", OPT_CHAR_ARRAY_T, 0,
- FLDSET(struct ari_conf_user, password), ARI_PASSWORD_LEN);
+ FLDSET(struct ast_ari_conf_user, password), ARI_PASSWORD_LEN);
aco_option_register_custom(&cfg_info, "password_format", ACO_EXACT,
user, "plain", password_format_handler, 0);
return process_config(0);
}
-int ari_config_reload(void)
+int ast_ari_config_reload(void)
{
return process_config(1);
}
-void ari_config_destroy(void)
+void ast_ari_config_destroy(void)
{
aco_info_destroy(&cfg_info);
ao2_global_obj_release(confs);
* at the top of the source tree.
*/
-#ifndef STASIS_HTTP_INTERNAL_H_
-#define STASIS_HTTP_INTERNAL_H_
+#ifndef ARI_INTERNAL_H_
+#define ARI_INTERNAL_H_
/*! \file
*
- * \brief Internal API's for res_stasis_http.
+ * \brief Internal API's for res_ari.
* \author David M. Lee, II <dlee@digium.com>
*/
* \return 0 on success.
* \return Non-zero on error.
*/
-int ari_cli_register(void);
+int ast_ari_cli_register(void);
/*!
* \brief Unregister CLI commands for ARI.
*/
-void ari_cli_unregister(void);
+void ast_ari_cli_unregister(void);
/*! @} */
/*! @{ */
-struct ari_conf_general;
+struct ast_ari_conf_general;
-/*! \brief All configuration options for stasis http. */
-struct ari_conf {
+/*! \brief All configuration options for ARI. */
+struct ast_ari_conf {
/*! The general section configuration options. */
- struct ari_conf_general *general;
+ struct ast_ari_conf_general *general;
/*! Configured users */
struct ao2_container *users;
};
/*! Max length for auth_realm field */
#define ARI_AUTH_REALM_LEN 80
-/*! \brief Global configuration options for stasis http. */
-struct ari_conf_general {
+/*! \brief Global configuration options for ARI. */
+struct ast_ari_conf_general {
/*! Enabled by default, disabled if false. */
int enabled;
/*! Encoding format used during output (default compact). */
};
/*! \brief Password format */
-enum ari_password_format {
+enum ast_ari_password_format {
/*! \brief Plaintext password */
ARI_PASSWORD_FORMAT_PLAIN,
/*! crypt(3) password */
#define ARI_PASSWORD_LEN 256
/*! \brief Per-user configuration options */
-struct ari_conf_user {
+struct ast_ari_conf_user {
/*! Username for authentication */
char *username;
/*! User's password. */
char password[ARI_PASSWORD_LEN];
/*! Format for the password field */
- enum ari_password_format password_format;
+ enum ast_ari_password_format password_format;
/*! If true, user cannot execute change operations */
int read_only;
};
/*!
* \brief Initialize the ARI configuration
*/
-int ari_config_init(void);
+int ast_ari_config_init(void);
/*!
* \brief Reload the ARI configuration
*/
-int ari_config_reload(void);
+int ast_ari_config_reload(void);
/*!
* \brief Destroy the ARI configuration
*/
-void ari_config_destroy(void);
+void ast_ari_config_destroy(void);
/*!
* \brief Get the current ARI configuration.
* \return ARI configuration object.
* \return \c NULL on error.
*/
-struct ari_conf *ari_config_get(void);
+struct ast_ari_conf *ast_ari_config_get(void);
/*!
* \brief Validated a user's credentials.
* \return User object.
* \return \c NULL if username or password is invalid.
*/
-struct ari_conf_user *ari_config_validate_user(const char *username,
+struct ast_ari_conf_user *ast_ari_config_validate_user(const char *username,
const char *password);
/*! @} */
-#endif /* STASIS_HTTP_INTERNAL_H_ */
+#endif /* ARI_INTERNAL_H_ */
/*! \file
*
- * \brief Implementation for stasis-http stubs.
+ * \brief Implementation for ARI stubs.
*
* \author David M. Lee, II <dlee@digium.com>
*/
#include "resource_asterisk.h"
#include "asterisk/pbx.h"
-void stasis_http_get_asterisk_info(struct ast_variable *headers, struct ast_get_asterisk_info_args *args, struct stasis_http_response *response)
+void ast_ari_get_asterisk_info(struct ast_variable *headers, struct ast_get_asterisk_info_args *args, struct ast_ari_response *response)
{
- ast_log(LOG_ERROR, "TODO: stasis_http_get_asterisk_info\n");
+ ast_log(LOG_ERROR, "TODO: ari_get_asterisk_info\n");
}
-void stasis_http_get_global_var(struct ast_variable *headers, struct ast_get_global_var_args *args, struct stasis_http_response *response)
+void ast_ari_get_global_var(struct ast_variable *headers, struct ast_get_global_var_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
RAII_VAR(struct ast_str *, tmp, ast_str_create(32), ast_free);
ast_assert(response != NULL);
if (!tmp) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
value = ast_str_retrieve_variable(&tmp, 0, NULL, NULL, args->variable);
if (!(json = ast_json_pack("{s: s}", "value", S_OR(value, "")))) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
- stasis_http_response_ok(response, ast_json_ref(json));
+ ast_ari_response_ok(response, ast_json_ref(json));
}
-void stasis_http_set_global_var(struct ast_variable *headers, struct ast_set_global_var_args *args, struct stasis_http_response *response)
+void ast_ari_set_global_var(struct ast_variable *headers, struct ast_set_global_var_args *args, struct ast_ari_response *response)
{
ast_assert(response != NULL);
if (ast_strlen_zero(args->variable)) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"Variable name is required");
return;
pbx_builtin_setvar_helper(NULL, args->variable, args->value);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
/*! \file
*
* \brief Generated file - declares stubs to be implemented in
- * res/stasis_http/resource_asterisk.c
+ * res/ari/resource_asterisk.c
*
* Asterisk resources
*
* !!!!! DO NOT EDIT !!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This file is generated by a mustache template. Please see the original
- * template in rest-api-templates/stasis_http_resource.h.mustache
+ * template in rest-api-templates/ari_resource.h.mustache
*/
#ifndef _ASTERISK_RESOURCE_ASTERISK_H
#define _ASTERISK_RESOURCE_ASTERISK_H
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
-/*! \brief Argument struct for stasis_http_get_asterisk_info() */
+/*! \brief Argument struct for ast_ari_get_asterisk_info() */
struct ast_get_asterisk_info_args {
/*! \brief Filter information returned */
const char *only;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_asterisk_info(struct ast_variable *headers, struct ast_get_asterisk_info_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_global_var() */
+void ast_ari_get_asterisk_info(struct ast_variable *headers, struct ast_get_asterisk_info_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_global_var() */
struct ast_get_global_var_args {
/*! \brief The variable to get */
const char *variable;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_global_var(struct ast_variable *headers, struct ast_get_global_var_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_set_global_var() */
+void ast_ari_get_global_var(struct ast_variable *headers, struct ast_get_global_var_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_set_global_var() */
struct ast_set_global_var_args {
/*! \brief The variable to set */
const char *variable;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_set_global_var(struct ast_variable *headers, struct ast_set_global_var_args *args, struct stasis_http_response *response);
+void ast_ari_set_global_var(struct ast_variable *headers, struct ast_set_global_var_args *args, struct ast_ari_response *response);
#endif /* _ASTERISK_RESOURCE_ASTERISK_H */
/*! \file
*
- * \brief Implementation for stasis-http stubs.
+ * \brief Implementation for ARI stubs.
*
* \author David M. Lee, II <dlee@digium.com>
*/
* \return \c NULL if bridge does not exist.
*/
static struct ast_bridge *find_bridge(
- struct stasis_http_response *response,
+ struct ast_ari_response *response,
const char *bridge_id)
{
RAII_VAR(struct ast_bridge *, bridge, NULL, ao2_cleanup);
RAII_VAR(struct ast_bridge_snapshot *, snapshot,
ast_bridge_snapshot_get_latest(bridge_id), ao2_cleanup);
if (!snapshot) {
- stasis_http_response_error(response, 404, "Not found",
+ ast_ari_response_error(response, 404, "Not found",
"Bridge not found");
return NULL;
}
- stasis_http_response_error(response, 409, "Conflict",
+ ast_ari_response_error(response, 409, "Conflict",
"Bridge not in Stasis application");
return NULL;
}
* \return \c NULL if control object does not exist.
*/
static struct stasis_app_control *find_channel_control(
- struct stasis_http_response *response,
+ struct ast_ari_response *response,
const char *channel_id)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
control = stasis_app_control_find_by_channel_id(channel_id);
if (control == NULL) {
- stasis_http_response_error(response, 422, "Unprocessable Entity",
+ ast_ari_response_error(response, 422, "Unprocessable Entity",
"Channel not in Stasis application");
return NULL;
}
return control;
}
-void stasis_http_add_channel_to_bridge(struct ast_variable *headers, struct ast_add_channel_to_bridge_args *args, struct stasis_http_response *response)
+void ast_ari_add_channel_to_bridge(struct ast_variable *headers, struct ast_add_channel_to_bridge_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
}
stasis_app_control_add_channel_to_bridge(control, bridge);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_remove_channel_from_bridge(struct ast_variable *headers, struct ast_remove_channel_from_bridge_args *args, struct stasis_http_response *response)
+void ast_ari_remove_channel_from_bridge(struct ast_variable *headers, struct ast_remove_channel_from_bridge_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
* is added to the channel snapshot. A 409 response should be issued if the bridge
* uniqueids don't match */
if (stasis_app_control_remove_channel_from_bridge(control, bridge)) {
- stasis_http_response_error(response, 500, "Internal Error",
+ ast_ari_response_error(response, 500, "Internal Error",
"Could not remove channel from bridge");
return;
}
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
struct bridge_channel_control_thread_data {
return ast_request(type, cap, NULL, "ARI", NULL);
}
-void stasis_http_play_on_bridge(struct ast_variable *headers, struct ast_play_on_bridge_args *args, struct stasis_http_response *response)
+void ast_ari_play_on_bridge(struct ast_variable *headers, struct ast_play_on_bridge_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
RAII_VAR(struct ast_channel *, play_channel, NULL, ast_hangup);
}
if (!(play_channel = prepare_bridge_media_channel("Announcer"))) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Error", "Could not create playback channel");
return;
}
ast_debug(1, "Created announcer channel '%s'\n", ast_channel_name(play_channel));
if (ast_unreal_channel_push_to_bridge(play_channel, bridge)) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Error", "Failed to put playback channel into the bridge");
return;
}
control = stasis_app_control_create(play_channel);
if (control == NULL) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
snapshot = stasis_app_control_get_snapshot(control);
if (!snapshot) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Error", "Failed to get control snapshot");
return;
}
args->offsetms);
if (!playback) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
stasis_app_playback_get_id(playback));
if (!playback_url) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
json = stasis_app_playback_to_json(playback);
if (!json) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
/* Give play_channel and control reference to the thread data */
thread_data = ast_calloc(1, sizeof(*thread_data));
if (!thread_data) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
thread_data->control = control;
if (ast_pthread_create_detached(&threadid, NULL, bridge_channel_control_thread, thread_data)) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
ast_free(thread_data);
return;
}
play_channel = NULL;
control = NULL;
- stasis_http_response_created(response, playback_url, json);
+ ast_ari_response_created(response, playback_url, json);
}
-void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct stasis_http_response *response)
+void ast_ari_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
RAII_VAR(struct ast_channel *, record_channel, NULL, ast_hangup);
}
if (!(record_channel = prepare_bridge_media_channel("Recorder"))) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error", "Failed to create recording channel");
return;
}
if (ast_unreal_channel_push_to_bridge(record_channel, bridge)) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Error", "Failed to put recording channel into the bridge");
return;
}
control = stasis_app_control_create(record_channel);
if (control == NULL) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
options = stasis_app_recording_options_create(args->name, args->format);
if (options == NULL) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
/* While the arguments are invalid, we should have
* caught them prior to calling record.
*/
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Error parsing request");
break;
case EEXIST:
- stasis_http_response_error(response, 409, "Conflict",
+ ast_ari_response_error(response, 409, "Conflict",
"Recording '%s' already in progress",
args->name);
break;
case ENOMEM:
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
break;
case EPERM:
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"Recording name invalid");
break;
ast_log(LOG_WARNING,
"Unrecognized recording error: %s\n",
strerror(errno));
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Internal Server Error");
break;
uri_name_maxlen = strlen(args->name) * 3;
uri_encoded_name = ast_malloc(uri_name_maxlen);
if (!uri_encoded_name) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
ast_uri_encode(args->name, uri_encoded_name, uri_name_maxlen, ast_uri_http);
ast_asprintf(&recording_url, "/recordings/live/%s", uri_encoded_name);
if (!recording_url) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
json = stasis_app_recording_to_json(recording);
if (!json) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
thread_data = ast_calloc(1, sizeof(*thread_data));
if (!thread_data) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
thread_data->control = control;
if (ast_pthread_create_detached(&threadid, NULL, bridge_channel_control_thread, thread_data)) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
ast_free(thread_data);
return;
}
record_channel = NULL;
control = NULL;
- stasis_http_response_created(response, recording_url, json);
+ ast_ari_response_created(response, recording_url, json);
}
-void stasis_http_get_bridge(struct ast_variable *headers, struct ast_get_bridge_args *args, struct stasis_http_response *response)
+void ast_ari_get_bridge(struct ast_variable *headers, struct ast_get_bridge_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ast_bridge_snapshot *, snapshot, ast_bridge_snapshot_get_latest(args->bridge_id), ao2_cleanup);
if (!snapshot) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 404, "Not Found",
"Bridge not found");
return;
}
- stasis_http_response_ok(response,
+ ast_ari_response_ok(response,
ast_bridge_snapshot_to_json(snapshot));
}
-void stasis_http_delete_bridge(struct ast_variable *headers, struct ast_delete_bridge_args *args, struct stasis_http_response *response)
+void ast_ari_delete_bridge(struct ast_variable *headers, struct ast_delete_bridge_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ast_bridge *, bridge, find_bridge(response, args->bridge_id), ao2_cleanup);
if (!bridge) {
}
stasis_app_bridge_destroy(args->bridge_id);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct stasis_http_response *response)
+void ast_ari_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
caching_topic = ast_bridge_topic_all_cached();
if (!caching_topic) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Message bus not initialized");
return;
snapshots = stasis_cache_dump(caching_topic, ast_bridge_snapshot_type());
if (!snapshots) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
json = ast_json_array_create();
if (!json) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
RAII_VAR(struct stasis_message *, msg, obj, ao2_cleanup);
struct ast_bridge_snapshot *snapshot = stasis_message_data(msg);
if (ast_json_array_append(json, ast_bridge_snapshot_to_json(snapshot))) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
}
ao2_iterator_destroy(&i);
- stasis_http_response_ok(response, ast_json_ref(json));
+ ast_ari_response_ok(response, ast_json_ref(json));
}
-void stasis_http_new_bridge(struct ast_variable *headers, struct ast_new_bridge_args *args, struct stasis_http_response *response)
+void ast_ari_new_bridge(struct ast_variable *headers, struct ast_new_bridge_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ast_bridge *, bridge, stasis_app_bridge_create(args->type), ao2_cleanup);
RAII_VAR(struct ast_bridge_snapshot *, snapshot, NULL, ao2_cleanup);
if (!bridge) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Error",
"Unable to create bridge");
return;
snapshot = ast_bridge_snapshot_create(bridge);
if (!snapshot) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Error",
"Unable to create snapshot for new bridge");
return;
}
- stasis_http_response_ok(response,
+ ast_ari_response_ok(response,
ast_bridge_snapshot_to_json(snapshot));
}
/*! \file
*
* \brief Generated file - declares stubs to be implemented in
- * res/stasis_http/resource_bridges.c
+ * res/ari/resource_bridges.c
*
* Bridge resources
*
* !!!!! DO NOT EDIT !!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This file is generated by a mustache template. Please see the original
- * template in rest-api-templates/stasis_http_resource.h.mustache
+ * template in rest-api-templates/ari_resource.h.mustache
*/
#ifndef _ASTERISK_RESOURCE_BRIDGES_H
#define _ASTERISK_RESOURCE_BRIDGES_H
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
-/*! \brief Argument struct for stasis_http_get_bridges() */
+/*! \brief Argument struct for ast_ari_get_bridges() */
struct ast_get_bridges_args {
};
/*!
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_new_bridge() */
+void ast_ari_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_new_bridge() */
struct ast_new_bridge_args {
/*! \brief Type of bridge to create. */
const char *type;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_new_bridge(struct ast_variable *headers, struct ast_new_bridge_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_bridge() */
+void ast_ari_new_bridge(struct ast_variable *headers, struct ast_new_bridge_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_bridge() */
struct ast_get_bridge_args {
/*! \brief Bridge's id */
const char *bridge_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_bridge(struct ast_variable *headers, struct ast_get_bridge_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_delete_bridge() */
+void ast_ari_get_bridge(struct ast_variable *headers, struct ast_get_bridge_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_delete_bridge() */
struct ast_delete_bridge_args {
/*! \brief Bridge's id */
const char *bridge_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_delete_bridge(struct ast_variable *headers, struct ast_delete_bridge_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_add_channel_to_bridge() */
+void ast_ari_delete_bridge(struct ast_variable *headers, struct ast_delete_bridge_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_add_channel_to_bridge() */
struct ast_add_channel_to_bridge_args {
/*! \brief Bridge's id */
const char *bridge_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_add_channel_to_bridge(struct ast_variable *headers, struct ast_add_channel_to_bridge_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_remove_channel_from_bridge() */
+void ast_ari_add_channel_to_bridge(struct ast_variable *headers, struct ast_add_channel_to_bridge_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_remove_channel_from_bridge() */
struct ast_remove_channel_from_bridge_args {
/*! \brief Bridge's id */
const char *bridge_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_remove_channel_from_bridge(struct ast_variable *headers, struct ast_remove_channel_from_bridge_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_play_on_bridge() */
+void ast_ari_remove_channel_from_bridge(struct ast_variable *headers, struct ast_remove_channel_from_bridge_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_play_on_bridge() */
struct ast_play_on_bridge_args {
/*! \brief Bridge's id */
const char *bridge_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_play_on_bridge(struct ast_variable *headers, struct ast_play_on_bridge_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_record_bridge() */
+void ast_ari_play_on_bridge(struct ast_variable *headers, struct ast_play_on_bridge_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_record_bridge() */
struct ast_record_bridge_args {
/*! \brief Bridge's id */
const char *bridge_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct stasis_http_response *response);
+void ast_ari_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct ast_ari_response *response);
#endif /* _ASTERISK_RESOURCE_BRIDGES_H */
/*! \file
*
- * \brief Implementation for stasis-http stubs.
+ * \brief Implementation for ARI stubs.
*
* \author David M. Lee, II <dlee@digium.com>
*/
* \return \c NULL if control object does not exist.
*/
static struct stasis_app_control *find_control(
- struct stasis_http_response *response,
+ struct ast_ari_response *response,
const char *channel_id)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
RAII_VAR(struct ast_channel *, chan, NULL, ao2_cleanup);
chan = ast_channel_get_by_name(channel_id);
if (chan == NULL) {
- stasis_http_response_error(response, 404, "Not Found",
+ ast_ari_response_error(response, 404, "Not Found",
"Channel not found");
return NULL;
}
- stasis_http_response_error(response, 409, "Conflict",
+ ast_ari_response_error(response, 409, "Conflict",
"Channel not in Stasis application");
return NULL;
}
return control;
}
-void stasis_http_dial(struct ast_variable *headers, struct ast_dial_args *args, struct stasis_http_response *response)
+void ast_ari_dial(struct ast_variable *headers, struct ast_dial_args *args, struct ast_ari_response *response)
{
struct stasis_app_control *control;
}
if (stasis_app_control_dial(control, args->endpoint, args->timeout)) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_continue_in_dialplan(
+void ast_ari_continue_in_dialplan(
struct ast_variable *headers,
struct ast_continue_in_dialplan_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
}
if (stasis_app_control_continue(control, args->context, args->extension, args->priority)) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_answer_channel(struct ast_variable *headers,
+void ast_ari_answer_channel(struct ast_variable *headers,
struct ast_answer_channel_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
}
if (stasis_app_control_answer(control) != 0) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Failed to answer channel");
return;
}
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_mute_channel(struct ast_variable *headers, struct ast_mute_channel_args *args, struct stasis_http_response *response)
+void ast_ari_mute_channel(struct ast_variable *headers, struct ast_mute_channel_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
unsigned int direction = 0;
} else if (!strcmp(args->direction, "both")) {
direction = AST_MUTE_DIRECTION_READ | AST_MUTE_DIRECTION_WRITE;
} else {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"Invalid direction specified");
return;
stasis_app_control_mute(control, direction, frametype);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_unmute_channel(struct ast_variable *headers, struct ast_unmute_channel_args *args, struct stasis_http_response *response)
+void ast_ari_unmute_channel(struct ast_variable *headers, struct ast_unmute_channel_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
unsigned int direction = 0;
} else if (!strcmp(args->direction, "both")) {
direction = AST_MUTE_DIRECTION_READ | AST_MUTE_DIRECTION_WRITE;
} else {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"Invalid direction specified");
return;
stasis_app_control_unmute(control, direction, frametype);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_hold_channel(struct ast_variable *headers, struct ast_hold_channel_args *args, struct stasis_http_response *response)
+void ast_ari_hold_channel(struct ast_variable *headers, struct ast_hold_channel_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
stasis_app_control_hold(control);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_unhold_channel(struct ast_variable *headers, struct ast_unhold_channel_args *args, struct stasis_http_response *response)
+void ast_ari_unhold_channel(struct ast_variable *headers, struct ast_unhold_channel_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
stasis_app_control_unhold(control);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_moh_start_channel(struct ast_variable *headers, struct ast_moh_start_channel_args *args, struct stasis_http_response *response)
+void ast_ari_moh_start_channel(struct ast_variable *headers, struct ast_moh_start_channel_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
}
stasis_app_control_moh_start(control, args->moh_class);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_moh_stop_channel(struct ast_variable *headers, struct ast_moh_stop_channel_args *args, struct stasis_http_response *response)
+void ast_ari_moh_stop_channel(struct ast_variable *headers, struct ast_moh_stop_channel_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
}
stasis_app_control_moh_stop(control);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_play_on_channel(struct ast_variable *headers,
+void ast_ari_play_on_channel(struct ast_variable *headers,
struct ast_play_on_channel_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
snapshot = stasis_app_control_get_snapshot(control);
if (!snapshot) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 404, "Not Found",
"Channel not found");
return;
}
if (args->skipms < 0) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"skipms cannot be negative");
return;
}
if (args->offsetms < 0) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"offsetms cannot be negative");
return;
playback = stasis_app_control_play_uri(control, args->media, language,
args->channel_id, STASIS_PLAYBACK_TARGET_CHANNEL, args->skipms, args->offsetms);
if (!playback) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Failed to queue media for playback");
return;
ast_asprintf(&playback_url, "/playback/%s",
stasis_app_playback_get_id(playback));
if (!playback_url) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Out of memory");
return;
json = stasis_app_playback_to_json(playback);
if (!json) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Out of memory");
return;
}
- stasis_http_response_created(response, playback_url, json);
+ ast_ari_response_created(response, playback_url, json);
}
-void stasis_http_record_channel(struct ast_variable *headers,
+void ast_ari_record_channel(struct ast_variable *headers,
struct ast_record_channel_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
ast_assert(response != NULL);
if (args->max_duration_seconds < 0) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"max_duration_seconds cannot be negative");
return;
}
if (args->max_silence_seconds < 0) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"max_silence_seconds cannot be negative");
return;
options = stasis_app_recording_options_create(args->name, args->format);
if (options == NULL) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Out of memory");
}
options->beep = args->beep;
if (options->terminate_on == STASIS_APP_RECORDING_TERMINATE_INVALID) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"terminateOn invalid");
return;
}
if (options->if_exists == -1) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"ifExists invalid");
return;
/* While the arguments are invalid, we should have
* caught them prior to calling record.
*/
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Error parsing request");
break;
case EEXIST:
- stasis_http_response_error(response, 409, "Conflict",
+ ast_ari_response_error(response, 409, "Conflict",
"Recording '%s' already in progress",
args->name);
break;
case ENOMEM:
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Out of memory");
break;
case EPERM:
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"Recording name invalid");
break;
ast_log(LOG_WARNING,
"Unrecognized recording error: %s\n",
strerror(errno));
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Internal Server Error");
break;
uri_name_maxlen = strlen(args->name) * 3;
uri_encoded_name = ast_malloc(uri_name_maxlen);
if (!uri_encoded_name) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Out of memory");
return;
ast_asprintf(&recording_url, "/recordings/live/%s", uri_encoded_name);
if (!recording_url) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Out of memory");
return;
json = stasis_app_recording_to_json(recording);
if (!json) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Out of memory");
return;
}
- stasis_http_response_created(response, recording_url, json);
+ ast_ari_response_created(response, recording_url, json);
}
-void stasis_http_get_channel(struct ast_variable *headers,
+void ast_ari_get_channel(struct ast_variable *headers,
struct ast_get_channel_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
struct stasis_caching_topic *caching_topic;
caching_topic = ast_channel_topic_all_cached();
if (!caching_topic) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Message bus not initialized");
return;
msg = stasis_cache_get(caching_topic, ast_channel_snapshot_type(),
args->channel_id);
if (!msg) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 404, "Not Found",
"Channel not found");
return;
snapshot = stasis_message_data(msg);
ast_assert(snapshot != NULL);
- stasis_http_response_ok(response,
+ ast_ari_response_ok(response,
ast_channel_snapshot_to_json(snapshot));
}
-void stasis_http_delete_channel(struct ast_variable *headers,
+void ast_ari_delete_channel(struct ast_variable *headers,
struct ast_delete_channel_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct ast_channel *, chan, NULL, ao2_cleanup);
chan = ast_channel_get_by_name(args->channel_id);
if (chan == NULL) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 404, "Not Found",
"Channel not found");
return;
ast_softhangup(chan, AST_SOFTHANGUP_EXPLICIT);
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_get_channels(struct ast_variable *headers,
+void ast_ari_get_channels(struct ast_variable *headers,
struct ast_get_channels_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
caching_topic = ast_channel_topic_all_cached();
if (!caching_topic) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Message bus not initialized");
return;
snapshots = stasis_cache_dump(caching_topic, ast_channel_snapshot_type());
if (!snapshots) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
json = ast_json_array_create();
if (!json) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
int r = ast_json_array_append(
json, ast_channel_snapshot_to_json(snapshot));
if (r != 0) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
}
ao2_iterator_destroy(&i);
- stasis_http_response_ok(response, ast_json_ref(json));
+ ast_ari_response_ok(response, ast_json_ref(json));
}
-void stasis_http_originate(struct ast_variable *headers,
+void ast_ari_originate(struct ast_variable *headers,
struct ast_originate_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
char *dialtech;
char dialdevice[AST_CHANNEL_NAME];
char *stuff;
if (ast_strlen_zero(args->endpoint)) {
- stasis_http_response_error(response, 400, "Bad Request",
+ ast_ari_response_error(response, 400, "Bad Request",
"Endpoint must be specified");
return;
}
}
if (ast_strlen_zero(dialtech) || ast_strlen_zero(dialdevice)) {
- stasis_http_response_error(response, 400, "Bad Request",
+ ast_ari_response_error(response, 400, "Bad Request",
"Invalid endpoint specified");
return;
}
RAII_VAR(struct ast_str *, appdata, ast_str_create(64), ast_free);
if (!appdata) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
/* originate a channel, putting it into an application */
if (ast_pbx_outgoing_app(dialtech, NULL, dialdevice, timeout, app, ast_str_buffer(appdata), NULL, 0, cid_num, cid_name, NULL, NULL, NULL)) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
} else if (!ast_strlen_zero(args->extension)) {
/* originate a channel, sending it to an extension */
if (ast_pbx_outgoing_exten(dialtech, NULL, dialdevice, timeout, S_OR(args->context, "default"), args->extension, args->priority ? args->priority : 1, NULL, 0, cid_num, cid_name, NULL, NULL, NULL, 0)) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
} else {
- stasis_http_response_error(response, 400, "Bad Request",
+ ast_ari_response_error(response, 400, "Bad Request",
"Application or extension must be specified");
return;
}
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
-void stasis_http_get_channel_var(struct ast_variable *headers, struct ast_get_channel_var_args *args, struct stasis_http_response *response)
+void ast_ari_get_channel_var(struct ast_variable *headers, struct ast_get_channel_var_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
value = stasis_app_control_get_channel_var(control, args->variable);
if (!(json = ast_json_pack("{s: s}", "value", S_OR(value, "")))) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
- stasis_http_response_ok(response, ast_json_ref(json));
+ ast_ari_response_ok(response, ast_json_ref(json));
}
-void stasis_http_set_channel_var(struct ast_variable *headers, struct ast_set_channel_var_args *args, struct stasis_http_response *response)
+void ast_ari_set_channel_var(struct ast_variable *headers, struct ast_set_channel_var_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
}
if (ast_strlen_zero(args->variable)) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"Variable name is required");
return;
}
if (stasis_app_control_set_channel_var(control, args->variable, args->value)) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 400, "Bad Request",
"Failed to execute function");
return;
}
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
}
/*! \file
*
* \brief Generated file - declares stubs to be implemented in
- * res/stasis_http/resource_channels.c
+ * res/ari/resource_channels.c
*
* Channel resources
*
* !!!!! DO NOT EDIT !!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This file is generated by a mustache template. Please see the original
- * template in rest-api-templates/stasis_http_resource.h.mustache
+ * template in rest-api-templates/ari_resource.h.mustache
*/
#ifndef _ASTERISK_RESOURCE_CHANNELS_H
#define _ASTERISK_RESOURCE_CHANNELS_H
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
-/*! \brief Argument struct for stasis_http_get_channels() */
+/*! \brief Argument struct for ast_ari_get_channels() */
struct ast_get_channels_args {
};
/*!
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_channels(struct ast_variable *headers, struct ast_get_channels_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_originate() */
+void ast_ari_get_channels(struct ast_variable *headers, struct ast_get_channels_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_originate() */
struct ast_originate_args {
/*! \brief Endpoint to call. */
const char *endpoint;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_originate(struct ast_variable *headers, struct ast_originate_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_channel() */
+void ast_ari_originate(struct ast_variable *headers, struct ast_originate_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_channel() */
struct ast_get_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_channel(struct ast_variable *headers, struct ast_get_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_delete_channel() */
+void ast_ari_get_channel(struct ast_variable *headers, struct ast_get_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_delete_channel() */
struct ast_delete_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_delete_channel(struct ast_variable *headers, struct ast_delete_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_dial() */
+void ast_ari_delete_channel(struct ast_variable *headers, struct ast_delete_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_dial() */
struct ast_dial_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_dial(struct ast_variable *headers, struct ast_dial_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_continue_in_dialplan() */
+void ast_ari_dial(struct ast_variable *headers, struct ast_dial_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_continue_in_dialplan() */
struct ast_continue_in_dialplan_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_continue_in_dialplan(struct ast_variable *headers, struct ast_continue_in_dialplan_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_answer_channel() */
+void ast_ari_continue_in_dialplan(struct ast_variable *headers, struct ast_continue_in_dialplan_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_answer_channel() */
struct ast_answer_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_answer_channel(struct ast_variable *headers, struct ast_answer_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_mute_channel() */
+void ast_ari_answer_channel(struct ast_variable *headers, struct ast_answer_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_mute_channel() */
struct ast_mute_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_mute_channel(struct ast_variable *headers, struct ast_mute_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_unmute_channel() */
+void ast_ari_mute_channel(struct ast_variable *headers, struct ast_mute_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_unmute_channel() */
struct ast_unmute_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_unmute_channel(struct ast_variable *headers, struct ast_unmute_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_hold_channel() */
+void ast_ari_unmute_channel(struct ast_variable *headers, struct ast_unmute_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_hold_channel() */
struct ast_hold_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_hold_channel(struct ast_variable *headers, struct ast_hold_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_unhold_channel() */
+void ast_ari_hold_channel(struct ast_variable *headers, struct ast_hold_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_unhold_channel() */
struct ast_unhold_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_unhold_channel(struct ast_variable *headers, struct ast_unhold_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_moh_start_channel() */
+void ast_ari_unhold_channel(struct ast_variable *headers, struct ast_unhold_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_moh_start_channel() */
struct ast_moh_start_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_moh_start_channel(struct ast_variable *headers, struct ast_moh_start_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_moh_stop_channel() */
+void ast_ari_moh_start_channel(struct ast_variable *headers, struct ast_moh_start_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_moh_stop_channel() */
struct ast_moh_stop_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_moh_stop_channel(struct ast_variable *headers, struct ast_moh_stop_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_play_on_channel() */
+void ast_ari_moh_stop_channel(struct ast_variable *headers, struct ast_moh_stop_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_play_on_channel() */
struct ast_play_on_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_play_on_channel(struct ast_variable *headers, struct ast_play_on_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_record_channel() */
+void ast_ari_play_on_channel(struct ast_variable *headers, struct ast_play_on_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_record_channel() */
struct ast_record_channel_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_record_channel(struct ast_variable *headers, struct ast_record_channel_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_channel_var() */
+void ast_ari_record_channel(struct ast_variable *headers, struct ast_record_channel_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_channel_var() */
struct ast_get_channel_var_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_channel_var(struct ast_variable *headers, struct ast_get_channel_var_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_set_channel_var() */
+void ast_ari_get_channel_var(struct ast_variable *headers, struct ast_get_channel_var_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_set_channel_var() */
struct ast_set_channel_var_args {
/*! \brief Channel's id */
const char *channel_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_set_channel_var(struct ast_variable *headers, struct ast_set_channel_var_args *args, struct stasis_http_response *response);
+void ast_ari_set_channel_var(struct ast_variable *headers, struct ast_set_channel_var_args *args, struct ast_ari_response *response);
#endif /* _ASTERISK_RESOURCE_CHANNELS_H */
#include "asterisk/stasis.h"
#include "asterisk/stasis_endpoints.h"
-void stasis_http_get_endpoints(struct ast_variable *headers,
+void ast_ari_get_endpoints(struct ast_variable *headers,
struct ast_get_endpoints_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
caching_topic = ast_endpoint_topic_all_cached();
if (!caching_topic) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Message bus not initialized");
return;
snapshots = stasis_cache_dump(caching_topic, ast_endpoint_snapshot_type());
if (!snapshots) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
json = ast_json_array_create();
if (!json) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
int r = ast_json_array_append(
json, ast_endpoint_snapshot_to_json(snapshot));
if (r != 0) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
}
ao2_iterator_destroy(&i);
- stasis_http_response_ok(response, ast_json_ref(json));
+ ast_ari_response_ok(response, ast_json_ref(json));
}
-void stasis_http_get_endpoints_by_tech(struct ast_variable *headers,
+void ast_ari_get_endpoints_by_tech(struct ast_variable *headers,
struct ast_get_endpoints_by_tech_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
caching_topic = ast_endpoint_topic_all_cached();
if (!caching_topic) {
- stasis_http_response_error(
+ ast_ari_response_error(
response, 500, "Internal Server Error",
"Message bus not initialized");
return;
snapshots = stasis_cache_dump(caching_topic, ast_endpoint_snapshot_type());
if (!snapshots) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
json = ast_json_array_create();
if (!json) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
r = ast_json_array_append(
json, ast_endpoint_snapshot_to_json(snapshot));
if (r != 0) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
}
ao2_iterator_destroy(&i);
- stasis_http_response_ok(response, ast_json_ref(json));
+ ast_ari_response_ok(response, ast_json_ref(json));
}
-void stasis_http_get_endpoint(struct ast_variable *headers,
+void ast_ari_get_endpoint(struct ast_variable *headers,
struct ast_get_endpoint_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
RAII_VAR(struct ast_endpoint_snapshot *, snapshot, NULL, ao2_cleanup);
snapshot = ast_endpoint_latest_snapshot(args->tech, args->resource, 0);
if (!snapshot) {
- stasis_http_response_error(response, 404, "Not Found",
+ ast_ari_response_error(response, 404, "Not Found",
"Endpoint not found");
return;
}
json = ast_endpoint_snapshot_to_json(snapshot);
if (!json) {
- stasis_http_response_alloc_failed(response);
+ ast_ari_response_alloc_failed(response);
return;
}
- stasis_http_response_ok(response, ast_json_ref(json));
+ ast_ari_response_ok(response, ast_json_ref(json));
}
/*! \file
*
* \brief Generated file - declares stubs to be implemented in
- * res/stasis_http/resource_endpoints.c
+ * res/ari/resource_endpoints.c
*
* Endpoint resources
*
* !!!!! DO NOT EDIT !!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This file is generated by a mustache template. Please see the original
- * template in rest-api-templates/stasis_http_resource.h.mustache
+ * template in rest-api-templates/ari_resource.h.mustache
*/
#ifndef _ASTERISK_RESOURCE_ENDPOINTS_H
#define _ASTERISK_RESOURCE_ENDPOINTS_H
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
-/*! \brief Argument struct for stasis_http_get_endpoints() */
+/*! \brief Argument struct for ast_ari_get_endpoints() */
struct ast_get_endpoints_args {
};
/*!
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_endpoints(struct ast_variable *headers, struct ast_get_endpoints_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_endpoints_by_tech() */
+void ast_ari_get_endpoints(struct ast_variable *headers, struct ast_get_endpoints_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_endpoints_by_tech() */
struct ast_get_endpoints_by_tech_args {
/*! \brief Technology of the endpoints (sip,iax2,...) */
const char *tech;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_endpoints_by_tech(struct ast_variable *headers, struct ast_get_endpoints_by_tech_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_endpoint() */
+void ast_ari_get_endpoints_by_tech(struct ast_variable *headers, struct ast_get_endpoints_by_tech_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_endpoint() */
struct ast_get_endpoint_args {
/*! \brief Technology of the endpoint */
const char *tech;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_endpoint(struct ast_variable *headers, struct ast_get_endpoint_args *args, struct stasis_http_response *response);
+void ast_ari_get_endpoint(struct ast_variable *headers, struct ast_get_endpoint_args *args, struct ast_ari_response *response);
#endif /* _ASTERISK_RESOURCE_ENDPOINTS_H */
/*! \brief A connection to the event WebSocket */
struct event_session {
- struct ari_websocket_session *ws_session;
+ struct ast_ari_websocket_session *ws_session;
struct ao2_container *websocket_apps;
};
}
static struct event_session *session_create(
- struct ari_websocket_session *ws_session)
+ struct ast_ari_websocket_session *ws_session)
{
RAII_VAR(struct event_session *, session, NULL, ao2_cleanup);
const char *msg_application = S_OR(
ast_json_string_get(ast_json_object_get(message, "application")),
"");
-
+
/* Determine if we've been replaced */
if (strcmp(msg_type, "ApplicationReplaced") == 0 &&
strcmp(msg_application, app_name) == 0) {
ao2_lock(session);
if (session->ws_session) {
- ari_websocket_session_write(session->ws_session, message);
+ ast_ari_websocket_session_write(session->ws_session, message);
}
ao2_unlock(session);
}
to_free = apps = ast_strdup(app_list);
if (!apps) {
- ari_websocket_session_write(session->ws_session, ari_oom_json());
+ ast_ari_websocket_session_write(session->ws_session, ast_ari_oom_json());
return -1;
}
while ((app_name = strsep(&apps, ","))) {
if (ast_str_container_add(session->websocket_apps, app_name)) {
- ari_websocket_session_write(session->ws_session, ari_oom_json());
+ ast_ari_websocket_session_write(session->ws_session, ast_ari_oom_json());
return -1;
}
return 0;
}
-void ari_websocket_event_websocket(struct ari_websocket_session *ws_session,
+void ast_ari_websocket_event_websocket(struct ast_ari_websocket_session *ws_session,
struct ast_variable *headers,
struct ast_event_websocket_args *args)
{
session = session_create(ws_session);
if (!session) {
- ari_websocket_session_write(ws_session, ari_oom_json());
+ ast_ari_websocket_session_write(ws_session, ast_ari_oom_json());
return;
}
"type", "MissingParams",
"params", "app");
if (!msg) {
- msg = ast_json_ref(ari_oom_json());
+ msg = ast_json_ref(ast_ari_oom_json());
}
- ari_websocket_session_write(session->ws_session, msg);
+ ast_ari_websocket_session_write(session->ws_session, msg);
return;
}
res = session_register_apps(session, args->app);
if (res != 0) {
- ari_websocket_session_write(ws_session, ari_oom_json());
+ ast_ari_websocket_session_write(ws_session, ast_ari_oom_json());
return;
}
/* We don't process any input, but we'll consume it waiting for EOF */
- while ((msg = ari_websocket_session_read(ws_session))) {
+ while ((msg = ast_ari_websocket_session_read(ws_session))) {
ast_json_unref(msg);
}
}
/*! \file
*
* \brief Generated file - declares stubs to be implemented in
- * res/stasis_http/resource_events.c
+ * res/ari/resource_events.c
*
* WebSocket resource
*
* !!!!! DO NOT EDIT !!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This file is generated by a mustache template. Please see the original
- * template in rest-api-templates/stasis_http_resource.h.mustache
+ * template in rest-api-templates/ari_resource.h.mustache
*/
#ifndef _ASTERISK_RESOURCE_EVENTS_H
#define _ASTERISK_RESOURCE_EVENTS_H
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
-/*! \brief Argument struct for stasis_http_event_websocket() */
+/*! \brief Argument struct for ast_ari_event_websocket() */
struct ast_event_websocket_args {
/*! \brief Comma seperated list of applications to subscribe to. */
const char *app;
* \param headers HTTP headers.
* \param args Swagger parameters.
*/
-void ari_websocket_event_websocket(struct ari_websocket_session *session, struct ast_variable *headers, struct ast_event_websocket_args *args);
+void ast_ari_websocket_event_websocket(struct ast_ari_websocket_session *session, struct ast_variable *headers, struct ast_event_websocket_args *args);
#endif /* _ASTERISK_RESOURCE_EVENTS_H */
#include "asterisk/stasis_app_playback.h"
#include "resource_playback.h"
-void stasis_http_get_playback(struct ast_variable *headers,
+void ast_ari_get_playback(struct ast_variable *headers,
struct ast_get_playback_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_playback *, playback, NULL, ao2_cleanup);
RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
playback = stasis_app_playback_find_by_id(args->playback_id);
if (playback == NULL) {
- stasis_http_response_error(response, 404, "Not Found",
+ ast_ari_response_error(response, 404, "Not Found",
"Playback not found");
return;
}
json = stasis_app_playback_to_json(playback);
if (json == NULL) {
- stasis_http_response_error(response, 500,
+ ast_ari_response_error(response, 500,
"Internal Server Error", "Error building response");
return;
}
- stasis_http_response_ok(response, ast_json_ref(json));
+ ast_ari_response_ok(response, ast_json_ref(json));
}
-void stasis_http_stop_playback(struct ast_variable *headers,
+void ast_ari_stop_playback(struct ast_variable *headers,
struct ast_stop_playback_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_playback *, playback, NULL, ao2_cleanup);
enum stasis_playback_oper_results res;
playback = stasis_app_playback_find_by_id(args->playback_id);
if (playback == NULL) {
- stasis_http_response_error(response, 404, "Not Found",
+ ast_ari_response_error(response, 404, "Not Found",
"Playback not found");
return;
}
switch (res) {
case STASIS_PLAYBACK_OPER_OK:
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
return;
case STASIS_PLAYBACK_OPER_FAILED:
- stasis_http_response_error(response, 500,
+ ast_ari_response_error(response, 500,
"Internal Server Error", "Could not stop playback");
return;
case STASIS_PLAYBACK_OPER_NOT_PLAYING:
/* Stop operation should be valid even when not playing */
ast_assert(0);
- stasis_http_response_error(response, 500,
+ ast_ari_response_error(response, 500,
"Internal Server Error", "Could not stop playback");
return;
}
}
-void stasis_http_control_playback(struct ast_variable *headers,
+void ast_ari_control_playback(struct ast_variable *headers,
struct ast_control_playback_args *args,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
RAII_VAR(struct stasis_app_playback *, playback, NULL, ao2_cleanup);
enum stasis_app_playback_media_operation oper;
} else if (strcmp(args->operation, "forward") == 0) {
oper = STASIS_PLAYBACK_FORWARD;
} else {
- stasis_http_response_error(response, 400,
+ ast_ari_response_error(response, 400,
"Bad Request", "Invalid operation %s",
args->operation);
return;
playback = stasis_app_playback_find_by_id(args->playback_id);
if (playback == NULL) {
- stasis_http_response_error(response, 404, "Not Found",
+ ast_ari_response_error(response, 404, "Not Found",
"Playback not found");
return;
}
switch (res) {
case STASIS_PLAYBACK_OPER_OK:
- stasis_http_response_no_content(response);
+ ast_ari_response_no_content(response);
return;
case STASIS_PLAYBACK_OPER_FAILED:
- stasis_http_response_error(response, 500,
+ ast_ari_response_error(response, 500,
"Internal Server Error", "Could not %s playback",
args->operation);
return;
case STASIS_PLAYBACK_OPER_NOT_PLAYING:
- stasis_http_response_error(response, 409, "Conflict",
+ ast_ari_response_error(response, 409, "Conflict",
"Can only %s while media is playing", args->operation);
return;
}
/*! \file
*
* \brief Generated file - declares stubs to be implemented in
- * res/stasis_http/resource_playback.c
+ * res/ari/resource_playback.c
*
* Playback control resources
*
* !!!!! DO NOT EDIT !!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This file is generated by a mustache template. Please see the original
- * template in rest-api-templates/stasis_http_resource.h.mustache
+ * template in rest-api-templates/ari_resource.h.mustache
*/
#ifndef _ASTERISK_RESOURCE_PLAYBACK_H
#define _ASTERISK_RESOURCE_PLAYBACK_H
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
-/*! \brief Argument struct for stasis_http_get_playback() */
+/*! \brief Argument struct for ast_ari_get_playback() */
struct ast_get_playback_args {
/*! \brief Playback's id */
const char *playback_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_playback(struct ast_variable *headers, struct ast_get_playback_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_stop_playback() */
+void ast_ari_get_playback(struct ast_variable *headers, struct ast_get_playback_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_stop_playback() */
struct ast_stop_playback_args {
/*! \brief Playback's id */
const char *playback_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_stop_playback(struct ast_variable *headers, struct ast_stop_playback_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_control_playback() */
+void ast_ari_stop_playback(struct ast_variable *headers, struct ast_stop_playback_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_control_playback() */
struct ast_control_playback_args {
/*! \brief Playback's id */
const char *playback_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_control_playback(struct ast_variable *headers, struct ast_control_playback_args *args, struct stasis_http_response *response);
+void ast_ari_control_playback(struct ast_variable *headers, struct ast_control_playback_args *args, struct ast_ari_response *response);
#endif /* _ASTERISK_RESOURCE_PLAYBACK_H */
--- /dev/null
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2012 - 2013, Digium, Inc.
+ *
+ * David M. Lee, II <dlee@digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ *
+ * \brief /api-docs/recordings.{format} implementation- Recording resources
+ *
+ * \author David M. Lee, II <dlee@digium.com>
+ */
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include "asterisk/stasis_app_recording.h"
+#include "resource_recordings.h"
+
+void ast_ari_get_stored_recordings(struct ast_variable *headers, struct ast_get_stored_recordings_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_get_stored_recordings\n");
+}
+void ast_ari_get_stored_recording(struct ast_variable *headers, struct ast_get_stored_recording_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_get_stored_recording\n");
+}
+void ast_ari_delete_stored_recording(struct ast_variable *headers, struct ast_delete_stored_recording_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_delete_stored_recording\n");
+}
+void ast_ari_get_live_recordings(struct ast_variable *headers, struct ast_get_live_recordings_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_get_live_recordings\n");
+}
+
+void ast_ari_get_live_recording(struct ast_variable *headers,
+ struct ast_get_live_recording_args *args,
+ struct ast_ari_response *response)
+{
+ RAII_VAR(struct stasis_app_recording *, recording, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
+
+ recording = stasis_app_recording_find_by_name(args->recording_name);
+ if (recording == NULL) {
+ ast_ari_response_error(response, 404, "Not Found",
+ "Recording not found");
+ return;
+ }
+
+ json = stasis_app_recording_to_json(recording);
+ if (json == NULL) {
+ ast_ari_response_error(response, 500,
+ "Internal Server Error", "Error building response");
+ return;
+ }
+
+ ast_ari_response_ok(response, ast_json_ref(json));
+}
+
+void ast_ari_cancel_recording(struct ast_variable *headers, struct ast_cancel_recording_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_cancel_recording\n");
+}
+void ast_ari_stop_recording(struct ast_variable *headers, struct ast_stop_recording_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_stop_recording\n");
+}
+void ast_ari_pause_recording(struct ast_variable *headers, struct ast_pause_recording_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_pause_recording\n");
+}
+void ast_ari_unpause_recording(struct ast_variable *headers, struct ast_unpause_recording_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_unpause_recording\n");
+}
+void ast_ari_mute_recording(struct ast_variable *headers, struct ast_mute_recording_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_mute_recording\n");
+}
+void ast_ari_unmute_recording(struct ast_variable *headers, struct ast_unmute_recording_args *args, struct ast_ari_response *response)
+{
+ ast_log(LOG_ERROR, "TODO: ast_ari_unmute_recording\n");
+}
/*! \file
*
* \brief Generated file - declares stubs to be implemented in
- * res/stasis_http/resource_recordings.c
+ * res/ari/resource_recordings.c
*
* Recording resources
*
* !!!!! DO NOT EDIT !!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This file is generated by a mustache template. Please see the original
- * template in rest-api-templates/stasis_http_resource.h.mustache
+ * template in rest-api-templates/ari_resource.h.mustache
*/
#ifndef _ASTERISK_RESOURCE_RECORDINGS_H
#define _ASTERISK_RESOURCE_RECORDINGS_H
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
-/*! \brief Argument struct for stasis_http_get_stored_recordings() */
+/*! \brief Argument struct for ast_ari_get_stored_recordings() */
struct ast_get_stored_recordings_args {
};
/*!
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_stored_recordings(struct ast_variable *headers, struct ast_get_stored_recordings_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_stored_recording() */
+void ast_ari_get_stored_recordings(struct ast_variable *headers, struct ast_get_stored_recordings_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_stored_recording() */
struct ast_get_stored_recording_args {
/*! \brief The name of the recording */
const char *recording_name;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_stored_recording(struct ast_variable *headers, struct ast_get_stored_recording_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_delete_stored_recording() */
+void ast_ari_get_stored_recording(struct ast_variable *headers, struct ast_get_stored_recording_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_delete_stored_recording() */
struct ast_delete_stored_recording_args {
/*! \brief The name of the recording */
const char *recording_name;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_delete_stored_recording(struct ast_variable *headers, struct ast_delete_stored_recording_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_live_recordings() */
+void ast_ari_delete_stored_recording(struct ast_variable *headers, struct ast_delete_stored_recording_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_live_recordings() */
struct ast_get_live_recordings_args {
};
/*!
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_live_recordings(struct ast_variable *headers, struct ast_get_live_recordings_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_live_recording() */
+void ast_ari_get_live_recordings(struct ast_variable *headers, struct ast_get_live_recordings_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_live_recording() */
struct ast_get_live_recording_args {
/*! \brief The name of the recording */
const char *recording_name;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_live_recording(struct ast_variable *headers, struct ast_get_live_recording_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_cancel_recording() */
+void ast_ari_get_live_recording(struct ast_variable *headers, struct ast_get_live_recording_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_cancel_recording() */
struct ast_cancel_recording_args {
/*! \brief The name of the recording */
const char *recording_name;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_cancel_recording(struct ast_variable *headers, struct ast_cancel_recording_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_stop_recording() */
+void ast_ari_cancel_recording(struct ast_variable *headers, struct ast_cancel_recording_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_stop_recording() */
struct ast_stop_recording_args {
/*! \brief The name of the recording */
const char *recording_name;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_stop_recording(struct ast_variable *headers, struct ast_stop_recording_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_pause_recording() */
+void ast_ari_stop_recording(struct ast_variable *headers, struct ast_stop_recording_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_pause_recording() */
struct ast_pause_recording_args {
/*! \brief The name of the recording */
const char *recording_name;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_pause_recording(struct ast_variable *headers, struct ast_pause_recording_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_unpause_recording() */
+void ast_ari_pause_recording(struct ast_variable *headers, struct ast_pause_recording_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_unpause_recording() */
struct ast_unpause_recording_args {
/*! \brief The name of the recording */
const char *recording_name;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_unpause_recording(struct ast_variable *headers, struct ast_unpause_recording_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_mute_recording() */
+void ast_ari_unpause_recording(struct ast_variable *headers, struct ast_unpause_recording_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_mute_recording() */
struct ast_mute_recording_args {
/*! \brief The name of the recording */
const char *recording_name;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_mute_recording(struct ast_variable *headers, struct ast_mute_recording_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_unmute_recording() */
+void ast_ari_mute_recording(struct ast_variable *headers, struct ast_mute_recording_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_unmute_recording() */
struct ast_unmute_recording_args {
/*! \brief The name of the recording */
const char *recording_name;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_unmute_recording(struct ast_variable *headers, struct ast_unmute_recording_args *args, struct stasis_http_response *response);
+void ast_ari_unmute_recording(struct ast_variable *headers, struct ast_unmute_recording_args *args, struct ast_ari_response *response);
#endif /* _ASTERISK_RESOURCE_RECORDINGS_H */
return 0;
}
-void stasis_http_get_sounds(struct ast_variable *headers, struct ast_get_sounds_args *args, struct stasis_http_response *response)
+void ast_ari_get_sounds(struct ast_variable *headers, struct ast_get_sounds_args *args, struct ast_ari_response *response)
{
RAII_VAR(struct ao2_container *, sound_files, NULL, ao2_cleanup);
struct ast_json *sounds_blob;
RAII_VAR(struct ast_media_index *, sounds_index, ast_sounds_get_index(), ao2_cleanup);
if (!sounds_index) {
- stasis_http_response_error(response, 500, "Internal Error", "Sounds index not available");
+ ast_ari_response_error(response, 500, "Internal Error", "Sounds index not available");
return;
}
sound_files = ast_media_get_media(sounds_index);
if (!sound_files) {
- stasis_http_response_error(response, 500, "Internal Error", "Allocation Error");
+ ast_ari_response_error(response, 500, "Internal Error", "Allocation Error");
return;
}
sounds_blob = ast_json_array_create();
if (!sounds_blob) {
- stasis_http_response_error(response, 500, "Internal Error", "Allocation Error");
+ ast_ari_response_error(response, 500, "Internal Error", "Allocation Error");
return;
}
ao2_callback_data(sound_files, OBJ_NODATA, append_sound_cb, sounds_blob, args);
if (!ast_json_array_size(sounds_blob)) {
- stasis_http_response_error(response, 404, "Not Found", "No sounds found that matched the query");
+ ast_ari_response_error(response, 404, "Not Found", "No sounds found that matched the query");
return;
}
- stasis_http_response_ok(response, sounds_blob);
+ ast_ari_response_ok(response, sounds_blob);
}
-void stasis_http_get_stored_sound(struct ast_variable *headers, struct ast_get_stored_sound_args *args, struct stasis_http_response *response)
+void ast_ari_get_stored_sound(struct ast_variable *headers, struct ast_get_stored_sound_args *args, struct ast_ari_response *response)
{
struct ast_json *sound_blob;
sound_blob = create_sound_blob(args->sound_id, NULL);
if (!sound_blob) {
- stasis_http_response_error(response, 404, "Not Found", "Sound not found");
+ ast_ari_response_error(response, 404, "Not Found", "Sound not found");
return;
}
- stasis_http_response_ok(response, sound_blob);
+ ast_ari_response_ok(response, sound_blob);
}
/*! \file
*
* \brief Generated file - declares stubs to be implemented in
- * res/stasis_http/resource_sounds.c
+ * res/ari/resource_sounds.c
*
* Sound resources
*
* !!!!! DO NOT EDIT !!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* This file is generated by a mustache template. Please see the original
- * template in rest-api-templates/stasis_http_resource.h.mustache
+ * template in rest-api-templates/ari_resource.h.mustache
*/
#ifndef _ASTERISK_RESOURCE_SOUNDS_H
#define _ASTERISK_RESOURCE_SOUNDS_H
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
-/*! \brief Argument struct for stasis_http_get_sounds() */
+/*! \brief Argument struct for ast_ari_get_sounds() */
struct ast_get_sounds_args {
const char *lang;
const char *format;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_sounds(struct ast_variable *headers, struct ast_get_sounds_args *args, struct stasis_http_response *response);
-/*! \brief Argument struct for stasis_http_get_stored_sound() */
+void ast_ari_get_sounds(struct ast_variable *headers, struct ast_get_sounds_args *args, struct ast_ari_response *response);
+/*! \brief Argument struct for ast_ari_get_stored_sound() */
struct ast_get_stored_sound_args {
/*! \brief Sound's id */
const char *sound_id;
* \param args Swagger parameters
* \param[out] response HTTP response
*/
-void stasis_http_get_stored_sound(struct ast_variable *headers, struct ast_get_stored_sound_args *args, struct stasis_http_response *response);
+void ast_ari_get_stored_sound(struct ast_variable *headers, struct ast_get_stored_sound_args *args, struct ast_ari_response *response);
#endif /* _ASTERISK_RESOURCE_SOUNDS_H */
*
* The structure of the generated code is:
*
- * - res/stasis_http/resource_{resource}.h
+ * - res/ari/resource_{resource}.h
* - For each operation in the resouce, a generated argument structure
* (holding the parsed arguments from the request) and function
- * declarations (to implement in res/stasis_http/resource_{resource}.c)
- * - res_stasis_http_{resource}.c
+ * declarations (to implement in res/ari/resource_{resource}.c)
+ * - res_ari_{resource}.c
* - A set of \ref stasis_rest_callback functions, which glue the two
* together. They parse out path variables and request parameters to
* populate a specific \c *_args which is passed to the specific request
- * handler (in res/stasis_http/resource_{resource}.c)
+ * handler (in res/ari/resource_{resource}.c)
* - A tree of \ref stasis_rest_handlers for routing requests to its
* \ref stasis_rest_callback
*
* The basic flow of an HTTP request is:
*
- * - stasis_http_callback()
+ * - ast_ari_callback()
* 1. Initial request validation
- * 2. Routes as either a doc request (stasis_http_get_docs) or API
- * request (stasis_http_invoke)
- * - stasis_http_invoke()
+ * 2. Routes as either a doc request (ast_ari_get_docs) or API
+ * request (ast_ari_invoke)
+ * - ast_ari_invoke()
* 1. Further request validation
* 2. Routes the request through the tree of generated
* \ref stasis_rest_handlers.
* 3. Dispatch to the generated callback
- * - \c stasis_http_*_cb
+ * - \c ast_ari_*_cb
* 1. Populate \c *_args struct with path and get params
* 2. Invoke the request handler
* 3. Validates and sends response
***/
/*** DOCUMENTATION
- <configInfo name="res_stasis_http" language="en_US">
+ <configInfo name="res_ari" language="en_US">
<synopsis>HTTP binding for the Stasis API</synopsis>