Asterisk - The Open Source Telephony Project
21.4.1
|
Routines implementing call features as call pickup, parking and transfer. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include "features_config.h"
#include <pthread.h>
#include <signal.h>
#include <sys/time.h>
#include <netinet/in.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/causes.h"
#include "asterisk/module.h"
#include "asterisk/translate.h"
#include "asterisk/app.h"
#include "asterisk/say.h"
#include "asterisk/features.h"
#include "asterisk/musiconhold.h"
#include "asterisk/config.h"
#include "asterisk/cli.h"
#include "asterisk/manager.h"
#include "asterisk/utils.h"
#include "asterisk/devicestate.h"
#include "asterisk/audiohook.h"
#include "asterisk/global_datastores.h"
#include "asterisk/astobj2.h"
#include "asterisk/test.h"
#include "asterisk/bridge.h"
#include "asterisk/bridge_features.h"
#include "asterisk/bridge_basic.h"
#include "asterisk/bridge_after.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/features_config.h"
#include "asterisk/max_forwards.h"
#include "asterisk/stream.h"
Go to the source code of this file.
Data Structures | |
struct | ast_bridge_thread_obj |
struct | ast_dial_features |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | action_bridge (struct mansession *s, const struct message *m) |
Bridge channels together. More... | |
static int | add_features_datastore (struct ast_channel *chan, const struct ast_flags *my_features, const struct ast_flags *peer_features) |
static void | add_features_datastores (struct ast_channel *caller, struct ast_channel *callee, struct ast_bridge_config *config) |
int | ast_bridge_call (struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config) |
bridge the call and set CDR More... | |
int | ast_bridge_call_with_flags (struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, unsigned int flags) |
Bridge a call, and add additional flags to the bridge. More... | |
int | ast_bridge_timelimit (struct ast_channel *chan, struct ast_bridge_config *config, char *parse, struct timeval *calldurationlimit) |
parse L option and read associated channel variables to set warning, warning frequency, and timelimit More... | |
void | ast_channel_log (char *title, struct ast_channel *chan) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void | bridge_config_set_limits (struct ast_bridge_config *config, struct ast_bridge_features_limits *caller_limits, struct ast_bridge_features_limits *callee_limits) |
static void | bridge_config_set_limits_warning_values (struct ast_bridge_config *config, struct ast_bridge_features_limits *limits) |
static int | bridge_exec (struct ast_channel *chan, const char *data) |
Bridge channels. More... | |
static void | bridge_failed_peer_goto (struct ast_channel *chan, struct ast_channel *peer) |
static void * | dial_features_duplicate (void *data) |
static int | load_module (void) |
static enum play_tone_action | parse_playtone (const char *playtone_val) |
static int | pre_bridge_setup (struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, struct ast_bridge_features *chan_features, struct ast_bridge_features *peer_features, int noanswer) |
static void | set_bridge_features_on_config (struct ast_bridge_config *config, const char *features) |
static void | set_config_flags (struct ast_channel *chan, struct ast_bridge_config *config) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "Call Features" , .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 = "da6642af068ee5e6490c5b1d2cc1d238" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_features_config, .load_pri = AST_MODPRI_CORE, .requires = "extconfig", } |
static char * | app_bridge = "Bridge" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const struct ast_app_option | bridge_exec_options [128] = { [ 'p' ] = { .flag = BRIDGE_OPT_PLAYTONE }, [ 'F' ] = { .flag = OPT_CALLEE_GO_ON , .arg_index = OPT_ARG_CALLEE_GO_ON + 1 }, [ 'h' ] = { .flag = OPT_CALLEE_HANGUP }, [ 'H' ] = { .flag = OPT_CALLER_HANGUP }, [ 'k' ] = { .flag = OPT_CALLEE_PARK }, [ 'K' ] = { .flag = OPT_CALLER_PARK }, [ 'L' ] = { .flag = OPT_DURATION_LIMIT , .arg_index = OPT_ARG_DURATION_LIMIT + 1 }, [ 'n' ] = { .flag = OPT_NOANSWER }, [ 'S' ] = { .flag = OPT_DURATION_STOP , .arg_index = OPT_ARG_DURATION_STOP + 1 }, [ 't' ] = { .flag = OPT_CALLEE_TRANSFER }, [ 'T' ] = { .flag = OPT_CALLER_TRANSFER }, [ 'w' ] = { .flag = OPT_CALLEE_MONITOR }, [ 'W' ] = { .flag = OPT_CALLER_MONITOR }, [ 'x' ] = { .flag = OPT_CALLEE_KILL }, } |
static const struct ast_datastore_info | dial_features_info |
Routines implementing call features as call pickup, parking and transfer.
Definition in file features.c.
|
static |
Bridge channels together.
s | |
m | Make sure valid channels were specified, send errors if any of the channels could not be found/locked, answer channels if needed, create the placeholder channels and grab the other channels make the channels compatible, send error if we fail doing so setup the bridge thread object and start the bridge. |
0 |
Definition at line 726 of file features.c.
References ast_bridge_add_channel(), ast_bridge_basic_new(), ast_bridge_destroy(), ast_bridge_set_after_goto(), ast_channel_get_by_name_prefix(), ast_debug, AST_FLAG_IN_AUTOLOOP, ast_strdupa, astman_get_header(), astman_send_ack(), astman_send_error(), and RAII_VAR.
int ast_bridge_call | ( | struct ast_channel * | chan, |
struct ast_channel * | peer, | ||
struct ast_bridge_config * | config | ||
) |
bridge the call and set CDR
Bridge a call, optionally allowing redirection.
chan | The bridge considers this channel the caller. |
peer | The bridge considers this channel the callee. |
config | Configuration for this bridge. |
Set start time, check for two channels,check if monitor on check for feature activation, create new CDR
-1 | on failure to bridge. |
Definition at line 685 of file features.c.
References ast_bridge_call_with_flags().
Referenced by dial_exec_full().
int ast_bridge_call_with_flags | ( | struct ast_channel * | chan, |
struct ast_channel * | peer, | ||
struct ast_bridge_config * | config, | ||
unsigned int | flags | ||
) |
Bridge a call, and add additional flags to the bridge.
This does the same thing as ast_bridge_call, except that once the bridge is created, the provided flags are set on the bridge. The provided flags are added to the bridge's flags; they will not clear any flags already set.
chan | The calling channel |
peer | The called channel |
config | Bridge configuration for the channels |
flags | Additional flags to set on the created bridge |
Definition at line 595 of file features.c.
References ast_bridge_basic_new(), ast_bridge_basic_set_flags(), ast_bridge_destroy(), ast_bridge_features_cleanup(), ast_bridge_features_destroy(), ast_bridge_features_init(), ast_bridge_features_new(), ast_bridge_impart(), AST_BRIDGE_IMPART_CHAN_INDEPENDENT, AST_BRIDGE_IMPART_INHIBIT_JOIN_COLP, ast_bridge_join(), AST_BRIDGE_JOIN_INHIBIT_JOIN_COLP, AST_BRIDGE_JOIN_PASS_REFERENCE, AST_SOFTHANGUP_ASYNCGOTO, ast_bridge_config::end_bridge_callback, ast_bridge_config::end_bridge_callback_data, and pbx_builtin_getvar_helper().
Referenced by ast_bridge_call().
int ast_bridge_timelimit | ( | struct ast_channel * | chan, |
struct ast_bridge_config * | config, | ||
char * | parse, | ||
struct timeval * | calldurationlimit | ||
) |
parse L option and read associated channel variables to set warning, warning frequency, and timelimit
Definition at line 857 of file features.c.
References ast_strdup, ast_strdupa, ast_true(), pbx_builtin_getvar_helper(), and S_OR.
Referenced by bridge_exec(), and dial_exec_full().
|
static |
Bridge channels.
chan | |
data | channel to bridge with. |
Split data, check we aren't bridging with ourself, check valid channel, answer call if not already, check compatible channels, setup bridge config now bridge call, if transferred party hangs up return to PBX extension.
Definition at line 978 of file features.c.
References AST_APP_ARG, ast_app_parse_options(), ast_bridge_add_channel(), ast_bridge_basic_new(), ast_bridge_destroy(), ast_bridge_features_cleanup(), ast_bridge_features_destroy(), ast_bridge_features_init(), ast_bridge_features_new(), ast_bridge_join(), AST_BRIDGE_JOIN_PASS_REFERENCE, ast_bridge_set_after_go_on(), ast_bridge_timelimit(), ast_channel_cleanup, ast_channel_get_by_name_prefix(), ast_channel_unref, AST_DECLARE_APP_ARGS, AST_STANDARD_APP_ARGS, ast_strdupa, pbx_builtin_setvar_helper(), and ast_features_xfer_config::xfersound.
|
static |
Definition at line 281 of file features.c.