Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Channel features unit tests. More...
#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/channel.h"
#include "asterisk/time.h"
#include "asterisk/bridge.h"
#include "asterisk/bridge_basic.h"
#include "asterisk/features.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Macros | |
#define | CHANNEL_TECH_NAME "FeaturesTestChannel" |
#define | HANGUP_CHANNEL(channel) |
Hang up a test channel safely. More... | |
#define | START_ALICE(channel) START_CHANNEL(channel, "Alice", "100") |
Create a test_features_chan_tech for Alice. More... | |
#define | START_BOB(channel) START_CHANNEL(channel, "Bob", "200") |
Create a test_features_chan_tech for Bob. More... | |
#define | START_CHANNEL(channel, name, number) |
#define | TEST_BACKEND_NAME "Features Test Logging" |
#define | TEST_CATEGORY "/channels/features/" |
#define | TEST_CHANNEL_FORMAT ast_format_slin |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (test_features_channel_dtmf) | |
AST_TEST_DEFINE (test_features_channel_interval) | |
static int | feature_callback (struct ast_bridge_channel *bridge_channel, void *obj) |
static int | load_module (void) |
static void | safe_bridge_destroy (struct ast_bridge *bridge) |
static void | safe_channel_release (struct ast_channel *chan) |
static void | stream_periodic_frames (struct ast_channel *chan, int ms, int interval_ms) |
static void | test_nanosleep (int secs, long nanosecs) |
static int | unload_module (void) |
static void | wait_for_bridged (struct ast_channel *channel) |
Wait until a channel is bridged. More... | |
static void | wait_for_unbridged (struct ast_channel *channel) |
Wait until a channel is not bridged. More... | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Bridge Features Unit Tests" , .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 struct ast_channel_tech | test_features_chan_tech |
A channel technology used for the unit tests. More... | |
Channel features unit tests.
Definition in file test_channel_feature_hooks.c.
#define CHANNEL_TECH_NAME "FeaturesTestChannel" |
Definition at line 45 of file test_channel_feature_hooks.c.
#define HANGUP_CHANNEL | ( | channel | ) |
Hang up a test channel safely.
Definition at line 107 of file test_channel_feature_hooks.c.
#define START_ALICE | ( | channel | ) | START_CHANNEL(channel, "Alice", "100") |
Create a test_features_chan_tech for Alice.
Definition at line 90 of file test_channel_feature_hooks.c.
#define START_BOB | ( | channel | ) | START_CHANNEL(channel, "Bob", "200") |
Create a test_features_chan_tech for Bob.
Definition at line 93 of file test_channel_feature_hooks.c.
Definition at line 95 of file test_channel_feature_hooks.c.
#define TEST_BACKEND_NAME "Features Test Logging" |
Definition at line 47 of file test_channel_feature_hooks.c.
#define TEST_CATEGORY "/channels/features/" |
Definition at line 43 of file test_channel_feature_hooks.c.
#define TEST_CHANNEL_FORMAT ast_format_slin |
Definition at line 49 of file test_channel_feature_hooks.c.
|
static |
Definition at line 358 of file test_channel_feature_hooks.c.
|
static |
Definition at line 358 of file test_channel_feature_hooks.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 358 of file test_channel_feature_hooks.c.
AST_TEST_DEFINE | ( | test_features_channel_dtmf | ) |
Definition at line 160 of file test_channel_feature_hooks.c.
References ast_bridge_basic_new(), ast_bridge_depart(), ast_bridge_dtmf_hook(), ast_bridge_features_cleanup(), ast_bridge_features_init(), ast_bridge_impart(), AST_BRIDGE_IMPART_CHAN_DEPARTABLE, ast_channel_feature_hooks_append(), AST_FRAME_DTMF, ast_queue_frame(), AST_TEST_NOT_RUN, AST_TEST_PASS, feature_callback(), HANGUP_CHANNEL, sip_to_pjsip::info(), ast_frame_subclass::integer, ast_frame::len, NULL, RAII_VAR, safe_bridge_destroy(), safe_channel_release(), START_ALICE, START_BOB, stream_periodic_frames(), ast_frame::subclass, TEST_CATEGORY, TEST_EXECUTE, TEST_INIT, wait_for_bridged(), and wait_for_unbridged().
AST_TEST_DEFINE | ( | test_features_channel_interval | ) |
Definition at line 253 of file test_channel_feature_hooks.c.
References ast_bridge_basic_new(), ast_bridge_depart(), ast_bridge_features_cleanup(), ast_bridge_features_init(), ast_bridge_impart(), AST_BRIDGE_IMPART_CHAN_DEPARTABLE, ast_bridge_interval_hook(), ast_channel_feature_hooks_append(), AST_TEST_NOT_RUN, AST_TEST_PASS, feature_callback(), HANGUP_CHANNEL, sip_to_pjsip::info(), NULL, RAII_VAR, safe_bridge_destroy(), safe_channel_release(), START_ALICE, START_BOB, TEST_CATEGORY, TEST_EXECUTE, TEST_INIT, test_nanosleep(), wait_for_bridged(), and wait_for_unbridged().
|
static |
Definition at line 130 of file test_channel_feature_hooks.c.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 344 of file test_channel_feature_hooks.c.
References ast_channel_register(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_TEST_REGISTER, ast_channel_tech::capabilities, TEST_CHANNEL_FORMAT, and test_features_chan_tech.
|
static |
Definition at line 122 of file test_channel_feature_hooks.c.
References ast_bridge_destroy().
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 114 of file test_channel_feature_hooks.c.
References ast_channel_release().
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 138 of file test_channel_feature_hooks.c.
References ast_assert, ast_null_frame, ast_queue_frame(), NULL, and test_nanosleep().
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 57 of file test_channel_feature_hooks.c.
References errno.
Referenced by AST_TEST_DEFINE(), stream_periodic_frames(), wait_for_bridged(), and wait_for_unbridged().
|
static |
Definition at line 332 of file test_channel_feature_hooks.c.
References ao2_cleanup, ast_channel_unregister(), AST_TEST_UNREGISTER, ast_channel_tech::capabilities, NULL, and test_features_chan_tech.
|
static |
Wait until a channel is bridged.
Definition at line 66 of file test_channel_feature_hooks.c.
References ast_channel_is_bridged(), ast_channel_lock, ast_channel_unlock, and test_nanosleep().
Referenced by AST_TEST_DEFINE().
|
static |
Wait until a channel is not bridged.
Definition at line 78 of file test_channel_feature_hooks.c.
References ast_channel_is_bridged(), ast_channel_lock, ast_channel_unlock, and test_nanosleep().
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 358 of file test_channel_feature_hooks.c.
|
static |
Definition at line 358 of file test_channel_feature_hooks.c.
|
static |
A channel technology used for the unit tests.
Definition at line 52 of file test_channel_feature_hooks.c.
Referenced by load_module(), and unload_module().