Asterisk - The Open Source Telephony Project GIT-master-b023714
|
#include "asterisk.h"
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/file.h"
#include "asterisk/format_cap.h"
#include "asterisk/http.h"
#include "asterisk/http_websocket.h"
#include "asterisk/json.h"
#include "asterisk/speech.h"
#include "asterisk/res_aeap.h"
#include "asterisk/res_aeap_message.h"
Go to the source code of this file.
Macros | |
#define | ADDR "127.0.0.1:8088" |
#define | TEST_SPEECH_RESULTS_BEST 1 |
#define | TEST_SPEECH_RESULTS_GRAMMAR "bar" |
#define | TEST_SPEECH_RESULTS_SCORE 7 |
#define | TEST_SPEECH_RESULTS_TEXT "foo" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (res_speech_aeap_test) | |
static int | load_module (void) |
static void | speech_test_server_cb (struct ast_websocket *ws, struct ast_variable *parameters, struct ast_variable *headers) |
static int | speech_test_server_get (struct ast_json *req, struct ast_json *resp) |
static int | speech_test_server_handle_request (struct ast_websocket *ws, const void *buf, uint64_t size) |
static int | speech_test_server_set (struct ast_json *req, struct ast_json *resp) |
static int | speech_test_server_setup (struct ast_json *req, struct ast_json *resp) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Asterisk External Application Protocol Speech test(s)" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_speech_aeap", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_http_server * | http_server |
#define ADDR "127.0.0.1:8088" |
Definition at line 39 of file test_aeap_speech.c.
#define TEST_SPEECH_RESULTS_BEST 1 |
Definition at line 60 of file test_aeap_speech.c.
#define TEST_SPEECH_RESULTS_GRAMMAR "bar" |
Definition at line 59 of file test_aeap_speech.c.
#define TEST_SPEECH_RESULTS_SCORE 7 |
Definition at line 58 of file test_aeap_speech.c.
#define TEST_SPEECH_RESULTS_TEXT "foo" |
Definition at line 57 of file test_aeap_speech.c.
|
static |
Definition at line 287 of file test_aeap_speech.c.
|
static |
Definition at line 287 of file test_aeap_speech.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 287 of file test_aeap_speech.c.
AST_TEST_DEFINE | ( | res_speech_aeap_test | ) |
Definition at line 209 of file test_aeap_speech.c.
References ao2_cleanup, ast_format_cap_alloc, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_update_by_allow_disallow(), ast_speech_change(), ast_speech_change_results_type(), ast_speech_destroy(), ast_speech_dtmf(), ast_speech_get_setting(), ast_speech_new(), ast_speech_results_free(), ast_speech_results_get(), AST_SPEECH_RESULTS_TYPE_NBEST, ast_speech_start(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_websocket_add_protocol(), ast_websocket_remove_protocol(), buf, cleanup(), ast_speech_result::grammar, ast_speech_result::nbest_num, NULL, RAII_VAR, ast_speech::results, ast_speech_result::score, speech_test_server_cb(), TEST_EXECUTE, TEST_INIT, TEST_SPEECH_RESULTS_BEST, TEST_SPEECH_RESULTS_GRAMMAR, TEST_SPEECH_RESULTS_SCORE, TEST_SPEECH_RESULTS_TEXT, and ast_speech_result::text.
|
static |
Definition at line 262 of file test_aeap_speech.c.
References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_TEST_REGISTER, http_server, and NULL.
|
static |
Definition at line 167 of file test_aeap_speech.c.
References ast_debug, ast_fd_set_flags, ast_log, ast_websocket_fd(), AST_WEBSOCKET_OPCODE_BINARY, AST_WEBSOCKET_OPCODE_CLOSE, AST_WEBSOCKET_OPCODE_TEXT, ast_websocket_read(), ast_websocket_unref(), ast_websocket_wait_for_input(), ast_websocket_write(), LOG_ERROR, and speech_test_server_handle_request().
Referenced by AST_TEST_DEFINE().
Definition at line 62 of file test_aeap_speech.c.
References ast_json_array_get(), ast_json_object_get(), ast_json_object_set(), ast_json_pack(), ast_json_string_get(), NULL, TEST_SPEECH_RESULTS_BEST, TEST_SPEECH_RESULTS_GRAMMAR, TEST_SPEECH_RESULTS_SCORE, and TEST_SPEECH_RESULTS_TEXT.
Referenced by speech_test_server_handle_request().
|
static |
Definition at line 100 of file test_aeap_speech.c.
References ast_free, ast_json_dump_string, ast_json_load_buf(), ast_json_object_string_get, ast_json_pack(), ast_json_unref(), ast_log, ast_websocket_write_string(), buf, LOG_ERROR, name, NULL, speech_test_server_get(), speech_test_server_set(), and speech_test_server_setup().
Referenced by speech_test_server_cb().
Definition at line 91 of file test_aeap_speech.c.
References ast_json_object_get(), ast_json_object_set(), and ast_json_ref().
Referenced by speech_test_server_handle_request().
Definition at line 41 of file test_aeap_speech.c.
References ast_json_object_get(), ast_json_object_set(), and ast_json_ref().
Referenced by speech_test_server_handle_request().
|
static |
Definition at line 273 of file test_aeap_speech.c.
References AST_TEST_UNREGISTER, and http_server.
|
static |
Definition at line 287 of file test_aeap_speech.c.
|
static |
Definition at line 287 of file test_aeap_speech.c.
|
static |
Definition at line 260 of file test_aeap_speech.c.
Referenced by load_module(), and unload_module().