Rename everything Stasis-HTTP to ARI
authorKinsey Moore <kmoore@digium.com>
Sat, 27 Jul 2013 23:11:02 +0000 (23:11 +0000)
committerKinsey Moore <kmoore@digium.com>
Sat, 27 Jul 2013 23:11:02 +0000 (23:11 +0000)
This renames all files and API calls from several variants of
Stasis-HTTP to ARI including:
* Stasis-HTTP -> ARI
* STASIS_HTTP -> ARI
* stasis_http -> ari (ast_ari for global symbols, file names as well)
* stasis http -> ARI

Review: https://reviewboard.asterisk.org/r/2706/
(closes issue ASTERISK-22136)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395603 65c4cc65-6c06-0410-ace0-fbb531ad65f3

53 files changed:
configs/ari.conf.sample
include/asterisk/ari.h [moved from include/asterisk/stasis_http.h with 75% similarity]
main/stasis_config.c
res/Makefile
res/ari.make [new file with mode: 0644]
res/ari/ari_model_validators.c [moved from res/stasis_http/ari_model_validators.c with 83% similarity]
res/ari/ari_model_validators.h [moved from res/stasis_http/ari_model_validators.h with 65% similarity]
res/ari/ari_websockets.c [moved from res/stasis_http/ari_websockets.c with 87% similarity]
res/ari/cli.c [moved from res/stasis_http/cli.c with 90% similarity]
res/ari/config.c [moved from res/stasis_http/config.c with 80% similarity]
res/ari/internal.h [moved from res/stasis_http/internal.h with 77% similarity]
res/ari/resource_asterisk.c [moved from res/stasis_http/resource_asterisk.c with 65% similarity]
res/ari/resource_asterisk.h [moved from res/stasis_http/resource_asterisk.h with 72% similarity]
res/ari/resource_bridges.c [moved from res/stasis_http/resource_bridges.c with 79% similarity]
res/ari/resource_bridges.h [moved from res/stasis_http/resource_bridges.h with 71% similarity]
res/ari/resource_channels.c [moved from res/stasis_http/resource_channels.c with 76% similarity]
res/ari/resource_channels.h [moved from res/stasis_http/resource_channels.h with 70% similarity]
res/ari/resource_endpoints.c [moved from res/stasis_http/resource_endpoints.c with 78% similarity]
res/ari/resource_endpoints.h [moved from res/stasis_http/resource_endpoints.h with 71% similarity]
res/ari/resource_events.c [moved from res/stasis_http/resource_events.c with 87% similarity]
res/ari/resource_events.h [moved from res/stasis_http/resource_events.h with 80% similarity]
res/ari/resource_playback.c [moved from res/stasis_http/resource_playback.c with 78% similarity]
res/ari/resource_playback.h [moved from res/stasis_http/resource_playback.h with 72% similarity]
res/ari/resource_recordings.c [new file with mode: 0644]
res/ari/resource_recordings.h [moved from res/stasis_http/resource_recordings.h with 64% similarity]
res/ari/resource_sounds.c [moved from res/stasis_http/resource_sounds.c with 87% similarity]
res/ari/resource_sounds.h [moved from res/stasis_http/resource_sounds.h with 74% similarity]
res/res_ari.c [moved from res/res_stasis_http.c with 89% similarity]
res/res_ari.exports.in [new file with mode: 0644]
res/res_ari_asterisk.c [moved from res/res_stasis_http_asterisk.c with 83% similarity]
res/res_ari_bridges.c [moved from res/res_stasis_http_bridges.c with 84% similarity]
res/res_ari_channels.c [moved from res/res_stasis_http_channels.c with 85% similarity]
res/res_ari_endpoints.c [moved from res/res_stasis_http_endpoints.c with 81% similarity]
res/res_ari_events.c [moved from res/res_stasis_http_events.c with 77% similarity]
res/res_ari_model.c
res/res_ari_model.exports.in
res/res_ari_playback.c [moved from res/res_stasis_http_playback.c with 84% similarity]
res/res_ari_recordings.c [moved from res/res_stasis_http_recordings.c with 82% similarity]
res/res_ari_sounds.c [moved from res/res_stasis_http_sounds.c with 82% similarity]
res/res_stasis_http.exports.in [deleted file]
res/res_statsd.c
res/stasis_http.make [deleted file]
res/stasis_http/resource_recordings.c [deleted file]
rest-api-templates/ari.make.mustache [moved from rest-api-templates/stasis_http.make.mustache with 68% similarity]
rest-api-templates/ari_model_validators.c.mustache
rest-api-templates/ari_model_validators.h.mustache
rest-api-templates/ari_resource.c.mustache [moved from rest-api-templates/stasis_http_resource.c.mustache with 77% similarity]
rest-api-templates/ari_resource.h.mustache [moved from rest-api-templates/stasis_http_resource.h.mustache with 76% similarity]
rest-api-templates/make_ari_stubs.py
rest-api-templates/res_ari_resource.c.mustache [moved from rest-api-templates/res_stasis_http_resource.c.mustache with 77% similarity]
rest-api-templates/rest_handler.mustache
tests/test_ari.c [moved from tests/test_stasis_http.c with 80% similarity]
tests/test_ari_model.c

index 414f89d..decdddc 100644 (file)
@@ -1,6 +1,6 @@
 [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
similarity index 75%
rename from include/asterisk/stasis_http.h
rename to include/asterisk/ari.h
index 8d5a74e..4f29540 100644 (file)
  * 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>
  */
@@ -37,9 +37,9 @@
  * \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.
@@ -51,7 +51,7 @@ struct stasis_http_response;
 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.
@@ -79,7 +79,7 @@ struct stasis_rest_handlers {
 /*!
  * Response type for RESTful requests
  */
-struct stasis_http_response {
+struct ast_ari_response {
        /*! Response message */
        struct ast_json *message;
        /*! \r\n seperated response headers */
@@ -99,7 +99,7 @@ struct stasis_http_response {
  * \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.
@@ -107,13 +107,13 @@ int stasis_http_add_handler(struct stasis_rest_handlers *handler);
  * \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.
@@ -123,26 +123,26 @@ int stasis_http_remove_handler(struct stasis_rest_handlers *handler);
  * \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.
@@ -155,7 +155,7 @@ struct 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 *));
 
 /*!
@@ -165,8 +165,8 @@ struct ari_websocket_session *ari_websocket_session_create(
  * \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.
@@ -176,7 +176,7 @@ struct ast_json *ari_websocket_session_read(
  * \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);
 
 /*!
@@ -187,45 +187,45 @@ int ari_websocket_session_write(struct ari_websocket_session *session,
  *
  * \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 */
index a4ab41a..4906319 100644 (file)
@@ -70,7 +70,7 @@ struct stasis_conf {
        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,
index 588bc2e..616ad4d 100644 (file)
@@ -73,18 +73,18 @@ endif
 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
diff --git a/res/ari.make b/res/ari.make
new file mode 100644 (file)
index 0000000..fa562f1
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# 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)
+
similarity index 83%
rename from res/stasis_http/ari_model_validators.c
rename to res/ari/ari_model_validators.c
index bc5f25a..1894ddb 100644 (file)
@@ -35,7 +35,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #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;
@@ -52,12 +52,12 @@ int ari_validate_asterisk_info(struct ast_json *json)
        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;
@@ -67,7 +67,7 @@ int ari_validate_variable(struct ast_json *json)
                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");
@@ -90,12 +90,12 @@ int ari_validate_variable(struct ast_json *json)
        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;
@@ -107,9 +107,9 @@ int ari_validate_endpoint(struct ast_json *json)
                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;
@@ -118,7 +118,7 @@ int ari_validate_endpoint(struct ast_json *json)
                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");
@@ -127,7 +127,7 @@ int ari_validate_endpoint(struct ast_json *json)
                } 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");
@@ -137,7 +137,7 @@ int ari_validate_endpoint(struct ast_json *json)
                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");
@@ -170,12 +170,12 @@ int ari_validate_endpoint(struct ast_json *json)
        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;
@@ -186,7 +186,7 @@ int ari_validate_caller_id(struct ast_json *json)
                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");
@@ -196,7 +196,7 @@ int ari_validate_caller_id(struct ast_json *json)
                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");
@@ -224,12 +224,12 @@ int ari_validate_caller_id(struct ast_json *json)
        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;
@@ -246,7 +246,7 @@ int ari_validate_channel(struct ast_json *json)
                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");
@@ -256,7 +256,7 @@ int ari_validate_channel(struct ast_json *json)
                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");
@@ -266,7 +266,7 @@ int ari_validate_channel(struct ast_json *json)
                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");
@@ -276,7 +276,7 @@ int ari_validate_channel(struct ast_json *json)
                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");
@@ -286,7 +286,7 @@ int ari_validate_channel(struct ast_json *json)
                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");
@@ -296,7 +296,7 @@ int ari_validate_channel(struct ast_json *json)
                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");
@@ -306,7 +306,7 @@ int ari_validate_channel(struct ast_json *json)
                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");
@@ -316,7 +316,7 @@ int ari_validate_channel(struct ast_json *json)
                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");
@@ -374,12 +374,12 @@ int ari_validate_channel(struct ast_json *json)
        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;
@@ -396,12 +396,12 @@ int ari_validate_dialed(struct ast_json *json)
        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;
@@ -413,7 +413,7 @@ int ari_validate_dialplan_cep(struct ast_json *json)
                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");
@@ -423,7 +423,7 @@ int ari_validate_dialplan_cep(struct ast_json *json)
                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");
@@ -433,7 +433,7 @@ int ari_validate_dialplan_cep(struct ast_json *json)
                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");
@@ -466,12 +466,12 @@ int ari_validate_dialplan_cep(struct ast_json *json)
        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;
@@ -485,7 +485,7 @@ int ari_validate_bridge(struct ast_json *json)
                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");
@@ -495,7 +495,7 @@ int ari_validate_bridge(struct ast_json *json)
                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");
@@ -505,9 +505,9 @@ int ari_validate_bridge(struct ast_json *json)
                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;
@@ -516,7 +516,7 @@ int ari_validate_bridge(struct ast_json *json)
                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");
@@ -526,7 +526,7 @@ int ari_validate_bridge(struct ast_json *json)
                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");
@@ -569,12 +569,12 @@ int ari_validate_bridge(struct ast_json *json)
        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;
@@ -586,7 +586,7 @@ int ari_validate_live_recording(struct ast_json *json)
                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");
@@ -596,7 +596,7 @@ int ari_validate_live_recording(struct ast_json *json)
                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");
@@ -606,7 +606,7 @@ int ari_validate_live_recording(struct ast_json *json)
                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");
@@ -639,12 +639,12 @@ int ari_validate_live_recording(struct ast_json *json)
        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;
@@ -654,7 +654,7 @@ int ari_validate_stored_recording(struct ast_json *json)
        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");
@@ -664,9 +664,9 @@ int ari_validate_stored_recording(struct ast_json *json)
                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;
@@ -675,7 +675,7 @@ int ari_validate_stored_recording(struct ast_json *json)
                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");
@@ -684,7 +684,7 @@ int ari_validate_stored_recording(struct ast_json *json)
                } 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");
@@ -712,12 +712,12 @@ int ari_validate_stored_recording(struct ast_json *json)
        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;
@@ -728,7 +728,7 @@ int ari_validate_format_lang_pair(struct ast_json *json)
                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");
@@ -738,7 +738,7 @@ int ari_validate_format_lang_pair(struct ast_json *json)
                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");
@@ -766,12 +766,12 @@ int ari_validate_format_lang_pair(struct ast_json *json)
        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;
@@ -782,9 +782,9 @@ int ari_validate_sound(struct ast_json *json)
                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;
@@ -793,7 +793,7 @@ int ari_validate_sound(struct ast_json *json)
                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");
@@ -802,7 +802,7 @@ int ari_validate_sound(struct ast_json *json)
                } 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");
@@ -830,12 +830,12 @@ int ari_validate_sound(struct ast_json *json)
        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;
@@ -848,7 +848,7 @@ int ari_validate_playback(struct ast_json *json)
                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");
@@ -857,7 +857,7 @@ int ari_validate_playback(struct ast_json *json)
                } 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");
@@ -867,7 +867,7 @@ int ari_validate_playback(struct ast_json *json)
                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");
@@ -877,7 +877,7 @@ int ari_validate_playback(struct ast_json *json)
                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");
@@ -887,7 +887,7 @@ int ari_validate_playback(struct ast_json *json)
                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");
@@ -925,12 +925,12 @@ int ari_validate_playback(struct ast_json *json)
        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;
@@ -941,7 +941,7 @@ int ari_validate_application_replaced(struct ast_json *json)
                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");
@@ -951,7 +951,7 @@ int ari_validate_application_replaced(struct ast_json *json)
                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");
@@ -960,7 +960,7 @@ int ari_validate_application_replaced(struct ast_json *json)
                } 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");
@@ -988,12 +988,12 @@ int ari_validate_application_replaced(struct ast_json *json)
        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;
@@ -1005,7 +1005,7 @@ int ari_validate_bridge_created(struct ast_json *json)
                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");
@@ -1015,7 +1015,7 @@ int ari_validate_bridge_created(struct ast_json *json)
                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");
@@ -1024,7 +1024,7 @@ int ari_validate_bridge_created(struct ast_json *json)
                } 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");
@@ -1034,7 +1034,7 @@ int ari_validate_bridge_created(struct ast_json *json)
                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");
@@ -1067,12 +1067,12 @@ int ari_validate_bridge_created(struct ast_json *json)
        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;
@@ -1084,7 +1084,7 @@ int ari_validate_bridge_destroyed(struct ast_json *json)
                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");
@@ -1094,7 +1094,7 @@ int ari_validate_bridge_destroyed(struct ast_json *json)
                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");
@@ -1103,7 +1103,7 @@ int ari_validate_bridge_destroyed(struct ast_json *json)
                } 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");
@@ -1113,7 +1113,7 @@ int ari_validate_bridge_destroyed(struct ast_json *json)
                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");
@@ -1146,12 +1146,12 @@ int ari_validate_bridge_destroyed(struct ast_json *json)
        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;
@@ -1164,7 +1164,7 @@ int ari_validate_bridge_merged(struct ast_json *json)
                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");
@@ -1174,7 +1174,7 @@ int ari_validate_bridge_merged(struct ast_json *json)
                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");
@@ -1183,7 +1183,7 @@ int ari_validate_bridge_merged(struct ast_json *json)
                } 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");
@@ -1193,7 +1193,7 @@ int ari_validate_bridge_merged(struct ast_json *json)
                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");
@@ -1203,7 +1203,7 @@ int ari_validate_bridge_merged(struct ast_json *json)
                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");
@@ -1241,12 +1241,12 @@ int ari_validate_bridge_merged(struct ast_json *json)
        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;
@@ -1260,7 +1260,7 @@ int ari_validate_channel_caller_id(struct ast_json *json)
                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");
@@ -1270,7 +1270,7 @@ int ari_validate_channel_caller_id(struct ast_json *json)
                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");
@@ -1279,7 +1279,7 @@ int ari_validate_channel_caller_id(struct ast_json *json)
                } 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");
@@ -1289,7 +1289,7 @@ int ari_validate_channel_caller_id(struct ast_json *json)
                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");
@@ -1299,7 +1299,7 @@ int ari_validate_channel_caller_id(struct ast_json *json)
                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");
@@ -1309,7 +1309,7 @@ int ari_validate_channel_caller_id(struct ast_json *json)
                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");
@@ -1352,12 +1352,12 @@ int ari_validate_channel_caller_id(struct ast_json *json)
        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;
@@ -1369,7 +1369,7 @@ int ari_validate_channel_created(struct ast_json *json)
                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");
@@ -1379,7 +1379,7 @@ int ari_validate_channel_created(struct ast_json *json)
                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");
@@ -1388,7 +1388,7 @@ int ari_validate_channel_created(struct ast_json *json)
                } 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");
@@ -1398,7 +1398,7 @@ int ari_validate_channel_created(struct ast_json *json)
                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");
@@ -1431,12 +1431,12 @@ int ari_validate_channel_created(struct ast_json *json)
        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;
@@ -1450,7 +1450,7 @@ int ari_validate_channel_destroyed(struct ast_json *json)
                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");
@@ -1460,7 +1460,7 @@ int ari_validate_channel_destroyed(struct ast_json *json)
                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");
@@ -1469,7 +1469,7 @@ int ari_validate_channel_destroyed(struct ast_json *json)
                } 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");
@@ -1479,7 +1479,7 @@ int ari_validate_channel_destroyed(struct ast_json *json)
                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");
@@ -1489,7 +1489,7 @@ int ari_validate_channel_destroyed(struct ast_json *json)
                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");
@@ -1499,7 +1499,7 @@ int ari_validate_channel_destroyed(struct ast_json *json)
                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");
@@ -1542,12 +1542,12 @@ int ari_validate_channel_destroyed(struct ast_json *json)
        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;
@@ -1561,7 +1561,7 @@ int ari_validate_channel_dialplan(struct ast_json *json)
                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");
@@ -1571,7 +1571,7 @@ int ari_validate_channel_dialplan(struct ast_json *json)
                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");
@@ -1580,7 +1580,7 @@ int ari_validate_channel_dialplan(struct ast_json *json)
                } 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");
@@ -1590,7 +1590,7 @@ int ari_validate_channel_dialplan(struct ast_json *json)
                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");
@@ -1600,7 +1600,7 @@ int ari_validate_channel_dialplan(struct ast_json *json)
                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");
@@ -1610,7 +1610,7 @@ int ari_validate_channel_dialplan(struct ast_json *json)
                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");
@@ -1653,12 +1653,12 @@ int ari_validate_channel_dialplan(struct ast_json *json)
        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;
@@ -1672,7 +1672,7 @@ int ari_validate_channel_dtmf_received(struct ast_json *json)
                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");
@@ -1682,7 +1682,7 @@ int ari_validate_channel_dtmf_received(struct ast_json *json)
                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");
@@ -1691,7 +1691,7 @@ int ari_validate_channel_dtmf_received(struct ast_json *json)
                } 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");
@@ -1701,7 +1701,7 @@ int ari_validate_channel_dtmf_received(struct ast_json *json)
                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");
@@ -1711,7 +1711,7 @@ int ari_validate_channel_dtmf_received(struct ast_json *json)
                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");
@@ -1721,7 +1721,7 @@ int ari_validate_channel_dtmf_received(struct ast_json *json)
                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");
@@ -1764,12 +1764,12 @@ int ari_validate_channel_dtmf_received(struct ast_json *json)
        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;
@@ -1781,7 +1781,7 @@ int ari_validate_channel_entered_bridge(struct ast_json *json)
                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");
@@ -1791,7 +1791,7 @@ int ari_validate_channel_entered_bridge(struct ast_json *json)
                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");
@@ -1800,7 +1800,7 @@ int ari_validate_channel_entered_bridge(struct ast_json *json)
                } 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");
@@ -1810,7 +1810,7 @@ int ari_validate_channel_entered_bridge(struct ast_json *json)
                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");
@@ -1819,7 +1819,7 @@ int ari_validate_channel_entered_bridge(struct ast_json *json)
                } 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");
@@ -1852,12 +1852,12 @@ int ari_validate_channel_entered_bridge(struct ast_json *json)
        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;
@@ -1869,7 +1869,7 @@ int ari_validate_channel_hangup_request(struct ast_json *json)
                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");
@@ -1879,7 +1879,7 @@ int ari_validate_channel_hangup_request(struct ast_json *json)
                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");
@@ -1888,7 +1888,7 @@ int ari_validate_channel_hangup_request(struct ast_json *json)
                } 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");
@@ -1897,7 +1897,7 @@ int ari_validate_channel_hangup_request(struct ast_json *json)
                } 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");
@@ -1907,7 +1907,7 @@ int ari_validate_channel_hangup_request(struct ast_json *json)
                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");
@@ -1916,7 +1916,7 @@ int ari_validate_channel_hangup_request(struct ast_json *json)
                } 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");
@@ -1949,12 +1949,12 @@ int ari_validate_channel_hangup_request(struct ast_json *json)
        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;
@@ -1967,7 +1967,7 @@ int ari_validate_channel_left_bridge(struct ast_json *json)
                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");
@@ -1977,7 +1977,7 @@ int ari_validate_channel_left_bridge(struct ast_json *json)
                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");
@@ -1986,7 +1986,7 @@ int ari_validate_channel_left_bridge(struct ast_json *json)
                } 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");
@@ -1996,7 +1996,7 @@ int ari_validate_channel_left_bridge(struct ast_json *json)
                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");
@@ -2006,7 +2006,7 @@ int ari_validate_channel_left_bridge(struct ast_json *json)
                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");
@@ -2044,12 +2044,12 @@ int ari_validate_channel_left_bridge(struct ast_json *json)
        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;
@@ -2061,7 +2061,7 @@ int ari_validate_channel_state_change(struct ast_json *json)
                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");
@@ -2071,7 +2071,7 @@ int ari_validate_channel_state_change(struct ast_json *json)
                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");
@@ -2080,7 +2080,7 @@ int ari_validate_channel_state_change(struct ast_json *json)
                } 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");
@@ -2090,7 +2090,7 @@ int ari_validate_channel_state_change(struct ast_json *json)
                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");
@@ -2123,12 +2123,12 @@ int ari_validate_channel_state_change(struct ast_json *json)
        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;
@@ -2141,7 +2141,7 @@ int ari_validate_channel_userevent(struct ast_json *json)
                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");
@@ -2151,7 +2151,7 @@ int ari_validate_channel_userevent(struct ast_json *json)
                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");
@@ -2160,7 +2160,7 @@ int ari_validate_channel_userevent(struct ast_json *json)
                } 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");
@@ -2170,7 +2170,7 @@ int ari_validate_channel_userevent(struct ast_json *json)
                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");
@@ -2180,7 +2180,7 @@ int ari_validate_channel_userevent(struct ast_json *json)
                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");
@@ -2218,12 +2218,12 @@ int ari_validate_channel_userevent(struct ast_json *json)
        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;
@@ -2236,7 +2236,7 @@ int ari_validate_channel_varset(struct ast_json *json)
                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");
@@ -2246,7 +2246,7 @@ int ari_validate_channel_varset(struct ast_json *json)
                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");
@@ -2255,7 +2255,7 @@ int ari_validate_channel_varset(struct ast_json *json)
                } 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");
@@ -2264,7 +2264,7 @@ int ari_validate_channel_varset(struct ast_json *json)
                } 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");
@@ -2274,7 +2274,7 @@ int ari_validate_channel_varset(struct ast_json *json)
                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");
@@ -2284,7 +2284,7 @@ int ari_validate_channel_varset(struct ast_json *json)
                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");
@@ -2322,12 +2322,12 @@ int ari_validate_channel_varset(struct ast_json *json)
        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;
@@ -2345,61 +2345,61 @@ int ari_validate_event(struct ast_json *json)
                /* 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",
@@ -2411,7 +2411,7 @@ int ari_validate_event(struct ast_json *json)
                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");
@@ -2421,7 +2421,7 @@ int ari_validate_event(struct ast_json *json)
                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");
@@ -2430,7 +2430,7 @@ int ari_validate_event(struct ast_json *json)
                } 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");
@@ -2458,12 +2458,12 @@ int ari_validate_event(struct ast_json *json)
        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;
@@ -2480,67 +2480,67 @@ int ari_validate_message(struct ast_json *json)
                /* 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",
@@ -2552,7 +2552,7 @@ int ari_validate_message(struct ast_json *json)
                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");
@@ -2575,12 +2575,12 @@ int ari_validate_message(struct ast_json *json)
        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;
@@ -2591,7 +2591,7 @@ int ari_validate_missing_params(struct ast_json *json)
                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");
@@ -2601,9 +2601,9 @@ int ari_validate_missing_params(struct ast_json *json)
                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;
@@ -2630,12 +2630,12 @@ int ari_validate_missing_params(struct ast_json *json)
        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;
@@ -2647,7 +2647,7 @@ int ari_validate_playback_finished(struct ast_json *json)
                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");
@@ -2657,7 +2657,7 @@ int ari_validate_playback_finished(struct ast_json *json)
                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");
@@ -2666,7 +2666,7 @@ int ari_validate_playback_finished(struct ast_json *json)
                } 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");
@@ -2676,7 +2676,7 @@ int ari_validate_playback_finished(struct ast_json *json)
                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");
@@ -2709,12 +2709,12 @@ int ari_validate_playback_finished(struct ast_json *json)
        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;
@@ -2726,7 +2726,7 @@ int ari_validate_playback_started(struct ast_json *json)
                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");
@@ -2736,7 +2736,7 @@ int ari_validate_playback_started(struct ast_json *json)
                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");
@@ -2745,7 +2745,7 @@ int ari_validate_playback_started(struct ast_json *json)
                } 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");
@@ -2755,7 +2755,7 @@ int ari_validate_playback_started(struct ast_json *json)
                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");
@@ -2788,12 +2788,12 @@ int ari_validate_playback_started(struct ast_json *json)
        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;
@@ -2805,7 +2805,7 @@ int ari_validate_stasis_end(struct ast_json *json)
                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");
@@ -2815,7 +2815,7 @@ int ari_validate_stasis_end(struct ast_json *json)
                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");
@@ -2824,7 +2824,7 @@ int ari_validate_stasis_end(struct ast_json *json)
                } 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");
@@ -2834,7 +2834,7 @@ int ari_validate_stasis_end(struct ast_json *json)
                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");
@@ -2867,12 +2867,12 @@ int ari_validate_stasis_end(struct ast_json *json)
        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;
@@ -2885,7 +2885,7 @@ int ari_validate_stasis_start(struct ast_json *json)
                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");
@@ -2895,7 +2895,7 @@ int ari_validate_stasis_start(struct ast_json *json)
                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");
@@ -2904,7 +2904,7 @@ int ari_validate_stasis_start(struct ast_json *json)
                } 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");
@@ -2914,9 +2914,9 @@ int ari_validate_stasis_start(struct ast_json *json)
                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;
@@ -2925,7 +2925,7 @@ int ari_validate_stasis_start(struct ast_json *json)
                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");
@@ -2963,7 +2963,7 @@ int ari_validate_stasis_start(struct ast_json *json)
        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;
 }
similarity index 65%
rename from res/stasis_http/ari_model_validators.h
rename to res/ari/ari_model_validators.h
index 3cf6300..c5e74d2 100644 (file)
@@ -19,7 +19,7 @@
  * \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
@@ -52,7 +52,7 @@
  * \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.
@@ -61,7 +61,7 @@ int ari_validate_void(struct ast_json *json);
  * \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.
@@ -70,7 +70,7 @@ int ari_validate_byte(struct ast_json *json);
  * \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.
@@ -79,7 +79,7 @@ int ari_validate_boolean(struct ast_json *json);
  * \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.
@@ -88,7 +88,7 @@ int ari_validate_int(struct ast_json *json);
  * \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.
@@ -97,7 +97,7 @@ int ari_validate_long(struct ast_json *json);
  * \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.
@@ -106,7 +106,7 @@ int ari_validate_float(struct ast_json *json);
  * \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.
@@ -115,7 +115,7 @@ int ari_validate_double(struct ast_json *json);
  * \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.
@@ -124,7 +124,7 @@ int ari_validate_string(struct ast_json *json);
  * \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.
@@ -134,7 +134,7 @@ int ari_validate_date(struct ast_json *json);
  * \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 *));
 
 /*! @} */
 
@@ -152,14 +152,14 @@ typedef int (*ari_validator)(struct ast_json *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.
@@ -170,14 +170,14 @@ ari_validator ari_validate_asterisk_info_fn(void);
  * \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.
@@ -190,14 +190,14 @@ ari_validator ari_validate_variable_fn(void);
  * \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.
@@ -208,14 +208,14 @@ ari_validator ari_validate_endpoint_fn(void);
  * \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.
@@ -226,14 +226,14 @@ ari_validator ari_validate_caller_id_fn(void);
  * \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.
@@ -244,14 +244,14 @@ ari_validator ari_validate_channel_fn(void);
  * \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.
@@ -262,14 +262,14 @@ ari_validator ari_validate_dialed_fn(void);
  * \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.
@@ -282,14 +282,14 @@ ari_validator ari_validate_dialplan_cep_fn(void);
  * \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.
@@ -300,14 +300,14 @@ ari_validator ari_validate_bridge_fn(void);
  * \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.
@@ -318,14 +318,14 @@ ari_validator ari_validate_live_recording_fn(void);
  * \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.
@@ -336,14 +336,14 @@ ari_validator ari_validate_stored_recording_fn(void);
  * \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.
@@ -354,14 +354,14 @@ ari_validator ari_validate_format_lang_pair_fn(void);
  * \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.
@@ -372,14 +372,14 @@ ari_validator ari_validate_sound_fn(void);
  * \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.
@@ -392,14 +392,14 @@ ari_validator ari_validate_playback_fn(void);
  * \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.
@@ -410,14 +410,14 @@ ari_validator ari_validate_application_replaced_fn(void);
  * \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.
@@ -428,14 +428,14 @@ ari_validator ari_validate_bridge_created_fn(void);
  * \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.
@@ -446,14 +446,14 @@ ari_validator ari_validate_bridge_destroyed_fn(void);
  * \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.
@@ -464,14 +464,14 @@ ari_validator ari_validate_bridge_merged_fn(void);
  * \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.
@@ -482,14 +482,14 @@ ari_validator ari_validate_channel_caller_id_fn(void);
  * \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.
@@ -500,14 +500,14 @@ ari_validator ari_validate_channel_created_fn(void);
  * \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.
@@ -518,14 +518,14 @@ ari_validator ari_validate_channel_destroyed_fn(void);
  * \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.
@@ -538,14 +538,14 @@ ari_validator ari_validate_channel_dialplan_fn(void);
  * \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.
@@ -556,14 +556,14 @@ ari_validator ari_validate_channel_dtmf_received_fn(void);
  * \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.
@@ -574,14 +574,14 @@ ari_validator ari_validate_channel_entered_bridge_fn(void);
  * \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.
@@ -592,14 +592,14 @@ ari_validator ari_validate_channel_hangup_request_fn(void);
  * \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.
@@ -610,14 +610,14 @@ ari_validator ari_validate_channel_left_bridge_fn(void);
  * \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.
@@ -628,14 +628,14 @@ ari_validator ari_validate_channel_state_change_fn(void);
  * \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.
@@ -646,14 +646,14 @@ ari_validator ari_validate_channel_userevent_fn(void);
  * \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.
@@ -664,14 +664,14 @@ ari_validator ari_validate_channel_varset_fn(void);
  * \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.
@@ -682,14 +682,14 @@ ari_validator ari_validate_event_fn(void);
  * \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.
@@ -700,14 +700,14 @@ ari_validator ari_validate_message_fn(void);
  * \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.
@@ -718,14 +718,14 @@ ari_validator ari_validate_missing_params_fn(void);
  * \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.
@@ -736,14 +736,14 @@ ari_validator ari_validate_playback_finished_fn(void);
  * \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.
@@ -754,14 +754,14 @@ ari_validator ari_validate_playback_started_fn(void);
  * \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.
@@ -772,14 +772,14 @@ ari_validator ari_validate_stasis_end_fn(void);
  * \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
similarity index 87%
rename from res/stasis_http/ari_websockets.c
rename to res/ari/ari_websockets.c
index c67ace5..13650c2 100644 (file)
@@ -21,7 +21,7 @@
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "asterisk/astobj2.h"
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
 
 /*! \file
  *
@@ -29,14 +29,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  * \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;
@@ -50,10 +50,10 @@ static int null_validator(struct ast_json *json)
        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;
@@ -83,8 +83,8 @@ struct ari_websocket_session *ari_websocket_session_create(
        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);
 
@@ -139,7 +139,7 @@ struct ast_json *ari_websocket_session_read(
        "  \"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);
@@ -153,7 +153,7 @@ int ari_websocket_session_write(struct ari_websocket_session *session,
        }
 #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");
similarity index 90%
rename from res/stasis_http/cli.c
rename to res/ari/cli.c
index ac974dc..8194079 100644 (file)
@@ -32,7 +32,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 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:
@@ -51,7 +51,7 @@ static char *ari_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
                return CLI_SHOWUSAGE;
        }
 
-       conf = ari_config_get();
+       conf = ast_ari_config_get();
 
        if (!conf) {
                ast_cli(a->fd, "Error getting ARI configuration\n");
@@ -78,7 +78,7 @@ static char *ari_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 
 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",
@@ -90,7 +90,7 @@ static int show_users_cb(void *obj, void *arg, int flags)
 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:
@@ -109,7 +109,7 @@ static char *ari_show_users(struct ast_cli_entry *e, int cmd,
                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;
@@ -142,14 +142,14 @@ static int complete_ari_user_search(void *obj, void *arg, void *data, int flags)
 
 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;
@@ -173,8 +173,8 @@ static char *complete_ari_show_user(struct ast_cli_args *a)
 
 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:
@@ -193,7 +193,7 @@ static char *ari_show_user(struct ast_cli_entry *e, int cmd, struct ast_cli_args
                return CLI_SHOWUSAGE;
        }
 
-       conf = ari_config_get();
+       conf = ast_ari_config_get();
 
        if (!conf) {
                ast_cli(a->fd, "Error getting ARI configuration\n");
@@ -258,10 +258,10 @@ static struct ast_cli_entry cli_ari[] = {
        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));
 }
similarity index 80%
rename from res/stasis_http/config.c
rename to res/ari/config.c
index 7ccfe8e..e25fa8a 100644 (file)
@@ -32,12 +32,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 /*! \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,
 };
@@ -48,7 +48,7 @@ static struct aco_type *general_options[] = ACO_TYPES(&general_option);
 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) ?
@@ -60,11 +60,11 @@ static int encoding_format_handler(const struct aco_option *opt,
        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;
@@ -77,18 +77,18 @@ static int password_format_handler(const struct aco_option *opt,
        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;
@@ -114,7 +114,7 @@ static void *user_alloc(const char *cat)
 /*! \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;
@@ -124,7 +124,7 @@ static int user_sort_cmp(const void *obj_left, const void *obj_right, int flags)
                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);
        }
@@ -149,15 +149,15 @@ static struct aco_type user_option = {
        .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);
 
@@ -165,10 +165,10 @@ static void conf_destructor(void *obj)
        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);
@@ -207,9 +207,9 @@ static struct aco_file conf_file = {
 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");
@@ -217,14 +217,14 @@ struct ari_conf *ari_config_get(void)
        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;
        }
@@ -261,7 +261,7 @@ struct ari_conf_user *ari_config_validate_user(const char *username,
 /*! \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",
@@ -274,7 +274,7 @@ static int validate_user_cb(void *obj, void *arg, int flags)
 /*! \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:
@@ -284,7 +284,7 @@ static int process_config(int reload)
                break;
        }
 
-       conf = ari_config_get();
+       conf = ast_ari_config_get();
        if (!conf) {
                ast_assert(0); /* We just configured; it should be there */
                return -1;
@@ -299,7 +299,7 @@ static int process_config(int reload)
        return 0;
 }
 
-int ari_config_init(void)
+int ast_ari_config_init(void)
 {
        if (aco_info_init(&cfg_info)) {
                aco_info_destroy(&cfg_info);
@@ -308,37 +308,37 @@ int ari_config_init(void)
 
        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);
similarity index 77%
rename from res/stasis_http/internal.h
rename to res/ari/internal.h
index 7cc67cf..ffacd49 100644 (file)
  * 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;
 };
@@ -59,8 +59,8 @@ struct ari_conf {
 /*! 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). */
@@ -74,7 +74,7 @@ struct ari_conf_general {
 };
 
 /*! \brief Password format */
-enum ari_password_format {
+enum ast_ari_password_format {
        /*! \brief Plaintext password */
        ARI_PASSWORD_FORMAT_PLAIN,
        /*! crypt(3) password */
@@ -89,13 +89,13 @@ enum ari_password_format {
 #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;
 };
@@ -103,17 +103,17 @@ struct ari_conf_user {
 /*!
  * \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.
@@ -124,7 +124,7 @@ void ari_config_destroy(void);
  * \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.
@@ -134,10 +134,10 @@ struct ari_conf *ari_config_get(void);
  * \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_ */
similarity index 65%
rename from res/stasis_http/resource_asterisk.c
rename to res/ari/resource_asterisk.c
index c2a0bc0..dac4571 100644 (file)
@@ -18,7 +18,7 @@
 
 /*! \file
  *
- * \brief Implementation for stasis-http stubs.
+ * \brief Implementation for ARI stubs.
  *
  * \author David M. Lee, II <dlee@digium.com>
  */
@@ -34,12 +34,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #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);
@@ -49,26 +49,26 @@ void stasis_http_get_global_var(struct ast_variable *headers, struct ast_get_glo
        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;
@@ -76,5 +76,5 @@ void stasis_http_set_global_var(struct ast_variable *headers, struct ast_set_glo
 
        pbx_builtin_setvar_helper(NULL, args->variable, args->value);
 
-       stasis_http_response_no_content(response);
+       ast_ari_response_no_content(response);
 }
similarity index 72%
rename from res/stasis_http/resource_asterisk.h
rename to res/ari/resource_asterisk.h
index e32e919..6953952 100644 (file)
@@ -19,7 +19,7 @@
 /*! \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;
@@ -51,8 +51,8 @@ struct ast_get_asterisk_info_args {
  * \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;
@@ -64,8 +64,8 @@ struct ast_get_global_var_args {
  * \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;
@@ -79,6 +79,6 @@ struct ast_set_global_var_args {
  * \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 */
similarity index 79%
rename from res/stasis_http/resource_bridges.c
rename to res/ari/resource_bridges.c
index 42ef0c3..17a8bb1 100644 (file)
@@ -18,7 +18,7 @@
 
 /*! \file
  *
- * \brief Implementation for stasis-http stubs.
+ * \brief Implementation for ARI stubs.
  *
  * \author David M. Lee, II <dlee@digium.com>
  */
@@ -54,7 +54,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  * \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);
@@ -66,12 +66,12 @@ static struct ast_bridge *find_bridge(
                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;
        }
@@ -89,7 +89,7 @@ static struct ast_bridge *find_bridge(
  * \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);
@@ -98,7 +98,7 @@ static struct stasis_app_control *find_channel_control(
 
        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;
        }
@@ -107,7 +107,7 @@ static struct stasis_app_control *find_channel_control(
        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);
@@ -121,10 +121,10 @@ void stasis_http_add_channel_to_bridge(struct ast_variable *headers, struct ast_
        }
 
        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);
@@ -142,12 +142,12 @@ void stasis_http_remove_channel_from_bridge(struct ast_variable *headers, struct
         * 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 {
@@ -196,7 +196,7 @@ static struct ast_channel *prepare_bridge_media_channel(const char *type)
        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);
@@ -217,27 +217,27 @@ void stasis_http_play_on_bridge(struct ast_variable *headers, struct ast_play_on
        }
 
        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;
        }
@@ -249,7 +249,7 @@ void stasis_http_play_on_bridge(struct ast_variable *headers, struct ast_play_on
                args->offsetms);
 
        if (!playback) {
-               stasis_http_response_alloc_failed(response);
+               ast_ari_response_alloc_failed(response);
                return;
        }
 
@@ -257,20 +257,20 @@ void stasis_http_play_on_bridge(struct ast_variable *headers, struct ast_play_on
                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;
        }
 
@@ -278,7 +278,7 @@ void stasis_http_play_on_bridge(struct ast_variable *headers, struct ast_play_on
        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;
        }
@@ -287,10 +287,10 @@ void stasis_http_play_on_bridge(struct ast_variable *headers, struct ast_play_on
        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);
@@ -312,26 +312,26 @@ void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_b
        }
 
        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;
        }
 
@@ -350,20 +350,20 @@ void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_b
                        /* 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;
@@ -371,7 +371,7 @@ void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_b
                        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;
@@ -382,26 +382,26 @@ void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_b
        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;
        }
 
@@ -409,7 +409,7 @@ void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_b
        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;
        }
@@ -418,24 +418,24 @@ void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_b
        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) {
@@ -443,10 +443,10 @@ void stasis_http_delete_bridge(struct ast_variable *headers, struct ast_delete_b
        }
 
        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);
@@ -456,7 +456,7 @@ void stasis_http_get_bridges(struct ast_variable *headers, struct ast_get_bridge
 
        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;
@@ -465,13 +465,13 @@ void stasis_http_get_bridges(struct ast_variable *headers, struct ast_get_bridge
 
        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;
        }
 
@@ -480,22 +480,22 @@ void stasis_http_get_bridges(struct ast_variable *headers, struct ast_get_bridge
                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;
@@ -503,12 +503,12 @@ void stasis_http_new_bridge(struct ast_variable *headers, struct ast_new_bridge_
 
        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));
 }
similarity index 71%
rename from res/stasis_http/resource_bridges.h
rename to res/ari/resource_bridges.h
index 3935a11..892a3f2 100644 (file)
@@ -19,7 +19,7 @@
 /*! \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 {
 };
 /*!
@@ -49,8 +49,8 @@ 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;
@@ -64,8 +64,8 @@ struct ast_new_bridge_args {
  * \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;
@@ -77,8 +77,8 @@ struct ast_get_bridge_args {
  * \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;
@@ -92,8 +92,8 @@ struct ast_delete_bridge_args {
  * \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;
@@ -107,8 +107,8 @@ struct ast_add_channel_to_bridge_args {
  * \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;
@@ -122,8 +122,8 @@ struct ast_remove_channel_from_bridge_args {
  * \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;
@@ -145,8 +145,8 @@ struct ast_play_on_bridge_args {
  * \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;
@@ -174,6 +174,6 @@ struct ast_record_bridge_args {
  * \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 */
similarity index 76%
rename from res/stasis_http/resource_channels.c
rename to res/ari/resource_channels.c
index 592cd6d..7f3a91f 100644 (file)
@@ -18,7 +18,7 @@
 
 /*! \file
  *
- * \brief Implementation for stasis-http stubs.
+ * \brief Implementation for ARI stubs.
  *
  * \author David M. Lee, II <dlee@digium.com>
  */
@@ -54,7 +54,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  * \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);
@@ -67,12 +67,12 @@ static struct stasis_app_control *find_control(
                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;
        }
@@ -81,7 +81,7 @@ static struct stasis_app_control *find_control(
        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;
 
@@ -91,17 +91,17 @@ void stasis_http_dial(struct ast_variable *headers, struct ast_dial_args *args,
        }
 
        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);
 
@@ -113,16 +113,16 @@ void stasis_http_continue_in_dialplan(
        }
 
        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);
 
@@ -132,16 +132,16 @@ void stasis_http_answer_channel(struct ast_variable *headers,
        }
 
        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;
@@ -159,7 +159,7 @@ void stasis_http_mute_channel(struct ast_variable *headers, struct ast_mute_chan
        } 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;
@@ -167,10 +167,10 @@ void stasis_http_mute_channel(struct ast_variable *headers, struct ast_mute_chan
 
        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;
@@ -188,7 +188,7 @@ void stasis_http_unmute_channel(struct ast_variable *headers, struct ast_unmute_
        } 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;
@@ -196,10 +196,10 @@ void stasis_http_unmute_channel(struct ast_variable *headers, struct ast_unmute_
 
        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);
 
@@ -211,10 +211,10 @@ void stasis_http_hold_channel(struct ast_variable *headers, struct ast_hold_chan
 
        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);
 
@@ -226,10 +226,10 @@ void stasis_http_unhold_channel(struct ast_variable *headers, struct ast_unhold_
 
        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);
 
@@ -240,10 +240,10 @@ void stasis_http_moh_start_channel(struct ast_variable *headers, struct ast_moh_
        }
 
        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);
 
@@ -254,12 +254,12 @@ void stasis_http_moh_stop_channel(struct ast_variable *headers, struct ast_moh_s
        }
 
        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);
@@ -278,21 +278,21 @@ void stasis_http_play_on_channel(struct ast_variable *headers,
 
        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;
@@ -303,7 +303,7 @@ void stasis_http_play_on_channel(struct ast_variable *headers,
        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;
@@ -312,7 +312,7 @@ void stasis_http_play_on_channel(struct ast_variable *headers,
        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;
@@ -320,18 +320,18 @@ void stasis_http_play_on_channel(struct ast_variable *headers,
 
        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);
@@ -346,14 +346,14 @@ void stasis_http_record_channel(struct ast_variable *headers,
        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;
@@ -367,7 +367,7 @@ void stasis_http_record_channel(struct ast_variable *headers,
 
        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");
        }
@@ -380,14 +380,14 @@ void stasis_http_record_channel(struct ast_variable *headers,
        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;
@@ -400,22 +400,22 @@ void stasis_http_record_channel(struct ast_variable *headers,
                        /* 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;
@@ -423,7 +423,7 @@ void stasis_http_record_channel(struct ast_variable *headers,
                        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;
@@ -434,7 +434,7 @@ void stasis_http_record_channel(struct ast_variable *headers,
        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;
@@ -444,7 +444,7 @@ void stasis_http_record_channel(struct ast_variable *headers,
 
        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;
@@ -452,18 +452,18 @@ void stasis_http_record_channel(struct ast_variable *headers,
 
        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;
@@ -471,7 +471,7 @@ void stasis_http_get_channel(struct ast_variable *headers,
 
        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;
@@ -480,7 +480,7 @@ void stasis_http_get_channel(struct ast_variable *headers,
        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;
@@ -489,19 +489,19 @@ void stasis_http_get_channel(struct ast_variable *headers,
        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;
@@ -509,12 +509,12 @@ void stasis_http_delete_channel(struct ast_variable *headers,
 
        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);
@@ -524,7 +524,7 @@ void stasis_http_get_channels(struct ast_variable *headers,
 
        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;
@@ -533,13 +533,13 @@ void stasis_http_get_channels(struct ast_variable *headers,
 
        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;
        }
 
@@ -550,18 +550,18 @@ void stasis_http_get_channels(struct ast_variable *headers,
                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];
@@ -573,7 +573,7 @@ void stasis_http_originate(struct ast_variable *headers,
        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;
        }
@@ -585,7 +585,7 @@ void stasis_http_originate(struct ast_variable *headers,
        }
 
        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;
        }
@@ -611,7 +611,7 @@ void stasis_http_originate(struct ast_variable *headers,
                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;
                }
 
@@ -622,25 +622,25 @@ void stasis_http_originate(struct ast_variable *headers,
 
                /* 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);
@@ -656,14 +656,14 @@ void stasis_http_get_channel_var(struct ast_variable *headers, struct ast_get_ch
        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);
 
@@ -675,19 +675,19 @@ void stasis_http_set_channel_var(struct ast_variable *headers, struct ast_set_ch
        }
 
        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);
 }
 
similarity index 70%
rename from res/stasis_http/resource_channels.h
rename to res/ari/resource_channels.h
index c0baede..953d58f 100644 (file)
@@ -19,7 +19,7 @@
 /*! \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 {
 };
 /*!
@@ -49,8 +49,8 @@ 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;
@@ -76,8 +76,8 @@ struct ast_originate_args {
  * \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;
@@ -89,8 +89,8 @@ struct ast_get_channel_args {
  * \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;
@@ -102,8 +102,8 @@ struct ast_delete_channel_args {
  * \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;
@@ -123,8 +123,8 @@ struct ast_dial_args {
  * \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;
@@ -142,8 +142,8 @@ struct ast_continue_in_dialplan_args {
  * \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;
@@ -155,8 +155,8 @@ struct ast_answer_channel_args {
  * \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;
@@ -170,8 +170,8 @@ struct ast_mute_channel_args {
  * \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;
@@ -185,8 +185,8 @@ struct ast_unmute_channel_args {
  * \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;
@@ -198,8 +198,8 @@ struct ast_hold_channel_args {
  * \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;
@@ -211,8 +211,8 @@ struct ast_unhold_channel_args {
  * \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;
@@ -228,8 +228,8 @@ struct ast_moh_start_channel_args {
  * \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;
@@ -241,8 +241,8 @@ struct ast_moh_stop_channel_args {
  * \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;
@@ -264,8 +264,8 @@ struct ast_play_on_channel_args {
  * \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;
@@ -293,8 +293,8 @@ struct ast_record_channel_args {
  * \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;
@@ -308,8 +308,8 @@ struct ast_get_channel_var_args {
  * \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;
@@ -325,6 +325,6 @@ struct ast_set_channel_var_args {
  * \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 */
similarity index 78%
rename from res/stasis_http/resource_endpoints.c
rename to res/ari/resource_endpoints.c
index 306413d..bb28df0 100644 (file)
@@ -33,9 +33,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #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);
@@ -45,7 +45,7 @@ void stasis_http_get_endpoints(struct ast_variable *headers,
 
        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;
@@ -54,13 +54,13 @@ void stasis_http_get_endpoints(struct ast_variable *headers,
 
        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;
        }
 
@@ -71,17 +71,17 @@ void stasis_http_get_endpoints(struct ast_variable *headers,
                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);
@@ -93,7 +93,7 @@ void stasis_http_get_endpoints_by_tech(struct ast_variable *headers,
 
        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;
@@ -102,13 +102,13 @@ void stasis_http_get_endpoints_by_tech(struct ast_variable *headers,
 
        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;
        }
 
@@ -125,33 +125,33 @@ void stasis_http_get_endpoints_by_tech(struct ast_variable *headers,
                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));
 }
similarity index 71%
rename from res/stasis_http/resource_endpoints.h
rename to res/ari/resource_endpoints.h
index 0379901..82c6afc 100644 (file)
@@ -19,7 +19,7 @@
 /*! \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 {
 };
 /*!
@@ -49,8 +49,8 @@ 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;
@@ -62,8 +62,8 @@ struct ast_get_endpoints_by_tech_args {
  * \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;
@@ -77,6 +77,6 @@ struct ast_get_endpoint_args {
  * \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 */
similarity index 87%
rename from res/stasis_http/resource_events.c
rename to res/ari/resource_events.c
index d632339..e5490b5 100644 (file)
@@ -38,7 +38,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 /*! \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;
 };
 
@@ -87,7 +87,7 @@ static void session_cleanup(struct event_session *session)
 }
 
 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);
 
@@ -119,7 +119,7 @@ static void app_handler(void *data, const char *app_name,
        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) {
@@ -135,7 +135,7 @@ static void app_handler(void *data, const char *app_name,
 
        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);
 }
@@ -161,12 +161,12 @@ static int session_register_apps(struct event_session *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;
                }
 
@@ -175,7 +175,7 @@ static int session_register_apps(struct event_session *session,
        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)
 {
@@ -187,7 +187,7 @@ void ari_websocket_event_websocket(struct ari_websocket_session *ws_session,
 
        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;
        }
 
@@ -198,21 +198,21 @@ void ari_websocket_event_websocket(struct ari_websocket_session *ws_session,
                        "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);
        }
 }
similarity index 80%
rename from res/stasis_http/resource_events.h
rename to res/ari/resource_events.h
index 298228c..554ed9a 100644 (file)
@@ -19,7 +19,7 @@
 /*! \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;
@@ -51,6 +51,6 @@ struct ast_event_websocket_args {
  * \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 */
similarity index 78%
rename from res/stasis_http/resource_playback.c
rename to res/ari/resource_playback.c
index a9edc4e..64afe10 100644 (file)
@@ -30,39 +30,39 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #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;
        }
@@ -71,23 +71,23 @@ void stasis_http_stop_playback(struct ast_variable *headers,
 
        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;
@@ -104,7 +104,7 @@ void stasis_http_control_playback(struct ast_variable *headers,
        } 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;
@@ -113,7 +113,7 @@ void stasis_http_control_playback(struct ast_variable *headers,
 
        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;
        }
@@ -122,15 +122,15 @@ void stasis_http_control_playback(struct ast_variable *headers,
 
        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;
        }
similarity index 72%
rename from res/stasis_http/resource_playback.h
rename to res/ari/resource_playback.h
index 36b05bc..c606a5c 100644 (file)
@@ -19,7 +19,7 @@
 /*! \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;
@@ -51,8 +51,8 @@ struct ast_get_playback_args {
  * \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;
@@ -64,8 +64,8 @@ struct ast_stop_playback_args {
  * \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;
@@ -79,6 +79,6 @@ struct ast_control_playback_args {
  * \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 */
diff --git a/res/ari/resource_recordings.c b/res/ari/resource_recordings.c
new file mode 100644 (file)
index 0000000..46439ff
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * 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");
+}
similarity index 64%
rename from res/stasis_http/resource_recordings.h
rename to res/ari/resource_recordings.h
index 18a5bfe..e3ee88b 100644 (file)
@@ -19,7 +19,7 @@
 /*! \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 {
 };
 /*!
@@ -49,8 +49,8 @@ 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;
@@ -62,8 +62,8 @@ struct ast_get_stored_recording_args {
  * \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;
@@ -75,8 +75,8 @@ struct ast_delete_stored_recording_args {
  * \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 {
 };
 /*!
@@ -86,8 +86,8 @@ 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;
@@ -99,8 +99,8 @@ struct ast_get_live_recording_args {
  * \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;
@@ -112,8 +112,8 @@ struct ast_cancel_recording_args {
  * \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;
@@ -125,8 +125,8 @@ struct ast_stop_recording_args {
  * \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;
@@ -140,8 +140,8 @@ struct ast_pause_recording_args {
  * \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;
@@ -153,8 +153,8 @@ struct ast_unpause_recording_args {
  * \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;
@@ -168,8 +168,8 @@ struct ast_mute_recording_args {
  * \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;
@@ -181,6 +181,6 @@ struct ast_unmute_recording_args {
  * \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 */
similarity index 87%
rename from res/stasis_http/resource_sounds.c
rename to res/ari/resource_sounds.c
index 235ce9d..f77c8a2 100644 (file)
@@ -173,48 +173,48 @@ static int append_sound_cb(void *obj, void *arg, void *data, int flags)
        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);
 }
similarity index 74%
rename from res/stasis_http/resource_sounds.h
rename to res/ari/resource_sounds.h
index f3010a9..7cb22fb 100644 (file)
@@ -19,7 +19,7 @@
 /*! \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;
@@ -51,8 +51,8 @@ struct ast_get_sounds_args {
  * \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;
@@ -64,6 +64,6 @@ struct ast_get_stored_sound_args {
  * \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 */
similarity index 89%
rename from res/res_stasis_http.c
rename to res/res_ari.c
index 393953f..4777bb7 100644 (file)
  *
  * 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>