Asterisk - The Open Source Telephony Project
21.4.1
|
Device State Test Module. More...
#include "asterisk.h"
#include "asterisk/utils.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/devicestate.h"
#include "asterisk/pbx.h"
#include "asterisk/stasis_message_router.h"
#include "asterisk/vector.h"
Go to the source code of this file.
Data Structures | |
struct | consumer |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (device2extenstate_test) | |
AST_TEST_DEFINE (device_state_aggregation_test) | |
AST_TEST_DEFINE (devstate_prov_add) | |
AST_TEST_DEFINE (devstate_prov_del) | |
AST_TEST_DEFINE (devstate_changed) | |
AST_TEST_DEFINE (devstate_conversions) | |
AST_TEST_DEFINE (devstate_channels) | |
static void | cache_cleanup (int unused) |
static int | chan_test_devicestate_cb (const char *device_number) |
static void | clear_result_states (void) |
Clear out all recorded device states in result_states . | |
static struct consumer * | consumer_create (void) |
static void | consumer_dtor (void *obj) |
static void | consumer_exec (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | consumer_finalize (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | consumer_reset (struct consumer *consumer) |
static void | consumer_wait_for (struct consumer *consumer) |
static void | device_state_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Stasis subscription callback for device state updates. | |
static enum ast_device_state | devstate_prov_cb (const char *data) |
static int | load_module (void) |
static int | remove_device_states_cb (void *obj, void *arg, int flags) |
static void | safe_hangup (void *object) |
static int | unload_module (void) |
static int | wait_for_channel_callback (struct ast_test *test) |
Wait until the test channel driver's devicestate callback is called. | |
static int | wait_for_device_state_updates (struct ast_test *test, int expected_updates) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Device State Test" , .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, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static int | chan_callback_called |
Whether or not the channel device state callback was called. | |
static unsigned int | chan_idx |
Used to assign an increasing integer to channel name. | |
struct ast_channel_tech | chan_test_devicestate |
static ast_cond_t | channel_cb_cond |
Condition wait variable for channel tech device state cb. | |
static ast_mutex_t | channel_cb_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
Mutext for channel_cb_cond . | |
static int | combined_results [] |
static enum ast_device_state | current_device_state |
The current device state for our device state provider. | |
static int | exten_results [] |
struct { | |
size_t current | |
enum ast_device_state * elems | |
size_t max | |
} | result_states |
The resulting device state updates caused by some function call. | |
static ast_cond_t | update_cond |
Condition wait variable for device state updates. | |
static ast_mutex_t | update_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
Mutex for update_cond . | |
Device State Test Module.
Definition in file test_devicestate.c.
struct ast_channel_tech chan_test_devicestate |
Definition at line 919 of file test_devicestate.c.