Asterisk - The Open Source Telephony Project
18.5.0
|
Test ARI API.
More...#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/ari.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (get_docs) | |
AST_TEST_DEFINE (get_docs_nohost) | |
AST_TEST_DEFINE (get_docs_notfound) | |
AST_TEST_DEFINE (get_docs_hackerz) | |
AST_TEST_DEFINE (invoke_get) | |
AST_TEST_DEFINE (invoke_wildcard) | |
AST_TEST_DEFINE (invoke_delete) | |
AST_TEST_DEFINE (invoke_post) | |
AST_TEST_DEFINE (invoke_bad_post) | |
AST_TEST_DEFINE (invoke_not_found) | |
static int | load_module (void) |
static struct ast_ari_response * | response_alloc (void) |
static void | response_free (struct ast_ari_response *resp) |
static void * | setup_invocation_test (void) |
static void | tear_down_invocation_test (void *ignore) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "ARI testing" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_ari", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
#define | HANDLER(name, response_code) |
static int | invocation_count |
static struct stasis_rest_handlers | bang |
static struct stasis_rest_handlers | bar |
static struct stasis_rest_handlers | bam |
static struct stasis_rest_handlers | test_root |
static void | handler (const char *name, int response_code, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response) |
Test ARI API.
Definition in file test_ari.c.
#define HANDLER | ( | name, | |
response_code | |||
) |
Definition at line 97 of file test_ari.c.
|
static |
Definition at line 578 of file test_ari.c.
|
static |
Definition at line 578 of file test_ari.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 578 of file test_ari.c.
AST_TEST_DEFINE | ( | get_docs | ) |
Definition at line 201 of file test_ari.c.
References ast_ari_get_docs(), ast_json_object_get(), ast_json_string_get(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_variable_new, ast_variables_destroy(), ast_ari_response::headers, sip_to_pjsip::info(), NULL, RAII_VAR, response_alloc(), response_free(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | get_docs_nohost | ) |
Definition at line 233 of file test_ari.c.
References ast_ari_get_docs(), ast_json_object_get(), AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), NULL, RAII_VAR, response_alloc(), response_free(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | get_docs_notfound | ) |
Definition at line 261 of file test_ari.c.
References ast_ari_get_docs(), AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), NULL, RAII_VAR, response_alloc(), response_free(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | get_docs_hackerz | ) |
Definition at line 284 of file test_ari.c.
References ast_ari_get_docs(), AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), NULL, RAII_VAR, response_alloc(), response_free(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_get | ) |
Definition at line 307 of file test_ari.c.
References ast_ari_invoke(), ast_assert, AST_HTTP_GET, ast_json_equal(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_variable_new, sip_to_pjsip::info(), invocation_count, ast_variable::next, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_wildcard | ) |
Definition at line 358 of file test_ari.c.
References ast_ari_invoke(), AST_HTTP_GET, ast_json_equal(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), invocation_count, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_delete | ) |
Definition at line 396 of file test_ari.c.
References ast_ari_invoke(), AST_HTTP_DELETE, ast_json_equal(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), invocation_count, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_post | ) |
Definition at line 434 of file test_ari.c.
References ast_ari_invoke(), ast_assert, AST_HTTP_POST, ast_json_equal(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_variable_new, sip_to_pjsip::info(), invocation_count, ast_variable::next, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_bad_post | ) |
Definition at line 485 of file test_ari.c.
References ast_ari_invoke(), AST_HTTP_POST, ast_json_null(), AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), invocation_count, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | invoke_not_found | ) |
Definition at line 514 of file test_ari.c.
References ast_ari_invoke(), AST_HTTP_GET, ast_json_null(), AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), invocation_count, NULL, RAII_VAR, response_alloc(), response_free(), setup_invocation_test(), tear_down_invocation_test(), TEST_EXECUTE, and TEST_INIT.
|
static |
Definition at line 59 of file test_ari.c.
References ast_json_object_get(), ast_json_object_set(), ast_json_pack(), ast_json_string_create(), invocation_count, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.
Referenced by __aco_option_register(), add_sdp_streams(), allocate_subscription(), app_handle_subscriptions(), ast_ari_add_handler(), ast_ari_invoke(), ast_ari_remove_handler(), ast_msg_has_destination(), ast_mwi_state_callback_all(), ast_mwi_state_callback_subscribed(), channel_hangup_handler_cb(), event_session_alloc(), handle_conf_user_join(), handle_conf_user_leave(), handle_incoming_sdp(), handle_negotiated_sdp_session_media(), handle_stasis_state(), msg_q_cb(), publish_request_initial(), pubsub_on_rx_publish_request(), pubsub_on_rx_subscribe_request(), remove_handler(), root_handler_create(), sdp_requires_deferral(), session_media_set_handler(), session_outgoing_nat_hook(), sip_outbound_publish_synchronize(), stream_destroy(), sub_persistence_recreate(), subscription_get_handler_from_rdata(), and xmpp_action_hook().
|
static |
Definition at line 558 of file test_ari.c.
References AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, AST_TEST_REGISTER, ASTERISK_GPL_KEY, and unload_module().
|
static |
Definition at line 156 of file test_ari.c.
References ast_calloc, ast_str_create, and ast_ari_response::headers.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 167 of file test_ari.c.
References ast_free, ast_json_unref(), ast_ari_response::headers, and ast_ari_response::message.
Referenced by AST_TEST_DEFINE().
|
static |
\ internal Setup test fixture for invocation tests.
Definition at line 181 of file test_ari.c.
References ast_ari_add_handler(), ast_assert, and invocation_count.
Referenced by AST_TEST_DEFINE().
|
static |
\ internal Tear down test fixture for invocation tests.
Definition at line 193 of file test_ari.c.
References ast_ari_remove_handler().
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 543 of file test_ari.c.
References AST_TEST_UNREGISTER.
Referenced by load_module().
|
static |
Definition at line 578 of file test_ari.c.
|
static |
Definition at line 578 of file test_ari.c.
|
static |
Definition at line 133 of file test_ari.c.
|
static |
Definition at line 116 of file test_ari.c.
|
static |
Definition at line 125 of file test_ari.c.
|
static |
Definition at line 53 of file test_ari.c.
Referenced by AST_TEST_DEFINE(), handler(), and setup_invocation_test().
|
static |
Definition at line 142 of file test_ari.c.