Asterisk - The Open Source Telephony Project
18.5.0
|
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 "pbx_private.h"
Go to the source code of this file.
Functions | |
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 *c, struct varshead *headp, const char *templ, size_t *used) |
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_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_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 [] |
PBX variables routines.
Definition in file pbx_variables.c.
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 246 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_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(), ast_var_t::entries, globalslock, NULL, and parse_variable_name().
Referenced by ast_ari_asterisk_get_global_var(), ast_ari_channels_get_channel_var(), ast_str_substitute_variables_full(), 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 616 of file pbx_variables.c.
References ast_str_substitute_variables_full(), and NULL.
Referenced by _macro_exec(), acf_odbc_read(), acf_odbc_write(), 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_getvariablefull(), import_helper(), listfilter(), make_email_file(), realtime_curl(), realtime_multi_curl(), replace(), require_curl(), run_app_helper(), sendmail(), sendpage(), shift_pop(), store_curl(), strreplace(), syslog_log(), 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 394 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_substring(), ast_strlen_zero, len(), LOG_ERROR, LOG_WARNING, NULL, and parse_variable_name().
Referenced by ast_str_substitute_variables(), and ast_str_substitute_variables_varshead().
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 621 of file pbx_variables.c.
References ast_str_substitute_variables_full(), and NULL.
Referenced by build_user_routes(), handle_aor(), handle_registrations(), and pp_each_extension_helper().
|
static |
Definition at line 185 of file pbx_variables.c.
References ast_str_buffer(), ast_str_reset(), ast_str_strlen(), ast_str_truncate(), and ast_str_update().
Referenced by ast_str_retrieve_variable(), and ast_str_substitute_variables_full().
|
static |
Definition at line 932 of file pbx_variables.c.
References ast_cli_args::argc, ast_cli_entry::args, ast_cli_args::argv, 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, ast_cli_args::fd, ast_cli_args::line, ast_cli_args::n, NULL, pbx_builtin_setvar_helper(), ast_cli_args::pos, ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Definition at line 910 of file pbx_variables.c.
References ast_cli_args::argc, ast_cli_entry::args, ast_cli_args::argv, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, 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 874 of file pbx_variables.c.
References ast_cli_args::argc, ast_cli_entry::args, ast_cli_args::argv, 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, ast_cli_args::fd, ast_cli_args::line, ast_cli_args::n, NULL, ast_cli_args::pos, ast_cli_entry::usage, var, and ast_cli_args::word.
|
static |
CLI support for listing global variables in a parseable way.
Definition at line 846 of file pbx_variables.c.
References 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, ast_cli_args::fd, globalslock, NULL, and ast_cli_entry::usage.
int load_pbx_variables | ( | void | ) |
Provided by pbx_variables.c
Definition at line 1216 of file pbx_variables.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_register_application2(), ast_register_cleanup(), NULL, pbx_builtin_setvar(), pbx_builtin_setvar_multiple(), and unload_pbx_variables().
Referenced by asterisk_daemon().
|
static |
extract offset:length from variable name.
Definition at line 116 of file pbx_variables.c.
References var.
Referenced by ast_str_retrieve_variable(), ast_str_substitute_variables_full(), and pbx_substitute_variables_helper_full().
void pbx_builtin_clear_globals | ( | void | ) |
Definition at line 1191 of file pbx_variables.c.
References AST_LIST_REMOVE_HEAD, ast_rwlock_unlock, ast_rwlock_wrlock, ast_var_delete(), ast_var_t::entries, 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 1000 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(), globalslock, and NULL.
Referenced by __ast_pbx_run(), _if_exec(), _macro_exec(), _while_exec(), action_agents(), add_header_from_channel_var(), agent_handle_show_specific(), agent_login_channel_config(), agent_request_exec(), agent_show_requested(), aMYSQL_connect(), analog_call(), array(), ast_bridge_timelimit(), ast_bridge_transfer_attended(), ast_call_forward(), ast_channel_connected_line_macro(), ast_channel_connected_line_sub(), ast_channel_redirecting_macro(), ast_channel_redirecting_sub(), ast_eivr_getvariable(), ast_get_chan_applicationmap(), ast_monitor_stop(), ast_unreal_hangup(), attended_transfer_exec(), bridge_check_monitor(), 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(), dundi_helper(), eagi_exec(), feature_automixmonitor(), feature_automonitor(), feature_blind_transfer(), find_by_mark(), find_channel_parking_lot_name(), find_conf_realtime(), func_channel_read(), generate_parked_user(), generic_fax_exec(), get_also_info(), get_index(), get_refer_info(), get_transfer_context(), global_read(), gosub_run(), handle_call_forward(), handle_clear_alarms(), handle_gosub(), handle_hangup(), hash_read(), iax2_call(), iax2_exec(), import_ch(), leave_voicemail(), local_read(), macro_fixup(), manager_mixmonitor(), meetme_menu_admin_extended(), mgcp_call(), minivm_delete_exec(), minivm_notify_exec(), misdn_answer(), misdn_hangup(), morsecode_exec(), notify_new_message(), ooh323_call(), ooh323_hangup(), park_app_exec(), pbx_builtin_background(), pbx_builtin_gotoiftime(), pbx_builtin_saycharacters(), pbx_builtin_saycharacters_case(), pbx_builtin_saydigits(), pbx_builtin_saymoney(), pbx_builtin_saynumber(), pbx_builtin_sayphonetic(), pre_bridge_setup(), queue_exec(), receive_ademco_event(), report_receive_fax_status(), report_send_fax_status(), retrydial_exec(), ring_entry(), run_agi(), sayunixtime_exec(), sendtext_exec(), set_from_header(), set_local_info(), set_touch_variable(), set_transfer_variables_all(), setsubstate(), setup_mixmonitor(), setup_park_common_datastore(), sip_addheader(), sla_trunk_exec(), speech_background(), transfer_refer(), try_calling(), try_suggested_sip_codec(), 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 1038 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, and LOG_WARNING.
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 969 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(), 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 1129 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 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 1071 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, and name.
Referenced by __analog_ss_thread(), __ast_pbx_run(), _if_exec(), _macro_exec(), _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(), aMYSQL_fetch(), aMYSQL_set(), 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_monitor_start(), ast_monitor_stop(), 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_cb(), blind_transfer_exec(), bridge_channel_internal_push_full(), bridge_exec(), bridgeadd_exec(), calendar_write_exec(), caller_joined_bridge(), caller_safety_timeout(), cb_events(), 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(), 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(), export_aoc_vars(), export_ch(), extract_transferrer_headers(), fax_detect_framehook(), frame_set_var(), func_mchan_write(), function_db_delete(), function_db_exists(), function_db_read(), function_realtime_store(), generic_recall(), get_chan_by_ast_name(), get_rdnis(), get_refer_info(), global_write(), gosub_release_frame(), gosub_run(), handle_controlstreamfile(), handle_gosub(), handle_incoming_request(), handle_outgoing_response(), handle_request_bye(), handle_response_cmgr(), handle_set_chanvar(), handle_set_global(), handle_setvariable(), handle_streamfile(), hash_read(), hash_write(), isAnsweringMachine(), kick_conference_participant(), launch_monitor_thread(), leave_marked(), leave_queue(), leave_voicemail(), lua_set_variable(), lua_set_variable_value(), macro_fixup(), mbl_status_exec(), mgcp_new(), minivm_accmess_exec(), minivm_delete_exec(), minivm_greet_exec(), minivm_notify_exec(), minivm_record_exec(), misdn_call(), mixmonitor_exec(), msg_send_exec(), my_handle_dtmf(), MYSQL_exec(), onModeChanged(), ooh323_new(), ooh323_rtp_read(), originate_exec(), ospauth_exec(), ospfinished_exec(), osplookup_exec(), ospnext_exec(), parking_duration_callback(), parking_timeout_set_caller_features(), parse_moved_contact(), pbx_builtin_background(), pbx_builtin_gotoiftime(), pbx_builtin_importvar(), pbx_builtin_setvar(), pbx_builtin_setvar_multiple(), pbx_builtin_waitdigit(), pbx_load_config(), phase_e_handler(), play_message_datetime(), playback_exec(), pqm_exec(), prep_email_sub_vars(), privacy_exec(), process_ast_dsp(), process_sdp(), 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(), refer_blind_callback(), reload(), reload_module(), return_exec(), rollback_exec(), rotate_file(), rqm_exec(), select_entry(), select_item_menu(), select_item_seq(), sendfax_exec(), sendimage_exec(), sendtext_exec(), sendurl_exec(), set(), set_asterisk_int(), set_channel_variables(), set_duration_var(), set_queue_result(), set_sipdomain_variable(), setsubstate(), shift_pop(), sip_addheader(), sip_hangup(), sip_new(), sip_read(), skinny_new(), sla_calc_trunk_timeouts(), sla_station_exec(), sla_trunk_exec(), speech_create(), start_automixmonitor(), start_automonitor(), start_monitor_exec(), system_exec_helper(), test_chan_variable(), testtime_write(), transfer_exec(), transmit(), tryexec_exec(), unicast_rtp_request(), unshift_push(), update_qe_rule(), upqm_exec(), user_timeout(), vm_allocate_dh(), vm_exec(), vm_playmsgexec(), vmauthenticate(), wait_exec(), wait_for_answer(), 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 1155 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 235 of file pbx_variables.c.
References ast_copy_string(), ast_free, ast_str_buffer(), ast_str_create, ast_str_retrieve_variable(), NULL, and str.
Referenced by action_getvar(), generate_status(), handle_getvariable(), lua_get_variable(), lua_get_variable_value(), and pbx_substitute_variables_helper_full().
void pbx_substitute_variables_helper | ( | struct ast_channel * | c, |
const char * | cp1, | ||
char * | cp2, | ||
int | count | ||
) |
Definition at line 835 of file pbx_variables.c.
References ast_channel_varshead(), NULL, and pbx_substitute_variables_helper_full().
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 626 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, len(), LOG_ERROR, LOG_WARNING, NULL, parse_variable_name(), pbx_retrieve_variable(), substring(), var, and VAR_BUF_SIZE.
Referenced by pbx_substitute_variables_helper(), and pbx_substitute_variables_varshead().
void pbx_substitute_variables_varshead | ( | struct varshead * | headp, |
const char * | cp1, | ||
char * | cp2, | ||
int | count | ||
) |
Definition at line 840 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 149 of file pbx_variables.c.
References ast_copy_string().
Referenced by pbx_substitute_variables_helper_full().
|
static |
Definition at line 1208 of file pbx_variables.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), ast_unregister_application(), and pbx_builtin_clear_globals().
Referenced by load_pbx_variables().
|
static |
Definition at line 109 of file pbx_variables.c.
Referenced by pbx_builtin_pushvar_helper(), and pbx_builtin_setvar_helper().
|
static |
Definition at line 108 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 1201 of file pbx_variables.c.