Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Cross-platform console channel driver. More...
#include "asterisk.h"
#include <signal.h>
#include <portaudio.h>
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/causes.h"
#include "asterisk/cli.h"
#include "asterisk/musiconhold.h"
#include "asterisk/callerid.h"
#include "asterisk/astobj2.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | console_pvt |
Console pvt structure. More... | |
Macros | |
#define | console_pvt_lock(pvt) ao2_lock(pvt) |
lock a console_pvt struct More... | |
#define | console_pvt_unlock(pvt) ao2_unlock(pvt) |
unlock a console_pvt struct More... | |
#define | INPUT_CHANNELS 1 |
Mono Input. More... | |
#define | NUM_PVT_BUCKETS 7 |
#define | NUM_SAMPLES 320 |
The number of samples to configure the portaudio stream for. More... | |
#define | OUTPUT_CHANNELS 1 |
Mono Output. More... | |
#define | SAMPLE_RATE 16000 |
The sample rate to request from PortAudio. More... | |
#define | TEXT_SIZE 256 |
Maximum text message length. More... | |
#define | V_BEGIN " --- <(\"<) --- " |
Dance, Kirby, Dance! More... | |
#define | V_END " --- (>\")> ---\n" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static char * | ast_ext_ctx (struct console_pvt *pvt, const char *src, char **ext, char **ctx) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void | build_device (struct ast_config *cfg, const char *name) |
static char * | cli_console_active (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_console_answer (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
answer command from the console More... | |
static char * | cli_console_autoanswer (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_console_dial (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_console_flash (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_console_hangup (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_console_mute (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_console_sendtext (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Console send text CLI command. More... | |
static char * | cli_list_available (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_list_devices (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static struct ast_channel * | console_new (struct console_pvt *pvt, const char *ext, const char *ctx, int state, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor) |
static void | destroy_pvts (void) |
static struct console_pvt * | find_pvt (const char *name) |
static struct console_pvt * | get_active_pvt (void) |
static int | init_pvt (struct console_pvt *pvt, const char *name) |
static int | load_config (int reload) |
Load the configuration. More... | |
static int | load_module (void) |
Load the module. More... | |
static int | open_stream (struct console_pvt *pvt) |
static int | pvt_cmp_cb (void *obj, void *arg, int flags) |
static void | pvt_destructor (void *obj) |
static int | pvt_hash_cb (const void *obj, const int flags) |
static int | pvt_mark_destroy_cb (void *obj, void *arg, int flags) |
static struct console_pvt * | ref_pvt (struct console_pvt *pvt) |
static int | reload (void) |
static void | set_active (struct console_pvt *pvt, const char *value) |
static void | set_pvt_defaults (struct console_pvt *pvt) |
Set default values for a pvt struct. More... | |
static int | start_stream (struct console_pvt *pvt) |
static int | stop_stream (struct console_pvt *pvt) |
static void | stop_streams (void) |
static void | store_callerid (struct console_pvt *pvt, const char *value) |
static void | store_config_core (struct console_pvt *pvt, const char *var, const char *value) |
Store a configuration parameter in a pvt struct. More... | |
static void * | stream_monitor (void *data) |
Stream monitor thread. More... | |
static int | unload_module (void) |
static struct console_pvt * | unref_pvt (struct console_pvt *pvt) |
static int | console_answer (struct ast_channel *c) |
static int | console_call (struct ast_channel *c, const char *dest, int timeout) |
static int | console_digit_begin (struct ast_channel *c, char digit) |
static int | console_digit_end (struct ast_channel *c, char digit, unsigned int duration) |
static int | console_fixup (struct ast_channel *oldchan, struct ast_channel *newchan) |
static int | console_hangup (struct ast_channel *c) |
static int | console_indicate (struct ast_channel *chan, int cond, const void *data, size_t datalen) |
static struct ast_frame * | console_read (struct ast_channel *chan) |
Implementation of the ast_channel_tech read() callback. More... | |
static struct ast_channel * | console_request (const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause) |
static int | console_text (struct ast_channel *c, const char *text) |
static int | console_write (struct ast_channel *chan, struct ast_frame *f) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Console Channel Driver" , .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_EXTENDED, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_CHANNEL_DRIVER, } |
static ast_rwlock_t | active_lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } |
static struct console_pvt * | active_pvt |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_cli_entry | cli_console [] |
static const char | config_file [] = "console.conf" |
static struct ast_channel_tech | console_tech |
static struct ast_jb_conf | default_jbconf |
Global jitterbuffer configuration. More... | |
static struct ast_jb_conf | global_jbconf |
static struct console_pvt | globals |
static ast_mutex_t | globals_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static struct ao2_container * | pvts |
Cross-platform console channel driver.
Portaudio http://www.portaudio.com/
To install portaudio v19 from svn, check it out using the following command:
Definition in file chan_console.c.
#define console_pvt_lock | ( | pvt | ) | ao2_lock(pvt) |
lock a console_pvt struct
Definition at line 228 of file chan_console.c.
#define console_pvt_unlock | ( | pvt | ) | ao2_unlock(pvt) |
unlock a console_pvt struct
Definition at line 231 of file chan_console.c.
#define INPUT_CHANNELS 1 |
Mono Input.
Definition at line 99 of file chan_console.c.
#define NUM_PVT_BUCKETS 7 |
Definition at line 175 of file chan_console.c.
#define NUM_SAMPLES 320 |
The number of samples to configure the portaudio stream for.
320 samples (20 ms) is the most common frame size in Asterisk. So, the code in this module reads 320 sample frames from the portaudio stream and queues them up on the Asterisk channel. Frames of any size can be written to a portaudio stream, but the portaudio documentation does say that for high performance applications, the data should be written to Pa_WriteStream in the same size as what is used to initialize the stream.
Definition at line 96 of file chan_console.c.
#define OUTPUT_CHANNELS 1 |
Mono Output.
Definition at line 102 of file chan_console.c.
#define SAMPLE_RATE 16000 |
The sample rate to request from PortAudio.
Definition at line 84 of file chan_console.c.
#define TEXT_SIZE 256 |
Maximum text message length.
Definition at line 109 of file chan_console.c.
#define V_BEGIN " --- <(\"<) --- " |
Dance, Kirby, Dance!
Definition at line 112 of file chan_console.c.
#define V_END " --- (>\")> ---\n" |
Definition at line 113 of file chan_console.c.
|
static |
Definition at line 1592 of file chan_console.c.
|
static |
Definition at line 1592 of file chan_console.c.
|
static |
split a string in extension-context, returns pointers to malloc'ed strings. If we do not have 'overridecontext' then the last @ is considered as a context separator, and the context is overridden. This is usually not very necessary as you can play with the dialplan, and it is nice not to need it because you have '@' in SIP addresses. Return value is the buffer address.
Definition at line 682 of file chan_console.c.
References ast_strdup, ext, NULL, and console_pvt::overridecontext.
Referenced by cli_console_dial().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1592 of file chan_console.c.
|
static |
Definition at line 1370 of file chan_console.c.
References ao2_alloc, ao2_link, ast_variable_browse(), console_pvt_lock, console_pvt_unlock, console_pvt::destroy, find_pvt(), init_pvt(), name, ast_variable::name, ast_variable::next, pvt_destructor(), pvts, set_pvt_defaults(), store_config_core(), unref_pvt(), and ast_variable::value.
Referenced by load_config().
|
static |
Definition at line 1193 of file chan_console.c.
References a, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ast_cli_entry::args, ast_cli(), ast_strdup, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, console_pvt_lock, console_pvt_unlock, find_pvt(), get_active_pvt(), console_pvt::name, NULL, pvts, set_active(), unref_pvt(), and ast_cli_entry::usage.
|
static |
answer command from the console
Definition at line 1071 of file chan_console.c.
References a, ast_cli_entry::args, ast_cli(), AST_CONTROL_ANSWER, ast_indicate(), ast_queue_control(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, get_active_pvt(), console_pvt::hookstate, NULL, console_pvt::owner, unref_pvt(), and ast_cli_entry::usage.
|
static |
Definition at line 716 of file chan_console.c.
References a, ast_cli_entry::args, ast_cli(), console_pvt::autoanswer, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, get_active_pvt(), NULL, unref_pvt(), and ast_cli_entry::usage.
|
static |
Definition at line 804 of file chan_console.c.
References a, ast_cli_entry::args, ast_cli(), ast_debug, ast_exists_extension(), ast_ext_ctx(), AST_FRAME_DTMF, ast_free, ast_queue_frame(), AST_STATE_RINGING, ast_strlen_zero(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, console_new(), console_pvt_lock, console_pvt_unlock, console_pvt::context, ext, console_pvt::exten, get_active_pvt(), console_pvt::hookstate, ast_frame_subclass::integer, NULL, console_pvt::owner, ast_frame::subclass, unref_pvt(), and ast_cli_entry::usage.
|
static |
Definition at line 765 of file chan_console.c.
References a, ast_cli_entry::args, ast_cli(), AST_CONTROL_FLASH, ast_queue_control(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, get_active_pvt(), console_pvt::hookstate, NULL, console_pvt::owner, unref_pvt(), and ast_cli_entry::usage.
|
static |
Definition at line 881 of file chan_console.c.
References a, ast_cli_entry::args, ast_cli(), ast_queue_hangup(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, get_active_pvt(), console_pvt::hookstate, NULL, console_pvt::owner, unref_pvt(), and ast_cli_entry::usage.
|
static |
Definition at line 920 of file chan_console.c.
References a, ast_cli_entry::args, ast_cli(), ast_verb, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, get_active_pvt(), console_pvt::muted, NULL, unref_pvt(), ast_cli_entry::usage, V_BEGIN, and V_END.
|
static |
Console send text CLI command.
Definition at line 1121 of file chan_console.c.
References a, ast_cli_entry::args, ast_cli(), AST_FRAME_TEXT, ast_join, ast_queue_frame(), ast_strlen_zero(), buf, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_frame::datalen, ast_frame::frametype, get_active_pvt(), len(), NULL, console_pvt::owner, TEXT_SIZE, unref_pvt(), and ast_cli_entry::usage.
|
static |
Definition at line 962 of file chan_console.c.
References a, ast_cli_entry::args, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, test_val::name, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1010 of file chan_console.c.
References a, active_pvt, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ast_cli_entry::args, ast_cli(), console_pvt::autoanswer, console_pvt::cid_name, console_pvt::cid_num, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, console_pvt_lock, console_pvt_unlock, console_pvt::context, console_pvt::exten, console_pvt::input_device, console_pvt::language, console_pvt::mohinterpret, console_pvt::muted, console_pvt::name, NULL, console_pvt::output_device, console_pvt::overridecontext, console_pvt::parkinglot, pvts, unref_pvt(), and ast_cli_entry::usage.
|
static |
Definition at line 546 of file chan_console.c.
References ast_channel_tech_pvt(), ast_setstate(), AST_STATE_UP, ast_verb, c, start_stream(), V_BEGIN, and V_END.
|
static |
Definition at line 584 of file chan_console.c.
References ast_channel_caller(), ast_channel_tech_pvt(), AST_CONTROL_ANSWER, AST_CONTROL_RINGING, ast_indicate(), ast_queue_control(), ast_verb, console_pvt::autoanswer, c, console_pvt_lock, console_pvt_unlock, console_pvt::hookstate, name, S_COR, start_stream(), V_BEGIN, and V_END.
|
static |
|
static |
|
static |
Definition at line 662 of file chan_console.c.
References ast_channel_tech_pvt(), and console_pvt::owner.
|
static |
Definition at line 531 of file chan_console.c.
References ast_channel_tech_pvt(), ast_channel_tech_pvt_set(), ast_verb, c, console_pvt::hookstate, NULL, console_pvt::owner, stop_stream(), unref_pvt(), V_BEGIN, and V_END.
|
static |
Definition at line 625 of file chan_console.c.
References ast_channel_name(), ast_channel_tech_pvt(), AST_CONTROL_BUSY, AST_CONTROL_CONGESTION, AST_CONTROL_HOLD, AST_CONTROL_INCOMPLETE, AST_CONTROL_PROCEEDING, AST_CONTROL_PROGRESS, AST_CONTROL_PVT_CAUSE_CODE, AST_CONTROL_RINGING, AST_CONTROL_SRCUPDATE, AST_CONTROL_UNHOLD, AST_CONTROL_VIDUPDATE, ast_log, ast_moh_start(), ast_moh_stop(), ast_verb, cond, LOG_WARNING, console_pvt::mohinterpret, V_BEGIN, and V_END.
|
static |
Definition at line 425 of file chan_console.c.
References ao2_ref, AST_CAUSE_SWITCH_CONGESTION, ast_channel_alloc, ast_channel_hangupcause_set(), ast_channel_nativeformats_set(), ast_channel_set_readformat(), ast_channel_set_writeformat(), ast_channel_stage_snapshot(), ast_channel_stage_snapshot_done(), ast_channel_tech_pvt_set(), ast_channel_tech_set(), ast_channel_unlock, ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_slin16, ast_hangup(), ast_jb_configure(), ast_pbx_start(), AST_STATE_DOWN, ast_strlen_zero(), console_pvt::cid_name, console_pvt::cid_num, console_tech, ext, global_jbconf, console_pvt::language, console_pvt::name, NULL, console_pvt::owner, ref_pvt(), and start_stream().
Referenced by cli_console_dial(), and console_request().
|
static |
Implementation of the ast_channel_tech read() callback.
Calling this function is harmless. However, if it does get called, it is an indication that something weird happened that really shouldn't have and is worth looking into.
Why should this function not get called? Well, let me explain. There are a couple of ways to pass on audio that has come from this channel. The way that this channel driver uses is that once the audio is available, it is wrapped in an ast_frame and queued onto the channel using ast_queue_frame().
The other method would be signalling to the core that there is audio waiting, and that it needs to call the channel's read() callback to get it. The way the channel gets signalled is that one or more file descriptors are placed in the fds array on the ast_channel which the core will poll() on. When the fd indicates that input is available, the read() callback is called. This is especially useful when there is a dedicated file descriptor where the audio is read from. An example would be the socket for an RTP stream.
Definition at line 577 of file chan_console.c.
References ast_debug, and ast_null_frame.
|
static |
Channel Technology Callbacks
Definition at line 473 of file chan_console.c.
References AST_CAUSE_BUSY, ast_format_cap_get_names(), ast_format_cap_iscompatible(), AST_FORMAT_CAP_NAMES_LEN, ast_log, AST_STATE_DOWN, ast_str_alloca, ast_channel_tech::capabilities, console_new(), console_pvt_lock, console_pvt_unlock, console_tech, find_pvt(), LOG_ERROR, LOG_NOTICE, LOG_WARNING, NULL, console_pvt::owner, and unref_pvt().
|
static |
|
static |
Definition at line 614 of file chan_console.c.
References ast_channel_tech_pvt(), console_pvt_lock, console_pvt_unlock, ast_frame::data, ast_frame::ptr, ast_frame::samples, and console_pvt::stream.
|
static |
Definition at line 1406 of file chan_console.c.
References active_lock, active_pvt, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_unlink, ast_rwlock_unlock, ast_rwlock_wrlock, console_pvt::destroy, pvts, and unref_pvt().
Referenced by load_config().
|
static |
Definition at line 246 of file chan_console.c.
References ao2_find, name, console_pvt::name, OBJ_POINTER, and pvts.
Referenced by build_device(), cli_console_active(), and console_request().
|
static |
Definition at line 705 of file chan_console.c.
References active_lock, active_pvt, ast_rwlock_rdlock, ast_rwlock_unlock, and ref_pvt().
Referenced by cli_console_active(), cli_console_answer(), cli_console_autoanswer(), cli_console_dial(), cli_console_flash(), cli_console_hangup(), cli_console_mute(), and cli_console_sendtext().
|
static |
Definition at line 1358 of file chan_console.c.
References AST_PTHREADT_NULL, ast_string_field_init, ast_string_field_set, name, S_OR, and console_pvt::thread.
Referenced by build_device(), and load_module().
|
static |
Load the configuration.
reload | if this was called due to a reload |
0 | success |
-1 | failure |
Definition at line 1431 of file chan_console.c.
References ao2_callback, ast_category_browse(), ast_config_destroy(), ast_config_load, ast_log, ast_mutex_lock, ast_mutex_unlock, ast_variable_browse(), build_device(), config_file, CONFIG_STATUS_FILEINVALID, voicemailpwcheck::context, default_jbconf, destroy_pvts(), global_jbconf, globals, globals_lock, LOG_NOTICE, ast_variable::name, ast_variable::next, NULL, OBJ_NODATA, pvt_mark_destroy_cb(), pvts, set_pvt_defaults(), store_config_core(), and ast_variable::value.
Referenced by load_module(), and reload().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 1528 of file chan_console.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, ARRAY_LEN, ast_channel_register(), ast_channel_unregister(), ast_cli_register_multiple, ast_cli_unregister_multiple(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_slin16, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_channel_tech::capabilities, cli_console, console_tech, globals, init_pvt(), load_config(), LOG_ERROR, LOG_WARNING, NULL, NUM_PVT_BUCKETS, pvt_cmp_cb(), pvt_destructor(), pvt_hash_cb(), and pvts.
|
static |
Definition at line 298 of file chan_console.c.
References ast_log, INPUT_CHANNELS, console_pvt::input_device, LOG_ERROR, console_pvt::name, NULL, NUM_SAMPLES, OUTPUT_CHANNELS, console_pvt::output_device, SAMPLE_RATE, and console_pvt::stream.
Referenced by start_stream().
|
static |
Definition at line 1478 of file chan_console.c.
References CMP_MATCH, CMP_STOP, and console_pvt::name.
Referenced by load_module().
|
static |
Definition at line 1351 of file chan_console.c.
References ast_string_field_free_memory.
Referenced by build_device(), load_module(), and unload_module().
|
static |
Definition at line 1471 of file chan_console.c.
References ast_str_case_hash(), and console_pvt::name.
Referenced by load_module().
|
static |
Definition at line 1399 of file chan_console.c.
References console_pvt::destroy.
Referenced by load_config().
|
inlinestatic |
Definition at line 233 of file chan_console.c.
References ao2_ref.
Referenced by console_new(), get_active_pvt(), and set_active().
|
static |
Definition at line 1581 of file chan_console.c.
References load_config().
|
static |
Definition at line 1176 of file chan_console.c.
References active_lock, active_pvt, ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, ast_true(), globals, LOG_ERROR, ref_pvt(), unref_pvt(), and value.
Referenced by cli_console_active(), and store_config_core().
|
static |
Set default values for a pvt struct.
Definition at line 1276 of file chan_console.c.
References ast_mutex_lock, ast_mutex_unlock, ast_string_field_set, console_pvt::autoanswer, console_pvt::cid_name, console_pvt::cid_num, console_pvt::context, voicemailpwcheck::context, console_pvt::exten, globals, globals_lock, console_pvt::language, language, console_pvt::mohinterpret, mohinterpret, console_pvt::overridecontext, and console_pvt::parkinglot.
Referenced by build_device(), and load_config().
|
static |
Definition at line 359 of file chan_console.c.
References ast_debug, ast_log, ast_pthread_create_background, console_pvt_lock, console_pvt_unlock, LOG_ERROR, LOG_WARNING, NULL, open_stream(), console_pvt::owner, console_pvt::stream, stream_monitor(), console_pvt::streamstate, and console_pvt::thread.
Referenced by console_answer(), console_call(), and console_new().
|
static |
Definition at line 402 of file chan_console.c.
References console_pvt::abort, AST_PTHREADT_NULL, console_pvt_lock, console_pvt_unlock, NULL, console_pvt::stream, console_pvt::streamstate, and console_pvt::thread.
Referenced by console_hangup(), and stop_streams().
|
static |
Definition at line 1485 of file chan_console.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, console_pvt::hookstate, pvts, stop_stream(), and unref_pvt().
Referenced by unload_module().
|
static |
Definition at line 1307 of file chan_console.c.
References ast_callerid_split(), ast_string_field_set, and value.
Referenced by store_config_core().
|
static |
Store a configuration parameter in a pvt struct.
Definition at line 1324 of file chan_console.c.
References ast_jb_read_conf(), ast_log, console_pvt::autoanswer, voicemailpwcheck::context, CV_BOOL, CV_END, CV_F, CV_START, CV_STRFIELD, global_jbconf, globals, language, LOG_WARNING, mohinterpret, console_pvt::overridecontext, set_active(), store_callerid(), value, and var.
Referenced by build_device(), and load_config().
|
static |
Stream monitor thread.
This function runs in its own thread to monitor data coming in from a portaudio stream. When enough data is available, it is queued up to be read from the Asterisk channel.
Definition at line 265 of file chan_console.c.
References console_pvt::abort, ast_format_slin16, AST_FRAME_VOICE, ast_log, ast_queue_frame(), buf, console_pvt_lock, console_pvt_unlock, ast_frame::frametype, LOG_WARNING, NULL, NUM_SAMPLES, console_pvt::owner, ast_frame::samples, and console_pvt::stream.
Referenced by start_stream().
|
static |
Definition at line 1499 of file chan_console.c.
References ao2_ref, ARRAY_LEN, ast_channel_unregister(), ast_cli_unregister_multiple(), ast_channel_tech::capabilities, cli_console, console_tech, globals, NULL, pvt_destructor(), pvts, and stop_streams().
|
inlinestatic |
Definition at line 240 of file chan_console.c.
Referenced by build_device(), cli_console_active(), cli_console_answer(), cli_console_autoanswer(), cli_console_dial(), cli_console_flash(), cli_console_hangup(), cli_console_mute(), cli_console_sendtext(), cli_list_devices(), console_hangup(), console_request(), destroy_pvts(), set_active(), and stop_streams().
|
static |
Definition at line 1592 of file chan_console.c.
|
static |
Definition at line 178 of file chan_console.c.
Referenced by destroy_pvts(), get_active_pvt(), and set_active().
|
static |
Definition at line 177 of file chan_console.c.
Referenced by cli_list_devices(), destroy_pvts(), get_active_pvt(), and set_active().
|
static |
Definition at line 1592 of file chan_console.c.
|
static |
Definition at line 1258 of file chan_console.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 116 of file chan_console.c.
Referenced by load_config().
|
static |
Definition at line 211 of file chan_console.c.
Referenced by console_new(), console_request(), load_module(), and unload_module().
|
static |
Global jitterbuffer configuration.
Definition at line 186 of file chan_console.c.
Referenced by load_config().
|
static |
Definition at line 193 of file chan_console.c.
Referenced by console_new(), load_config(), and store_config_core().
|
static |
Referenced by __ast_udptl_reload(), acf_jabberreceive_read(), acf_jabberstatus_read(), app_exec(), app_notify(), ast_get_builtin_feature(), ast_get_chan_applicationmap(), ast_get_chan_featuremap_config(), ast_get_chan_features_general_config(), ast_get_chan_features_pickup_config(), ast_get_chan_features_xfer_config(), ast_named_acl_find(), ast_udptl_new_with_bindaddr(), ast_xmpp_client_find(), cli_complete_notify(), cli_display_named_acl(), cli_display_named_acl_list(), cli_notify(), delete_old_messages(), generate_or_link_lots_to_configs(), get_feature_ds(), global_loaded_observer(), handle_cli_show_config(), handle_feature_show(), handle_show_named_acl_cmd(), handle_skel_show_config(), handle_skel_show_levels(), jingle_endpoint_state_find_or_create(), jingle_request(), load_config(), load_module(), manager_jabber_send(), manager_notify_endpoint(), manager_notify_uri(), parking_dynamic_lots_enabled(), remove_all_configured_parking_lot_extensions(), set_active(), set_pvt_defaults(), skel_find_or_create_state(), stasis_cleanup(), stasis_init(), stasis_message_type_declined(), store_config_core(), unbound_config_apply_default(), unbound_resolver_resolve(), unload_features_config(), unload_module(), xmpp_action_hook(), xmpp_cli_create_collection(), xmpp_cli_create_leafnode(), xmpp_cli_delete_pubsub_node(), xmpp_cli_list_pubsub_nodes(), xmpp_cli_purge_pubsub_nodes(), xmpp_client_config_post_apply(), xmpp_client_find_or_create(), xmpp_client_reconnect(), xmpp_client_send_message(), xmpp_client_set_group_presence(), xmpp_client_set_presence(), xmpp_client_thread(), xmpp_component_register_get_hook(), xmpp_component_service_discovery_get_hook(), xmpp_component_service_discovery_items_hook(), xmpp_config_post_apply(), xmpp_config_prelink(), xmpp_connect_hook(), xmpp_init_event_distribution(), xmpp_join_exec(), xmpp_leave_exec(), xmpp_log_hook(), xmpp_pubsub_build_publish_skeleton(), xmpp_pubsub_handle_error(), xmpp_pubsub_iq_create(), xmpp_pubsub_publish_device_state(), xmpp_pubsub_subscribe(), xmpp_roster_hook(), xmpp_send_cb(), xmpp_send_exec(), xmpp_sendgroup_exec(), xmpp_show_buddies(), and xmpp_show_clients().
|
static |
Definition at line 172 of file chan_console.c.
Referenced by load_config(), and set_pvt_defaults().
|
static |
Definition at line 174 of file chan_console.c.
Referenced by build_device(), cli_console_active(), cli_list_devices(), destroy_pvts(), find_pvt(), load_config(), load_module(), stop_streams(), and unload_module().