Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
PBX variables routines. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/app.h"
#include "asterisk/ast_expr.h"
#include "asterisk/chanvars.h"
#include "asterisk/cli.h"
#include "asterisk/linkedlists.h"
#include "asterisk/lock.h"
#include "asterisk/module.h"
#include "asterisk/paths.h"
#include "asterisk/pbx.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/test.h"
#include "pbx_private.h"
Go to the source code of this file.
Macros | |
#define | MAX_VARIABLE_SUB_RECURSE_DEPTH 15 |
Functions | |
static void | __init_varsub_recurse_level (void) |
Thread local keeping track of recursion depth. More... | |
const char * | ast_str_retrieve_variable (struct ast_str **str, ssize_t maxlen, struct ast_channel *c, struct varshead *headp, const char *var) |
void | ast_str_substitute_variables (struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ) |
void | ast_str_substitute_variables_full (struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, struct varshead *headp, const char *templ, size_t *used) |
void | ast_str_substitute_variables_full2 (struct ast_str **buf, ssize_t maxlen, struct ast_channel *c, struct varshead *headp, const char *templ, size_t *used, int use_both) |
Perform variable/function/expression substitution on an ast_str. More... | |
void | ast_str_substitute_variables_varshead (struct ast_str **buf, ssize_t maxlen, struct varshead *headp, const char *templ) |
static const char * | ast_str_substring (struct ast_str *value, int offset, int length) |
static char * | handle_eval_function (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI support for executing function. More... | |
static char * | handle_set_chanvar (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_set_global (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_show_chanvar (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI support for listing chanvar's variables in a parseable way. More... | |
static char * | handle_show_globals (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI support for listing global variables in a parseable way. More... | |
int | load_pbx_variables (void) |
static int | parse_variable_name (char *var, int *offset, int *length, int *isfunc) |
extract offset:length from variable name. More... | |
void | pbx_builtin_clear_globals (void) |
const char * | pbx_builtin_getvar_helper (struct ast_channel *chan, const char *name) |
Return a pointer to the value of the corresponding channel variable. More... | |
void | pbx_builtin_pushvar_helper (struct ast_channel *chan, const char *name, const char *value) |
Add a variable to the channel variable stack, without removing any previously set value. More... | |
int | pbx_builtin_serialize_variables (struct ast_channel *chan, struct ast_str **buf) |
Create a human-readable string, specifying all variables and their corresponding values. More... | |
int | pbx_builtin_setvar (struct ast_channel *chan, const char *data) |
Parse and set a single channel variable, where the name and value are separated with an '=' character. More... | |
int | pbx_builtin_setvar_helper (struct ast_channel *chan, const char *name, const char *value) |
Add a variable to the channel variable stack, removing the most recently set value for the same name. More... | |
int | pbx_builtin_setvar_multiple (struct ast_channel *chan, const char *vdata) |
Parse and set multiple channel variables, where the pairs are separated by the ',' character, and name and value are separated with an '=' character. More... | |
void | pbx_retrieve_variable (struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp) |
Support for Asterisk built-in variables in the dialplan. More... | |
void | pbx_substitute_variables_helper (struct ast_channel *c, const char *cp1, char *cp2, int count) |
void | pbx_substitute_variables_helper_full (struct ast_channel *c, struct varshead *headp, const char *cp1, char *cp2, int count, size_t *used) |
void | pbx_substitute_variables_helper_full_location (struct ast_channel *c, struct varshead *headp, const char *cp1, char *cp2, int count, size_t *used, const char *context, const char *exten, int pri) |
Substitutes variables, similar to pbx_substitute_variables_helper_full, but allows passing the context, extension, and priority in. More... | |
void | pbx_substitute_variables_varshead (struct varshead *headp, const char *cp1, char *cp2, int count) |
static char * | substring (const char *value, int offset, int length, char *workspace, size_t workspace_len) |
takes a substring. It is ok to call with value == workspace. More... | |
static void | unload_pbx_variables (void) |
Variables | |
static struct varshead | globals = AST_LIST_HEAD_NOLOCK_INIT_VALUE |
static ast_rwlock_t | globalslock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } |
static struct ast_cli_entry | vars_cli [] |
static struct ast_threadstorage | varsub_recurse_level = { .once = PTHREAD_ONCE_INIT , .key_init = __init_varsub_recurse_level , .custom_init = NULL , } |
PBX variables routines.
Definition in file pbx_variables.c.
#define MAX_VARIABLE_SUB_RECURSE_DEPTH 15 |
Definition at line 668 of file pbx_variables.c.
|
static |
const char * ast_str_retrieve_variable | ( | struct ast_str ** | buf, |
ssize_t | maxlen, | ||
struct ast_channel * | chan, | ||
struct varshead * | headp, | ||
const char * | var | ||
) |
buf | Result will be placed in this buffer. |
maxlen | -1 if the buffer should not grow, 0 if the buffer may grow to any size, and >0 if the buffer should grow only to that number of bytes. |
chan | Channel variables from which to extract values, and channel to pass to any dialplan functions. |
headp | If no channel is specified, a channel list from which to extract variable values |
var | Variable name to retrieve. |
Definition at line 250 of file pbx_variables.c.
References ARRAY_LEN, ast_channel_caller(), ast_channel_context(), ast_channel_dialed(), ast_channel_exten(), ast_channel_hangupcause(), ast_channel_lock, ast_channel_name(), ast_channel_priority(), ast_channel_uniqueid(), ast_channel_unlock, ast_channel_varshead(), ast_config_AST_AGI_DIR, ast_config_AST_CACHE_DIR, ast_config_AST_CONFIG_DIR, ast_config_AST_DATA_DIR, ast_config_AST_DB, ast_config_AST_KEY_DIR, ast_config_AST_LOG_DIR, ast_config_AST_MODULE_DIR, ast_config_AST_RUN_DIR, ast_config_AST_SBIN_DIR, ast_config_AST_SPOOL_DIR, ast_config_AST_SYSTEM_NAME, ast_config_AST_VAR_DIR, ast_debug, ast_eid_default, ast_eid_to_str(), AST_LIST_TRAVERSE, ast_party_id_presentation(), ast_rwlock_rdlock, ast_rwlock_unlock, ast_str_buffer(), ast_str_get_hint(), ast_str_set(), ast_str_substring(), ast_strdupa, ast_var_name(), ast_var_value(), c, ast_var_t::entries, globals, globalslock, NULL, parse_variable_name(), str, and var.
Referenced by ast_ari_asterisk_get_global_var(), ast_ari_channels_get_channel_var(), ast_str_substitute_variables_full2(), and pbx_retrieve_variable().
void ast_str_substitute_variables | ( | struct ast_str ** | buf, |
ssize_t | maxlen, | ||
struct ast_channel * | chan, | ||
const char * | templ | ||
) |
buf | Result will be placed in this buffer. |
maxlen | -1 if the buffer should not grow, 0 if the buffer may grow to any size, and >0 if the buffer should grow only to that number of bytes. |
chan | Channel variables from which to extract values, and channel to pass to any dialplan functions. |
templ | Variable template to expand. |
Definition at line 650 of file pbx_variables.c.
References ast_str_substitute_variables_full(), buf, and NULL.
Referenced by acf_odbc_read(), acf_odbc_write(), ast_pbx_exec_application(), AST_TEST_DEFINE(), cli_odbc_read(), cli_odbc_write(), config_curl(), custom_log(), cut_internal(), destroy_curl(), do_notify(), exec_exec(), func_mchan_read(), function_eval2(), function_fieldnum_helper(), function_fieldqty_helper(), handle_exec(), handle_getvariablefull(), import_helper(), json_decode_read(), listfilter(), make_email_file(), realtime_curl(), realtime_multi_curl(), replace(), require_curl(), sendmail(), sendpage(), shift_pop(), store_curl(), strbetween(), strreplace(), test_2way_function(), test_chan_function(), test_chan_integer(), test_chan_integer_accessor(), test_chan_string(), test_chan_variable(), test_expected_result(), tryexec_exec(), unshift_push(), update2_curl(), and update_curl().
void ast_str_substitute_variables_full | ( | struct ast_str ** | buf, |
ssize_t | maxlen, | ||
struct ast_channel * | c, | ||
struct varshead * | headp, | ||
const char * | templ, | ||
size_t * | used | ||
) |
buf | Result will be placed in this buffer. |
maxlen | -1 if the buffer should not grow, 0 if the buffer may grow to any size, and >0 if the buffer should grow only to that number of bytes. |
c | Channel variables from which to extract values, and channel to pass to any dialplan functions. |
headp | If no channel is specified, a channel list from which to extract variable values |
templ | Variable template to expand. |
used | Number of bytes read from the template. (May be NULL) |
Definition at line 644 of file pbx_variables.c.
References ast_str_substitute_variables_full2(), and buf.
Referenced by ast_str_substitute_variables(), and ast_str_substitute_variables_varshead().
void ast_str_substitute_variables_full2 | ( | struct ast_str ** | buf, |
ssize_t | maxlen, | ||
struct ast_channel * | c, | ||
struct varshead * | headp, | ||
const char * | templ, | ||
size_t * | used, | ||
int | use_both | ||
) |
Perform variable/function/expression substitution on an ast_str.
buf | Result will be placed in this buffer. |
maxlen | -1 if the buffer should not grow, 0 if the buffer may grow to any size, and >0 if the buffer should grow only to that number of bytes. |
c | A channel from which to extract values, and to pass to any dialplan functions. |
headp | A channel variables list to also search for variables. |
templ | Variable template to expand. |
used | Number of bytes read from the template. (May be NULL) |
use_both | Normally, if a channel is specified, headp is ignored. If this parameter is set to 1 and both a channel and headp are specified, the channel will be searched for variables first and any not found will be searched for in headp. |
Definition at line 400 of file pbx_variables.c.
References ast_channel_unref, ast_channel_varshead(), ast_debug, ast_dummy_channel_alloc, ast_free, ast_func_read2(), ast_log, ast_str_append(), ast_str_append_substr(), ast_str_buffer(), ast_str_create, ast_str_expr(), ast_str_reset(), ast_str_retrieve_variable(), ast_str_set_substr(), ast_str_strlen(), ast_str_substitute_variables_full2(), ast_str_substring(), ast_strlen_zero(), buf, c, len(), LOG_ERROR, LOG_WARNING, NULL, parse_variable_name(), result, and S_OR.
Referenced by ast_str_substitute_variables_full(), ast_str_substitute_variables_full2(), and geoloc_eprofile_resolve_varlist().
void ast_str_substitute_variables_varshead | ( | struct ast_str ** | buf, |
ssize_t | maxlen, | ||
struct varshead * | headp, | ||
const char * | templ | ||
) |
buf | Result will be placed in this buffer. |
maxlen | -1 if the buffer should not grow, 0 if the buffer may grow to any size, and >0 if the buffer should grow only to that number of bytes. |
headp | If no channel is specified, a channel list from which to extract variable values |
templ | Variable template to expand. |
Definition at line 655 of file pbx_variables.c.
References ast_str_substitute_variables_full(), buf, and NULL.
Referenced by add_user_extension(), build_user_routes(), handle_aor(), handle_registrations(), phoneprov_callback(), pp_each_extension_helper(), and pp_each_user_helper().
|
static |
Definition at line 187 of file pbx_variables.c.
References ast_assert, ast_str_buffer(), ast_str_reset(), ast_str_strlen(), ast_str_truncate(), ast_str_update(), and value.
Referenced by ast_str_retrieve_variable(), and ast_str_substitute_variables_full2().
|
static |
CLI support for executing function.
Definition at line 982 of file pbx_variables.c.
References a, ast_cli_entry::args, ast_channel_unref, ast_cli(), ast_dummy_channel_alloc, ast_func_read(), ast_strdupa, c, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, pbx_substitute_variables_helper(), substituted(), and ast_cli_entry::usage.
|
static |
Definition at line 1049 of file pbx_variables.c.
References a, ast_cli_entry::args, ast_channel_get_by_name(), ast_channel_unref, ast_cli(), ast_complete_channels(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, pbx_builtin_setvar_helper(), and ast_cli_entry::usage.
|
static |
Definition at line 1027 of file pbx_variables.c.
References a, ast_cli_entry::args, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, pbx_builtin_setvar_helper(), and ast_cli_entry::usage.
|
static |
CLI support for listing chanvar's variables in a parseable way.
Definition at line 945 of file pbx_variables.c.
References a, ast_cli_entry::args, ast_channel_get_by_name(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, ast_channel_varshead(), ast_cli(), ast_complete_channels(), AST_LIST_TRAVERSE, ast_var_name(), ast_var_value(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_var_t::entries, NULL, ast_cli_entry::usage, and var.
|
static |
CLI support for listing global variables in a parseable way.
Definition at line 917 of file pbx_variables.c.
References a, ast_cli(), AST_LIST_TRAVERSE, ast_rwlock_rdlock, ast_rwlock_unlock, ast_var_name(), ast_var_value(), CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_var_t::entries, globals, globalslock, NULL, and ast_cli_entry::usage.
int load_pbx_variables | ( | void | ) |
Provided by pbx_variables.c
Definition at line 1403 of file pbx_variables.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_register_application2(), ast_register_cleanup(), AST_TEST_REGISTER, NULL, pbx_builtin_setvar(), pbx_builtin_setvar_multiple(), unload_pbx_variables(), and vars_cli.
Referenced by asterisk_daemon().
|
static |
extract offset:length from variable name.
Definition at line 118 of file pbx_variables.c.
References var.
Referenced by ast_str_retrieve_variable(), ast_str_substitute_variables_full2(), and pbx_substitute_variables_helper_full_location().
void pbx_builtin_clear_globals | ( | void | ) |
Definition at line 1308 of file pbx_variables.c.
References AST_LIST_REMOVE_HEAD, ast_rwlock_unlock, ast_rwlock_wrlock, ast_var_delete(), ast_var_t::entries, globals, and globalslock.
Referenced by handle_cli_dialplan_reload(), reload(), and unload_pbx_variables().
const char * pbx_builtin_getvar_helper | ( | struct ast_channel * | chan, |
const char * | name | ||
) |
Return a pointer to the value of the corresponding channel variable.
Definition at line 1117 of file pbx_variables.c.
References ast_channel_lock, ast_channel_unlock, ast_channel_varshead(), AST_LIST_TRAVERSE, ast_rwlock_rdlock, ast_rwlock_unlock, ast_var_name(), ast_var_value(), globals, globalslock, name, and NULL.
Referenced by __ast_pbx_run(), _while_exec(), action_agents(), add_header_from_channel_var(), agent_handle_show_specific(), agent_login_channel_config(), agent_request_exec(), agent_show_requested(), analog_call(), array(), ast_bridge_call_with_flags(), ast_bridge_timelimit(), ast_bridge_transfer_attended(), ast_call_forward(), ast_channel_connected_line_sub(), ast_channel_redirecting_sub(), ast_eivr_getvariable(), ast_get_chan_applicationmap(), ast_unreal_hangup(), attended_transfer_exec(), bridge_parking_push(), channel_get_external_vars(), check_bridge_play_sound(), common_exec(), conf_run(), create_dynamic_lot_full(), crement_function_read(), dahdi_hangup(), dial_exec_full(), do_forward(), dundi_exec(), eagi_exec(), eval_sub_read(), feature_automixmonitor(), feature_blind_transfer(), find_by_mark(), find_channel_parking_lot_name(), find_conf_realtime(), func_channel_read(), generate_parked_user(), generic_fax_exec(), get_index(), get_transfer_context(), get_transfer_exten(), global_exists_read(), global_read(), gosub_run(), handle_call_forward(), handle_exec(), handle_gosub(), handle_hangup(), hash_read(), iax2_call(), iax2_exec(), if_helper(), leave_voicemail(), local_read(), manager_mixmonitor(), meetme_menu_admin_extended(), minivm_delete_exec(), minivm_notify_exec(), morsecode_exec(), notify_new_message(), ooh323_call(), ooh323_hangup(), park_app_exec(), pbx_builtin_gotoiftime(), permit_dtmf_interrupt(), pjsip_acf_parse_uri_read(), pre_bridge_setup(), queue_exec(), receive_ademco_event(), refer_blind_callback(), report_receive_fax_status(), report_send_fax_status(), retrydial_exec(), run_agi(), sayunixtime_exec(), sendtext_exec(), set_from_header(), set_touch_variable(), set_transfer_variables_all(), setup_mixmonitor(), setup_park_common_datastore(), sla_trunk_exec(), speech_background(), transfer_refer(), try_calling(), variable_exists_read(), and wait_for_answer().
void pbx_builtin_pushvar_helper | ( | struct ast_channel * | chan, |
const char * | name, | ||
const char * | value | ||
) |
Add a variable to the channel variable stack, without removing any previously set value.
Definition at line 1155 of file pbx_variables.c.
References ast_channel_lock, ast_channel_unlock, ast_channel_varshead(), ast_func_write(), AST_LIST_INSERT_HEAD, ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, ast_strdupa, ast_var_assign, ast_verb, globals, globalslock, LOG_WARNING, name, and value.
Referenced by acf_odbc_read(), acf_odbc_write(), cli_odbc_read(), cli_odbc_write(), and frame_set_var().
int pbx_builtin_serialize_variables | ( | struct ast_channel * | chan, |
struct ast_str ** | buf | ||
) |
Create a human-readable string, specifying all variables and their corresponding values.
chan | Channel from which to read variables |
buf | Dynamic string in which to place the result (should be allocated with ast_str_create). |
Definition at line 1086 of file pbx_variables.c.
References ast_channel_lock, ast_channel_unlock, ast_channel_varshead(), AST_LIST_TRAVERSE, ast_log, ast_str_append(), ast_str_reset(), ast_var_name(), ast_var_value(), buf, ast_var_t::entries, LOG_ERROR, total, and var.
Referenced by ast_var_channels_table(), and dumpchan_exec().
int pbx_builtin_setvar | ( | struct ast_channel * | chan, |
const char * | data | ||
) |
Parse and set a single channel variable, where the name and value are separated with an '=' character.
Definition at line 1246 of file pbx_variables.c.
References ast_log, ast_strdupa, ast_strlen_zero(), LOG_WARNING, name, pbx_builtin_setvar_helper(), strsep(), and value.
Referenced by ast_compile_ael2(), and load_pbx_variables().
int pbx_builtin_setvar_helper | ( | struct ast_channel * | chan, |
const char * | name, | ||
const char * | value | ||
) |
Add a variable to the channel variable stack, removing the most recently set value for the same name.
True if the old value was not an empty string.
Definition at line 1188 of file pbx_variables.c.
References ast_channel_lock, ast_channel_publish_varset(), ast_channel_unlock, ast_channel_varshead(), ast_func_write(), AST_LIST_INSERT_HEAD, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_rwlock_unlock, ast_rwlock_wrlock, ast_strdupa, ast_strlen_zero(), ast_var_assign, ast_var_delete(), ast_var_name(), ast_var_value(), ast_verb, globals, globalslock, name, and value.
Referenced by __analog_ss_thread(), __ast_pbx_run(), _while_exec(), acf_curl_helper(), acf_fetch(), acf_odbc_read(), acf_odbc_write(), acf_transaction_write(), action_atxfer(), action_kick_last(), action_setvar(), admin_exec(), agent_login_exec(), agent_request_exec(), agi_exec_full(), analog_ss_thread(), app_control_set_channel_var(), app_exec(), aqm_exec(), array(), ast_ari_asterisk_set_global_var(), ast_bridge_set_transfer_variables(), ast_bridge_vars_set(), ast_call_forward(), ast_cc_agent_set_interfaces_chanvar(), ast_eivr_setvariable(), ast_iax2_new(), ast_pbx_outgoing_exten_predial(), ast_pickup_call(), ast_rtp_instance_set_stats_vars(), ast_set_cc_interfaces_chanvar(), ast_set_variables(), AST_TEST_DEFINE(), ast_unreal_hangup(), asyncgoto_exec(), attended_transfer_bridge(), attended_transfer_exec(), audiosocket_request(), background_detect_exec(), begin_dial_channel(), blind_transfer_bridge(), blind_transfer_exec(), bridge_channel_internal_push_full(), bridge_exec(), bridgeadd_exec(), calendar_write_exec(), caller_joined_bridge(), caller_safety_timeout(), cccancel_exec(), ccreq_exec(), chan_pjsip_cng_tone_detected(), chan_pjsip_new(), chanavail_exec(), channel_spy(), check_bridge_play_sound(), clear_agent_status(), commit_exec(), conf_run(), confbridge_exec(), confkick_exec(), controlplayback_exec(), count_exec(), crement_function_read(), dahdi_handle_dtmf(), dahdi_new(), delete_write(), dial_exec_full(), dial_transfer(), directory_exec(), disa_exec(), do_directory(), do_forward(), do_notify(), do_waiting(), dtmf_store_framehook(), dynamic_dtmf_hook_callback(), end_bridge_callback(), execute_menu_entry(), fax_detect_framehook(), frame_set_var(), func_export_write(), func_mchan_write(), function_db_delete(), function_db_exists(), function_db_read(), function_realtime_store(), generic_recall(), geoloc_profile_read(), geoloc_profile_write(), global_delete_write(), global_write(), gosub_release_frame(), gosub_run(), handle_controlstreamfile(), handle_gosub(), handle_incoming_request(), handle_outgoing_response(), handle_response_cmgr(), handle_set_chanvar(), handle_set_global(), handle_setvariable(), handle_streamfile(), hash_read(), hash_write(), if_helper(), isAnsweringMachine(), kick_conference_participant(), launch_monitor_thread(), leave_marked(), leave_queue(), leave_voicemail(), lua_set_variable(), lua_set_variable_value(), manager_park(), mbl_status_exec(), minivm_accmess_exec(), minivm_delete_exec(), minivm_greet_exec(), minivm_notify_exec(), minivm_record_exec(), mixmonitor_exec(), msg_send_exec(), my_get_callerid(), my_handle_dtmf(), onModeChanged(), ooh323_new(), ooh323_rtp_read(), originate_exec(), parking_duration_callback(), parking_timeout_set_caller_features(), pbx_builtin_background(), pbx_builtin_gotoiftime(), pbx_builtin_setvar(), pbx_builtin_setvar_multiple(), pbx_builtin_waitdigit(), pbx_load_config(), play_message_datetime(), playback_exec(), pqm_exec(), prep_email_sub_vars(), privacy_exec(), queue_exec(), read_exec(), read_mf_digits(), read_mf_exec(), read_sf_digits(), read_sf_exec(), readexten_exec(), realtimefield_read(), receivefax_exec(), record_abandoned(), record_exec(), recvtext_exec(), refer_blind_callback(), reload_exec(), reload_module(), return_exec(), ring_entry(), rollback_exec(), rotate_file(), rqm_exec(), scan_exec(), select_entry(), select_item_menu(), select_item_seq(), sendfax_exec(), sendtext_exec(), set(), set_channel_variables(), set_duration_var(), set_queue_result(), set_sipdomain_variable(), shift_pop(), signal_exec(), sla_calc_trunk_timeouts(), sla_station_exec(), sla_trunk_exec(), speech_create(), start_automixmonitor(), system_exec_helper(), test_chan_variable(), testtime_write(), transfer_exec(), tryexec_exec(), unicast_rtp_request(), unshift_push(), update_qe_rule(), upqm_exec(), user_timeout(), vm_exec(), vm_playmsgexec(), vmauthenticate(), wait_exec(), wait_for_answer(), wait_for_signal_or_hangup(), waitforcond_exec(), waitsignal_exec(), waituntil_exec(), and zapateller_exec().
int pbx_builtin_setvar_multiple | ( | struct ast_channel * | chan, |
const char * | data | ||
) |
Parse and set multiple channel variables, where the pairs are separated by the ',' character, and name and value are separated with an '=' character.
Definition at line 1272 of file pbx_variables.c.
References args, AST_APP_ARG, ast_channel_context(), ast_channel_exten(), ast_channel_priority(), AST_DECLARE_APP_ARGS, ast_log, AST_NONSTANDARD_APP_ARGS, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), LOG_WARNING, name, pair::name, pbx_builtin_setvar_helper(), and value.
Referenced by load_pbx_variables(), queue_function_var(), set_queue_variables(), and try_calling().
void pbx_retrieve_variable | ( | struct ast_channel * | c, |
const char * | var, | ||
char ** | ret, | ||
char * | workspace, | ||
int | workspacelen, | ||
struct varshead * | headp | ||
) |
Support for Asterisk built-in variables in the dialplan.
Retrieve the value of a builtin variable or variable from the channel variable stack.
Definition at line 239 of file pbx_variables.c.
References ast_copy_string(), ast_free, ast_str_buffer(), ast_str_create, ast_str_retrieve_variable(), c, NULL, str, and var.
Referenced by action_getvar(), generate_status(), handle_getvariable(), lua_get_variable(), lua_get_variable_value(), and pbx_substitute_variables_helper_full_location().
void pbx_substitute_variables_helper | ( | struct ast_channel * | c, |
const char * | cp1, | ||
char * | cp2, | ||
int | count | ||
) |
Definition at line 906 of file pbx_variables.c.
References ast_channel_varshead(), c, NULL, and pbx_substitute_variables_helper_full().
Referenced by handle_eval_function().
void pbx_substitute_variables_helper_full | ( | struct ast_channel * | c, |
struct varshead * | headp, | ||
const char * | cp1, | ||
char * | cp2, | ||
int | count, | ||
size_t * | used | ||
) |
Definition at line 660 of file pbx_variables.c.
References c, NULL, and pbx_substitute_variables_helper_full_location().
Referenced by pbx_substitute_variables_helper(), and pbx_substitute_variables_varshead().
void pbx_substitute_variables_helper_full_location | ( | struct ast_channel * | c, |
struct varshead * | headp, | ||
const char * | cp1, | ||
char * | cp2, | ||
int | count, | ||
size_t * | used, | ||
const char * | context, | ||
const char * | exten, | ||
int | pri | ||
) |
Substitutes variables, similar to pbx_substitute_variables_helper_full, but allows passing the context, extension, and priority in.
Definition at line 670 of file pbx_variables.c.
References ast_channel_unref, ast_channel_varshead(), ast_copy_string(), ast_debug, ast_dummy_channel_alloc, ast_expr(), ast_func_read(), ast_log, ast_strlen_zero(), ast_threadstorage_get(), c, voicemailpwcheck::context, ast_channel::exten, len(), LOG_ERROR, LOG_WARNING, MAX_VARIABLE_SUB_RECURSE_DEPTH, NULL, parse_variable_name(), pbx_retrieve_variable(), pbx_substitute_variables_helper_full_location(), substring(), var, VAR_BUF_SIZE, and varsub_recurse_level.
Referenced by eval_exten_read(), pbx_substitute_variables_helper_full(), and pbx_substitute_variables_helper_full_location().
void pbx_substitute_variables_varshead | ( | struct varshead * | headp, |
const char * | cp1, | ||
char * | cp2, | ||
int | count | ||
) |
Definition at line 911 of file pbx_variables.c.
References NULL, and pbx_substitute_variables_helper_full().
Referenced by do_say(), dundi_lookup_local(), get_mapping_weight(), and loopback_subst().
|
static |
takes a substring. It is ok to call with value == workspace.
value | |
offset | < 0 means start from the end of the string and set the beginning to be that many characters back. |
length | is the length of the substring, a value less than 0 means to leave that many off the end. |
workspace | |
workspace_len | Always return a copy in workspace. |
Definition at line 151 of file pbx_variables.c.
References ast_copy_string(), and value.
Referenced by pbx_substitute_variables_helper_full_location().
|
static |
Definition at line 1394 of file pbx_variables.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), AST_TEST_UNREGISTER, ast_unregister_application(), pbx_builtin_clear_globals(), and vars_cli.
Referenced by load_pbx_variables().
|
static |
Definition at line 111 of file pbx_variables.c.
Referenced by ast_str_retrieve_variable(), handle_show_globals(), pbx_builtin_clear_globals(), pbx_builtin_getvar_helper(), pbx_builtin_pushvar_helper(), and pbx_builtin_setvar_helper().
|
static |
Definition at line 110 of file pbx_variables.c.
Referenced by ast_str_retrieve_variable(), handle_show_globals(), pbx_builtin_clear_globals(), pbx_builtin_getvar_helper(), pbx_builtin_pushvar_helper(), and pbx_builtin_setvar_helper().
|
static |
Definition at line 1386 of file pbx_variables.c.
Referenced by load_pbx_variables(), and unload_pbx_variables().
|
static |
Definition at line 666 of file pbx_variables.c.
Referenced by pbx_substitute_variables_helper_full_location().