Asterisk - The Open Source Telephony Project
18.5.0
|
Core PBX routines and definitions. More...
#include "asterisk/channel.h"
#include "asterisk/sched.h"
#include "asterisk/devicestate.h"
#include "asterisk/presencestate.h"
#include "asterisk/chanvars.h"
#include "asterisk/hashtab.h"
#include "asterisk/stringfields.h"
#include "asterisk/xmldoc.h"
#include "asterisk/format.h"
Go to the source code of this file.
Data Structures | |
struct | ast_custom_function |
Data structure associated with a custom dialplan function. More... | |
struct | ast_device_state_info |
struct | ast_pbx |
struct | ast_pbx_args |
Options for ast_pbx_run() More... | |
struct | ast_state_cb_info |
struct | ast_switch |
struct | ast_timing |
struct | pbx_find_info |
Macros | |
#define | ast_custom_function_register(acf) __ast_custom_function_register(acf, AST_MODULE_SELF) |
Register a custom function. More... | |
#define | ast_custom_function_register_escalating(acf, escalation) __ast_custom_function_register_escalating(acf, escalation, AST_MODULE_SELF) |
Register a custom function which requires escalated privileges. More... | |
#define | AST_MAX_APP 32 |
#define | AST_PBX_GOTO_FAILED -3 |
#define | AST_PBX_KEEP 0 |
#define | AST_PBX_MAX_STACK 512 |
#define | AST_PBX_REPLACE 1 |
#define | PRIORITY_HINT -1 |
#define | STATUS_NO_CONTEXT 1 |
#define | STATUS_NO_EXTENSION 2 |
#define | STATUS_NO_LABEL 4 |
#define | STATUS_NO_PRIORITY 3 |
#define | STATUS_SUCCESS 5 |
#define | AST_PBX_HANGUP -1 |
Special return values from applications to the PBX. More... | |
#define | AST_PBX_OK 0 |
#define | AST_PBX_ERROR 1 |
#define | AST_PBX_INCOMPLETE 12 |
Typedefs | |
typedef void(* | ast_state_cb_destroy_type) (int id, void *data) |
Typedef for devicestate and hint callback removal indication callback. More... | |
typedef int(* | ast_state_cb_type) (const char *context, const char *exten, struct ast_state_cb_info *info, void *data) |
Typedef for devicestate and hint callbacks. More... | |
typedef int() | ast_switch_f(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
All switch functions have the same interface, so define a type for them. More... | |
Functions | |
int | __ast_custom_function_register (struct ast_custom_function *acf, struct ast_module *mod) |
Register a custom function. More... | |
int | __ast_custom_function_register_escalating (struct ast_custom_function *acf, enum ast_custom_function_escalation escalation, struct ast_module *mod) |
Register a custom function which requires escalated privileges. More... | |
int | ast_active_calls (void) |
Retrieve the number of active calls. More... | |
int | ast_add_extension (const char *context, int replace, const char *extension, int priority, const char *label, const char *callerid, const char *application, void *data, void(*datad)(void *), const char *registrar) |
Add and extension to an extension context. More... | |
int | ast_add_extension2 (struct ast_context *con, int replace, const char *extension, int priority, const char *label, const char *callerid, const char *application, void *data, void(*datad)(void *), const char *registrar, const char *registrar_file, int registrar_line) |
Add an extension to an extension context, this time with an ast_context *. More... | |
int | ast_add_extension2_nolock (struct ast_context *con, int replace, const char *extension, int priority, const char *label, const char *callerid, const char *application, void *data, void(*datad)(void *), const char *registrar, const char *registrar_file, int registrar_line) |
Same as ast_add_extension2, but assumes you have already locked context. More... | |
int | ast_async_goto (struct ast_channel *chan, const char *context, const char *exten, int priority) |
Set the channel to next execute the specified dialplan location. More... | |
int | ast_async_goto_by_name (const char *chan, const char *context, const char *exten, int priority) |
Set the channel to next execute the specified dialplan location. More... | |
int | ast_async_goto_if_exists (struct ast_channel *chan, const char *context, const char *exten, int priority) |
int | ast_async_parseable_goto (struct ast_channel *chan, const char *goto_string) |
int | ast_build_timing (struct ast_timing *i, const char *info) |
Construct a timing bitmap, for use in time-based conditionals. More... | |
int | ast_canmatch_extension (struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid) |
Looks for a valid matching extension. More... | |
int | ast_check_timing (const struct ast_timing *i) |
Evaluate a pre-constructed bitmap as to whether the current time falls within the range specified. More... | |
int | ast_check_timing2 (const struct ast_timing *i, const struct timeval tv) |
Evaluate a pre-constructed bitmap as to whether a particular time falls within the range specified. More... | |
char * | ast_complete_applications (const char *line, const char *word, int state) |
Command completion for the list of installed applications. More... | |
int | ast_context_add_ignorepat (const char *context, const char *ignorepat, const char *registrar) |
Add an ignorepat. More... | |
int | ast_context_add_ignorepat2 (struct ast_context *con, const char *ignorepat, const char *registrar) |
int | ast_context_add_include (const char *context, const char *include, const char *registrar) |
Add a context include. More... | |
int | ast_context_add_include2 (struct ast_context *con, const char *include, const char *registrar) |
Add a context include. More... | |
int | ast_context_add_switch (const char *context, const char *sw, const char *data, int eval, const char *registrar) |
Add a switch. More... | |
int | ast_context_add_switch2 (struct ast_context *con, const char *sw, const char *data, int eval, const char *registrar) |
Adds a switch (first param is a ast_context) More... | |
void | ast_context_destroy (struct ast_context *con, const char *registrar) |
Destroy a context (matches the specified context or ANY context if NULL) More... | |
int | ast_context_destroy_by_name (const char *context, const char *registrar) |
Destroy a context by name. More... | |
struct ast_context * | ast_context_find (const char *name) |
Find a context. More... | |
struct ast_context * | ast_context_find_or_create (struct ast_context **extcontexts, struct ast_hashtab *exttable, const char *name, const char *registrar) |
Register a new context or find an existing one. More... | |
int | ast_context_lockmacro (const char *macrocontext) |
locks the macrolock in the given context More... | |
int | ast_context_remove_ignorepat (const char *context, const char *ignorepat, const char *registrar) |
int | ast_context_remove_ignorepat2 (struct ast_context *con, const char *ignorepat, const char *registrar) |
int | ast_context_remove_include (const char *context, const char *include, const char *registrar) |
Remove a context include. More... | |
int | ast_context_remove_include2 (struct ast_context *con, const char *include, const char *registrar) |
Removes an include by an ast_context structure. More... | |
int | ast_context_remove_switch (const char *context, const char *sw, const char *data, const char *registrar) |
Remove a switch. More... | |
int | ast_context_remove_switch2 (struct ast_context *con, const char *sw, const char *data, const char *registrar) |
This function locks given context, removes switch, unlock context and return. More... | |
void | ast_context_set_autohints (struct ast_context *con, int enabled) |
Enable or disable autohints support on a context. More... | |
int | ast_context_unlockmacro (const char *macrocontext) |
Unlocks the macrolock in the given context. More... | |
int | ast_context_verify_includes (struct ast_context *con) |
Verifies includes in an ast_contect structure. More... | |
struct ast_custom_function * | ast_custom_function_find (const char *name) |
int | ast_custom_function_unregister (struct ast_custom_function *acf) |
Unregister a custom function. More... | |
int | ast_destroy_timing (struct ast_timing *i) |
Deallocates memory structures associated with a timing bitmap. More... | |
enum ast_extension_states | ast_devstate_to_extenstate (enum ast_device_state devstate) |
Map devstate to an extension state. More... | |
int | ast_exists_extension (struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid) |
Determine whether an extension exists. More... | |
int | ast_explicit_goto (struct ast_channel *chan, const char *context, const char *exten, int priority) |
int | ast_extension_close (const char *pattern, const char *data, int needmore) |
int | ast_extension_cmp (const char *a, const char *b) |
Determine if one extension should match before another. More... | |
int | ast_extension_match (const char *pattern, const char *extension) |
Determine if a given extension matches a given pattern (in NXX format) More... | |
int | ast_extension_patmatch (const char *pattern, const char *data) |
int | ast_extension_state (struct ast_channel *c, const char *context, const char *exten) |
Uses hint and devicestate callback to get the state of an extension. More... | |
const char * | ast_extension_state2str (int extension_state) |
Return string representation of the state of an extension. More... | |
int | ast_extension_state_add (const char *context, const char *exten, ast_state_cb_type change_cb, void *data) |
Add watcher for extension states. More... | |
int | ast_extension_state_add_destroy (const char *context, const char *exten, ast_state_cb_type change_cb, ast_state_cb_destroy_type destroy_cb, void *data) |
Add watcher for extension states with destructor. More... | |
int | ast_extension_state_add_destroy_extended (const char *context, const char *exten, ast_state_cb_type change_cb, ast_state_cb_destroy_type destroy_cb, void *data) |
Add watcher for extended extension states with destructor. More... | |
int | ast_extension_state_add_extended (const char *context, const char *exten, ast_state_cb_type change_cb, void *data) |
Add watcher for extended extension states. More... | |
int | ast_extension_state_del (int id, ast_state_cb_type change_cb) |
Deletes a state change watcher by ID. More... | |
int | ast_extension_state_extended (struct ast_channel *c, const char *context, const char *exten, struct ao2_container **device_state_info) |
Uses hint and devicestate callback to get the extended state of an extension. More... | |
int | ast_findlabel_extension (struct ast_channel *c, const char *context, const char *exten, const char *label, const char *callerid) |
Find the priority of an extension that has the specified label. More... | |
int | ast_findlabel_extension2 (struct ast_channel *c, struct ast_context *con, const char *exten, const char *label, const char *callerid) |
Find the priority of an extension that has the specified label. More... | |
int | ast_func_read (struct ast_channel *chan, const char *function, char *workspace, size_t len) |
executes a read operation on a function More... | |
int | ast_func_read2 (struct ast_channel *chan, const char *function, struct ast_str **str, ssize_t maxlen) |
executes a read operation on a function More... | |
int | ast_func_write (struct ast_channel *chan, const char *function, const char *value) |
executes a write operation on a function More... | |
const char * | ast_get_extension_registrar_file (struct ast_exten *e) |
Get name of configuration file used by registrar to register this extension. More... | |
int | ast_get_extension_registrar_line (struct ast_exten *e) |
Get line number of configuration file used by registrar to register this extension. More... | |
int | ast_get_hint (char *hint, int hintsize, char *name, int namesize, struct ast_channel *c, const char *context, const char *exten) |
If an extension hint exists, return non-zero. More... | |
int | ast_goto_if_exists (struct ast_channel *chan, const char *context, const char *exten, int priority) |
int | ast_hint_presence_state (struct ast_channel *c, const char *context, const char *exten, char **subtype, char **message) |
Uses hint and presence state callback to get the presence state of an extension. More... | |
int | ast_ignore_pattern (const char *context, const char *pattern) |
Checks to see if a number should be ignored. More... | |
int | ast_matchmore_extension (struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid) |
Looks to see if adding anything to this extension might match something. (exists ^ canmatch) More... | |
void | ast_merge_contexts_and_delete (struct ast_context **extcontexts, struct ast_hashtab *exttable, const char *registrar) |
Merge the temporary contexts into a global contexts list and delete from the global list the ones that are being added. More... | |
int | ast_parseable_goto (struct ast_channel *chan, const char *goto_string) |
void | ast_pbx_h_exten_run (struct ast_channel *chan, const char *context) |
Run the h exten from the given context. More... | |
void | ast_pbx_hangup_handler_destroy (struct ast_channel *chan) |
Destroy the hangup handler container on a channel. More... | |
void | ast_pbx_hangup_handler_init (struct ast_channel *chan) |
Init the hangup handler container on a channel. More... | |
int | ast_pbx_hangup_handler_pop (struct ast_channel *chan) |
Pop the top of the channel hangup handler stack. More... | |
void | ast_pbx_hangup_handler_push (struct ast_channel *chan, const char *handler) |
Push the given hangup handler onto the channel hangup handler stack. More... | |
int | ast_pbx_hangup_handler_run (struct ast_channel *chan) |
Run all hangup handlers on the channel. More... | |
int | ast_pbx_outgoing_app (const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *app, const char *appdata, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel, const struct ast_assigned_ids *assignedids) |
Synchronously or asynchronously make an outbound call and execute an application on the channel. More... | |
int | ast_pbx_outgoing_app_predial (const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *app, const char *appdata, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel, const struct ast_assigned_ids *assignedids, const char *predial_callee) |
int | ast_pbx_outgoing_exten (const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *context, const char *exten, int priority, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel, int early_media, const struct ast_assigned_ids *assignedids) |
Synchronously or asynchronously make an outbound call and send it to a particular extension. More... | |
int | ast_pbx_outgoing_exten_predial (const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *context, const char *exten, int priority, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel, int early_media, const struct ast_assigned_ids *assignedids, const char *predial_callee) |
enum ast_pbx_result | ast_pbx_run (struct ast_channel *c) |
Execute the PBX in the current thread. More... | |
enum ast_pbx_result | ast_pbx_run_args (struct ast_channel *c, struct ast_pbx_args *args) |
Execute the PBX in the current thread. More... | |
enum ast_pbx_result | ast_pbx_start (struct ast_channel *c) |
Create a new thread and start the PBX. More... | |
int | ast_processed_calls (void) |
Retrieve the total number of calls processed through the PBX since last restart. More... | |
int | ast_rdlock_context (struct ast_context *con) |
Read locks a given context. More... | |
int | ast_rdlock_contexts (void) |
Read locks the context list. More... | |
int | ast_register_switch (struct ast_switch *sw) |
Register an alternative dialplan switch. More... | |
int | ast_spawn_extension (struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid, int *found, int combined_find_spawn) |
Launch a new extension (i.e. new stack) More... | |
int | ast_str_get_hint (struct ast_str **hint, ssize_t hintsize, struct ast_str **name, ssize_t namesize, struct ast_channel *c, const char *context, const char *exten) |
If an extension hint exists, return non-zero. More... | |
int | ast_thread_inhibit_escalations (void) |
Inhibit (in the current thread) the execution of dialplan functions which cause privilege escalations. If pbx_live_dangerously() has been called, this function has no effect. More... | |
int | ast_thread_inhibit_escalations_swap (int inhibit) |
Swap the current thread escalation inhibit setting. More... | |
int | ast_unlock_context (struct ast_context *con) |
int | ast_unlock_contexts (void) |
Unlocks contexts. More... | |
void | ast_unregister_switch (struct ast_switch *sw) |
Unregister an alternative switch. More... | |
int | ast_wrlock_context (struct ast_context *con) |
Write locks a given context. More... | |
int | ast_wrlock_contexts (void) |
Write locks the context list. 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_raise_exception (struct ast_channel *chan, const char *data) |
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 *data) |
Parse and set multiple channel variables, where the pairs are separated by the ',' character, and name and value are separated with an '=' character. More... | |
int | pbx_checkcondition (const char *condition) |
Evaluate a condition. More... | |
int | pbx_exec (struct ast_channel *c, struct ast_app *app, const char *data) |
Execute an application. More... | |
struct ast_exten * | pbx_find_extension (struct ast_channel *chan, struct ast_context *bypass, struct pbx_find_info *q, const char *context, const char *exten, int priority, const char *label, const char *callerid, enum ext_match_t action) |
struct ast_app * | pbx_findapp (const char *app) |
Look up an application. More... | |
void | pbx_live_dangerously (int new_live_dangerously) |
Enable/disable the execution of 'dangerous' functions from external protocols (AMI, etc.). More... | |
void | pbx_retrieve_variable (struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp) |
Retrieve the value of a builtin variable or variable from the channel variable stack. More... | |
int | pbx_set_autofallthrough (int newval) |
int | pbx_set_extenpatternmatchnew (int newval) |
void | pbx_set_overrideswitch (const char *newval) |
int | ast_context_remove_extension (const char *context, const char *extension, int priority, const char *registrar) |
Simply remove extension from context. More... | |
int | ast_context_remove_extension2 (struct ast_context *con, const char *extension, int priority, const char *registrar, int already_locked) |
This functionc locks given context, search for the right extension and fires out all peer in this extensions with given priority. If priority is set to 0, all peers are removed. After that, unlock context and return. More... | |
int | ast_context_remove_extension_callerid (const char *context, const char *extension, int priority, const char *callerid, int matchcid, const char *registrar) |
int | ast_context_remove_extension_callerid2 (struct ast_context *con, const char *extension, int priority, const char *callerid, int matchcid, const char *registrar, int already_locked) |
Functions for returning values from structures | |
const char * | ast_get_context_name (struct ast_context *con) |
const char * | ast_get_extension_name (struct ast_exten *exten) |
struct ast_context * | ast_get_extension_context (struct ast_exten *exten) |
const char * | ast_get_include_name (const struct ast_include *include) |
const char * | ast_get_ignorepat_name (const struct ast_ignorepat *ip) |
const char * | ast_get_switch_name (const struct ast_sw *sw) |
const char * | ast_get_switch_data (const struct ast_sw *sw) |
int | ast_get_switch_eval (const struct ast_sw *sw) |
Other Extension stuff | |
int | ast_get_extension_priority (struct ast_exten *exten) |
int | ast_get_extension_matchcid (struct ast_exten *e) |
const char * | ast_get_extension_cidmatch (struct ast_exten *e) |
const char * | ast_get_extension_app (struct ast_exten *e) |
const char * | ast_get_extension_label (struct ast_exten *e) |
void * | ast_get_extension_app_data (struct ast_exten *e) |
Registrar info functions ... | |
const char * | ast_get_context_registrar (struct ast_context *c) |
const char * | ast_get_extension_registrar (struct ast_exten *e) |
const char * | ast_get_include_registrar (const struct ast_include *i) |
const char * | ast_get_ignorepat_registrar (const struct ast_ignorepat *ip) |
const char * | ast_get_switch_registrar (const struct ast_sw *sw) |
Walking functions ... | |
struct ast_context * | ast_walk_contexts (struct ast_context *con) |
struct ast_exten * | ast_walk_context_extensions (struct ast_context *con, struct ast_exten *priority) |
struct ast_exten * | ast_walk_extension_priorities (struct ast_exten *exten, struct ast_exten *priority) |
const struct ast_include * | ast_walk_context_includes (const struct ast_context *con, const struct ast_include *inc) |
const struct ast_ignorepat * | ast_walk_context_ignorepats (const struct ast_context *con, const struct ast_ignorepat *ip) |
const struct ast_sw * | ast_walk_context_switches (const struct ast_context *con, const struct ast_sw *sw) |
Iterator functions ... | |
int | ast_context_includes_count (const struct ast_context *con) |
const struct ast_include * | ast_context_includes_get (const struct ast_context *con, int idx) |
int | ast_context_ignorepats_count (const struct ast_context *con) |
const struct ast_ignorepat * | ast_context_ignorepats_get (const struct ast_context *con, int idx) |
int | ast_context_switches_count (const struct ast_context *con) |
const struct ast_sw * | ast_context_switches_get (const struct ast_context *con, int idx) |
Substitution routines, using static string buffers | |
void | pbx_substitute_variables_helper (struct ast_channel *c, const char *cp1, char *cp2, int count) |
void | pbx_substitute_variables_varshead (struct varshead *headp, 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 cp2_size, size_t *used) |
Substitution routines, using dynamic string buffers | |
const char * | ast_str_retrieve_variable (struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, 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_varshead (struct ast_str **buf, ssize_t maxlen, struct varshead *headp, 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) |
int | ast_hashtab_compare_contexts (const void *ah_a, const void *ah_b) |
hashtable functions for contexts More... | |
unsigned int | ast_hashtab_hash_contexts (const void *obj) |
Core PBX routines and definitions.
Definition in file pbx.h.
#define ast_custom_function_register | ( | acf | ) | __ast_custom_function_register(acf, AST_MODULE_SELF) |
Register a custom function.
Definition at line 1508 of file pbx.h.
Referenced by load_module(), load_parking_bridge_features(), and reload().
#define ast_custom_function_register_escalating | ( | acf, | |
escalation | |||
) | __ast_custom_function_register_escalating(acf, escalation, AST_MODULE_SELF) |
Register a custom function which requires escalated privileges.
Examples would be SHELL() (for which a read needs permission to execute arbitrary code) or FILE() (for which write needs permission to change files on the filesystem).
Definition at line 1517 of file pbx.h.
Referenced by load_module().
#define AST_MAX_APP 32 |
Max length of an application
Definition at line 40 of file pbx.h.
Referenced by handle_show_function(), sla_build_station(), and sla_station_destructor().
#define AST_PBX_ERROR 1 |
#define AST_PBX_GOTO_FAILED -3 |
Definition at line 42 of file pbx.h.
Referenced by __ast_goto_if_exists().
#define AST_PBX_HANGUP -1 |
#define AST_PBX_INCOMPLETE 12 |
Return to PBX matching, allowing more digits for the extension
Definition at line 51 of file pbx.h.
Referenced by __ast_pbx_run(), dial_exec_full(), pbx_builtin_incomplete(), and retrydial_exec().
#define PRIORITY_HINT -1 |
Special Priority for a hint
Definition at line 54 of file pbx.h.
Referenced by add_extensions(), add_hints(), add_priority(), ast_add_extension2_lockopt(), ast_hint_extension_nolock(), ast_merge_contexts_and_delete(), delete_extens(), destroy_exten(), device_state_cb(), handle_cli_dialplan_add_extension(), handle_cli_dialplan_remove_extension(), handle_cli_dialplan_save(), lua_register_hints(), manager_dialplan_extension_add(), manager_dialplan_extension_remove(), manager_show_dialplan_helper(), new_subscribe(), parking_lot_cfg_create_extensions(), pbx_load_config(), print_ext(), sla_build_station(), and sla_station_destructor().
typedef void(* ast_state_cb_destroy_type) (int id, void *data) |
typedef int(* ast_state_cb_type) (const char *context, const char *exten, struct ast_state_cb_info *info, void *data) |
typedef int() ast_switch_f(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data) |
Description of the ways in which a function may escalate privileges.
Enumerator | |
---|---|
AST_CFE_NONE | |
AST_CFE_READ | |
AST_CFE_WRITE | |
AST_CFE_BOTH |
extension matchcid types
Enumerator | |
---|---|
AST_EXT_MATCHCID_OFF | Match only extensions with matchcid=0 |
AST_EXT_MATCHCID_ON | Match only extensions with matchcid=1 AND cidmatch matches |
AST_EXT_MATCHCID_ANY | Match both - used only in functions manipulating ast_exten's |
enum ast_extension_states |
Extension states.
Enumerator | |
---|---|
AST_OUTGOING_NO_WAIT | Don't wait for originated call to answer |
AST_OUTGOING_WAIT | Wait for originated call to answer |
AST_OUTGOING_WAIT_COMPLETE | Wait for originated call to answer and hangup |
enum ast_pbx_result |
The result codes when starting the PBX on a channel with ast_pbx_start.
Enumerator | |
---|---|
AST_PBX_SUCCESS | |
AST_PBX_FAILED | |
AST_PBX_CALL_LIMIT |
enum ext_match_t |
When looking up extensions, we can have different requests identified by the 'action' argument, as follows.
Enumerator | |
---|---|
E_MATCHMORE | |
E_CANMATCH | |
E_MATCH | |
E_MATCH_MASK | |
E_SPAWN | |
E_FINDLABEL | |
E_MATCHMORE | |
E_CANMATCH | |
E_MATCH | |
E_MATCH_MASK | |
E_SPAWN | |
E_FINDLABEL |
Definition at line 1595 of file pbx.h.
int __ast_custom_function_register | ( | struct ast_custom_function * | acf, |
struct ast_module * | mod | ||
) |
Register a custom function.
Definition at line 373 of file pbx_functions.c.
References acf_retrieve_docs(), ast_custom_function_find_nolock(), ast_log, AST_RWLIST_INSERT_BEFORE_CURRENT, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, AST_STATIC_DOC, ast_verb, COLOR_BRCYAN, COLORIZE, COLORIZE_FMT, ast_custom_function::docsrc, LOG_ERROR, ast_custom_function::mod, and ast_custom_function::name.
Referenced by __ast_custom_function_register_escalating(), __init_manager(), ast_msg_init(), load_features_config(), and load_pbx().
int __ast_custom_function_register_escalating | ( | struct ast_custom_function * | acf, |
enum ast_custom_function_escalation | escalation, | ||
struct ast_module * | mod | ||
) |
Register a custom function which requires escalated privileges.
Examples would be SHELL() (for which a read needs permission to execute arbitrary code) or FILE() (for which write needs permission to change files on the filesystem).
Definition at line 418 of file pbx_functions.c.
References __ast_custom_function_register(), AST_CFE_BOTH, AST_CFE_NONE, AST_CFE_READ, AST_CFE_WRITE, ast_custom_function::read_escalates, and ast_custom_function::write_escalates.
int ast_active_calls | ( | void | ) |
Retrieve the number of active calls.
Definition at line 4764 of file pbx.c.
References countcalls.
Referenced by ast_var_Config(), get_current_call_count(), handle_chanlist(), handle_showcalls(), and sysinfo_helper().
int ast_add_extension | ( | const char * | context, |
int | replace, | ||
const char * | extension, | ||
int | priority, | ||
const char * | label, | ||
const char * | callerid, | ||
const char * | application, | ||
void * | data, | ||
void(*)(void *) | datad, | ||
const char * | registrar | ||
) |
Add and extension to an extension context.
context | context to add the extension to |
replace | |
extension | extension to add |
priority | priority level of extension addition |
label | extension label |
callerid | pattern to match CallerID, or NULL to match any CallerID |
application | application to run on the extension with that priority level |
data | data to pass to the application |
datad | a pointer to a function that will deallocate data when needed or NULL if data does not need to be freed. |
registrar | who registered the extension |
datap
will be called and passed the data
pointer.0 | success |
-1 | failure |
Definition at line 6970 of file pbx.c.
References ast_add_extension2(), ast_unlock_contexts(), c, ast_exten::datad, find_context_locked(), and NULL.
Referenced by add_to_regcontext(), app_create(), ast_hint_presence_state(), ast_sip_persistent_endpoint_update_state(), AST_TEST_DEFINE(), create_test_dialplan(), device_state_cb(), extension_state_add_destroy(), handle_cli_dialplan_add_extension(), internal_extension_state_extended(), join_conference_bridge(), load_module(), register_exten(), register_extension(), register_peer_exten(), sla_build_station(), and sla_build_trunk().
int ast_add_extension2 | ( | struct ast_context * | con, |
int | replace, | ||
const char * | extension, | ||
int | priority, | ||
const char * | label, | ||
const char * | callerid, | ||
const char * | application, | ||
void * | data, | ||
void(*)(void *) | datad, | ||
const char * | registrar, | ||
const char * | registrar_file, | ||
int | registrar_line | ||
) |
Add an extension to an extension context, this time with an ast_context *.
registrar_file | optional configuration file that defines this extension |
registrar_line | optional line number of configuration file that defines extension |
Add an extension to an extension context, this time with an ast_context *.
We sort extensions in order of matching preference, so that we can stop the search as soon as we find a suitable match. This ordering also takes care of wildcards such as '.' (meaning "one or more of any character") and '!' (which is 'earlymatch', meaning "zero or more of any character" but also impacts the return value from CANMATCH and EARLYMATCH.
The extension match rules defined in the devmeeting 2006.05.05 are quite simple: WE SELECT THE LONGEST MATCH. In detail, "longest" means the number of matched characters in the extension. In case of ties (e.g. _XXX and 333) in the length of a pattern, we give priority to entries with the smallest cardinality (e.g, [5-9] comes before [2-8] before the former has only 5 elements, while the latter has 7, etc. In case of same cardinality, the first element in the range counts. If we still have a tie, any final '!' will make this as a possibly less specific pattern.
EBUSY - can't lock EEXIST - extension with the same priority exist and no replace is set
Definition at line 7299 of file pbx.c.
References ast_add_extension2_lockopt(), ast_exten::datad, and localized_add_extension2().
Referenced by add_extensions(), ast_add_extension(), context_merge(), lua_register_hints(), manager_dialplan_extension_add(), pbx_load_config(), and pbx_load_users().
int ast_add_extension2_nolock | ( | struct ast_context * | con, |
int | replace, | ||
const char * | extension, | ||
int | priority, | ||
const char * | label, | ||
const char * | callerid, | ||
const char * | application, | ||
void * | data, | ||
void(*)(void *) | datad, | ||
const char * | registrar, | ||
const char * | registrar_file, | ||
int | registrar_line | ||
) |
Same as ast_add_extension2, but assumes you have already locked context.
Definition at line 7308 of file pbx.c.
References ast_add_extension2_lockopt(), and ast_exten::datad.
Referenced by add_extension(), parking_add_extension(), and parking_duration_callback().
int ast_async_goto | ( | struct ast_channel * | chan, |
const char * | context, | ||
const char * | exten, | ||
int | priority | ||
) |
Set the channel to next execute the specified dialplan location.
Definition at line 7011 of file pbx.c.
References ast_channel_flags(), ast_channel_is_bridged(), ast_channel_lock, ast_channel_name(), ast_channel_pbx(), ast_channel_unlock, ast_channel_yank(), ast_explicit_goto(), AST_FLAG_IN_AUTOLOOP, ast_hangup(), ast_log, ast_pbx_start(), AST_SOFTHANGUP_ASYNCGOTO, ast_softhangup_nolock(), ast_test_flag, and LOG_WARNING.
Referenced by __ast_goto_if_exists(), action_redirect(), ast_async_goto_by_name(), bridge_channel_blind_transfer(), chan_pjsip_cng_tone_detected(), comeback_goto(), dahdi_handle_dtmf(), fax_detect_framehook(), handle_request_bye(), my_handle_dtmf(), onModeChanged(), ooh323_rtp_read(), pbx_parseable_goto(), process_ast_dsp(), process_sdp(), and sip_read().
int ast_async_goto_by_name | ( | const char * | chan, |
const char * | context, | ||
const char * | exten, | ||
int | priority | ||
) |
Set the channel to next execute the specified dialplan location.
Definition at line 7044 of file pbx.c.
References ast_async_goto(), ast_channel_get_by_name(), and ast_channel_unref.
int ast_async_goto_if_exists | ( | struct ast_channel * | chan, |
const char * | context, | ||
const char * | exten, | ||
int | priority | ||
) |
Definition at line 8798 of file pbx.c.
References __ast_goto_if_exists().
int ast_async_parseable_goto | ( | struct ast_channel * | chan, |
const char * | goto_string | ||
) |
Definition at line 8864 of file pbx.c.
References pbx_parseable_goto().
Referenced by asyncgoto_exec(), detect_callback(), handle_redirect(), and parking_duration_callback().
int ast_build_timing | ( | struct ast_timing * | i, |
const char * | info_in | ||
) |
Construct a timing bitmap, for use in time-based conditionals.
i | Pointer to an ast_timing structure. |
info | Standard string containing a timerange, weekday range, monthday range, and month range, as well as an optional timezone. |
Returns | 1 on success or 0 on failure. |
/brief Build timing
/param i info /param info_in
Definition at line 3808 of file extconf.c.
References ast_strdup, ast_strdupa, ast_strlen_zero(), ast_timing::daymask, days, ast_timing::dowmask, get_range(), get_timerange(), sip_to_pjsip::info(), ast_timing::monthmask, months, NULL, strsep(), and ast_timing::timezone.
Referenced by ast_context_add_include2(), iftime(), include_alloc(), pbx_builtin_execiftime(), and pbx_builtin_gotoiftime().
int ast_canmatch_extension | ( | struct ast_channel * | c, |
const char * | context, | ||
const char * | exten, | ||
int | priority, | ||
const char * | callerid | ||
) |
Looks for a valid matching extension.
c | not really important |
context | context to serach within |
exten | extension to check |
priority | priority of extension path |
callerid | callerid of extension being searched for |
Definition at line 4194 of file pbx.c.
References E_CANMATCH, NULL, and pbx_extension_helper().
Referenced by __analog_ss_thread(), analog_ss_thread(), background_detect_exec(), cb_events(), do_immediate_setup(), dp_lookup(), dundi_lookup_local(), get_also_info(), get_destination(), leave_voicemail(), loopback_canmatch(), mgcp_ss(), pbx_builtin_background(), phone_check_exception(), test_exten(), and valid_exit().
int ast_check_timing | ( | const struct ast_timing * | i | ) |
Evaluate a pre-constructed bitmap as to whether the current time falls within the range specified.
i | Pointer to an ast_timing structure. |
Returns | 1, if the time matches or 0, if the current time falls outside of the specified range. |
Definition at line 4002 of file extconf.c.
References ast_check_timing2(), AST_RWLIST_TRAVERSE, ast_tvnow(), ast_walk_contexts(), ast_switch::list, ast_switch::name, and pbx_findswitch().
Referenced by ext_strncpy(), iftime(), include_valid(), and pbx_builtin_execiftime().
int ast_check_timing2 | ( | const struct ast_timing * | i, |
const struct timeval | tv | ||
) |
Evaluate a pre-constructed bitmap as to whether a particular time falls within the range specified.
i | Pointer to an ast_timing structure. |
tv | Specified time |
Returns | 1, if the time matches or 0, if the time falls outside of the specified range. |
Definition at line 251 of file pbx_timing.c.
References ast_localtime(), ast_log, ast_timing::daymask, ast_timing::dowmask, LOG_WARNING, ast_timing::minmask, ast_timing::monthmask, ast_timing::timezone, ast_tm::tm_hour, ast_tm::tm_mday, ast_tm::tm_min, ast_tm::tm_mon, and ast_tm::tm_wday.
Referenced by ast_check_timing(), and pbx_builtin_gotoiftime().
char* ast_complete_applications | ( | const char * | line, |
const char * | word, | ||
int | state | ||
) |
Command completion for the list of installed applications.
This can be called from a CLI command completion function that wants to complete from the list of available applications.
Definition at line 429 of file pbx_app.c.
References app, ast_cli_completion_add(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_strdup, and NULL.
Referenced by handle_orig(), and handle_show_application().
int ast_context_add_ignorepat | ( | const char * | context, |
const char * | ignorepat, | ||
const char * | registrar | ||
) |
Add an ignorepat.
context | which context to add the ignorpattern to |
ignorepat | ignorepattern to set up for the extension |
registrar | registrar of the ignore pattern |
Adds an ignore pattern to a particular context.
0 | on success |
-1 | on failure |
Definition at line 6877 of file pbx.c.
References ast_context_add_ignorepat2(), ast_unlock_contexts(), c, and find_context_locked().
Referenced by handle_cli_dialplan_add_ignorepat().
static int ast_context_add_ignorepat2 | ( | struct ast_context * | con, |
const char * | ignorepat, | ||
const char * | registrar | ||
) |
Definition at line 348 of file ael_main.c.
References ADD_LAST, ast_context_ignorepats_count(), ast_context_ignorepats_get(), ast_get_ignorepat_name(), ast_unlock_context(), AST_VECTOR_APPEND, ast_wrlock_context(), create_name(), errno, ignorepat_alloc(), ignorepat_free(), ast_context::ignorepats, and localized_context_add_ignorepat2().
Referenced by ast_compile_ael2(), ast_context_add_ignorepat(), context_merge_incls_swits_igps_other_registrars(), and pbx_load_config().
int ast_context_add_include | ( | const char * | context, |
const char * | include, | ||
const char * | registrar | ||
) |
Add a context include.
context | context to add include to |
include | new include to add |
registrar | who's registering it |
Adds an include taking a char * string as the context parameter
0 | on success |
-1 | on error |
Definition at line 6706 of file pbx.c.
References ast_context_add_include2(), ast_unlock_contexts(), c, and find_context_locked().
Referenced by AST_TEST_DEFINE(), and handle_cli_dialplan_add_include().
static int ast_context_add_include2 | ( | struct ast_context * | con, |
const char * | include, | ||
const char * | registrar | ||
) |
Add a context include.
con | context to add the include to |
value | include value to add |
registrar | who registered the context |
Adds an include taking a struct ast_context as the first parameter
0 | on success |
-1 | on failure |
Definition at line 359 of file ael_main.c.
References ADD_LAST, ast_context_includes_count(), ast_context_includes_get(), ast_debug, ast_get_context_name(), ast_get_include_name(), ast_unlock_context(), AST_VECTOR_APPEND, ast_wrlock_context(), create_name(), errno, include_alloc(), include_free(), ast_context::includes, and localized_context_add_include2().
Referenced by ast_compile_ael2(), ast_context_add_include(), context_merge_incls_swits_igps_other_registrars(), and pbx_load_config().
int ast_context_add_switch | ( | const char * | context, |
const char * | sw, | ||
const char * | data, | ||
int | eval, | ||
const char * | registrar | ||
) |
Add a switch.
context | context to which to add the switch |
sw | switch to add |
data | data to pass to switch |
eval | whether to evaluate variables when running switch |
registrar | whoever registered the switch |
This function registers a switch with the asterisk switch architecture
0 | on success |
-1 | on failure |
Definition at line 6771 of file pbx.c.
References ast_context_add_switch2(), ast_unlock_contexts(), c, and find_context_locked().
static int ast_context_add_switch2 | ( | struct ast_context * | con, |
const char * | sw, | ||
const char * | data, | ||
int | eval, | ||
const char * | registrar | ||
) |
Adds a switch (first param is a ast_context)
Definition at line 370 of file ael_main.c.
References ADD_LAST, ast_context::alts, ast_context_switches_count(), ast_context_switches_get(), ast_get_context_name(), ast_get_switch_data(), ast_get_switch_name(), ast_unlock_context(), AST_VECTOR_APPEND, ast_verb, ast_wrlock_context(), create_name(), errno, ast_context::eswitches, localized_context_add_switch2(), namelist::name2, sw_alloc(), sw_free(), and ast_context::switches.
Referenced by ast_compile_ael2(), ast_context_add_switch(), context_merge_incls_swits_igps_other_registrars(), lua_register_switches(), and pbx_load_config().
void ast_context_destroy | ( | struct ast_context * | con, |
const char * | registrar | ||
) |
Destroy a context (matches the specified context or ANY context if NULL)
con | context to destroy |
registrar | who registered it |
You can optionally leave out either parameter. It will find it based on either the ast_context or the registrar name.
Definition at line 625 of file conf2ael.c.
References __ast_context_destroy(), ast_context_verify_includes(), ast_unlock_contexts(), ast_wrlock_contexts(), and localized_context_destroy().
Referenced by ast_context_destroy_by_name(), AST_TEST_DEFINE(), ast_walk_contexts(), parking_lot_cfg_remove_extensions(), remove_all_configured_parking_lot_extensions(), remove_pending_parking_lot_extensions(), sla_destroy(), and unload_module().
int ast_context_destroy_by_name | ( | const char * | context, |
const char * | registrar | ||
) |
Destroy a context by name.
context | Name of the context to destroy |
registrar | who registered it |
You can optionally leave out the registrar parameter. It will find it based on the context name.
-1 | context not found |
0 | Success |
Definition at line 8244 of file pbx.c.
References ast_context_destroy(), ast_context_find(), ast_unlock_contexts(), and ast_wrlock_contexts().
Referenced by __unload_module(), app_dtor(), ast_sip_destroy_sorcery_global(), check_regcontext(), cleanup_stale_contexts(), handle_cli_dialplan_remove_context(), and unload_module().
static struct ast_context * ast_context_find | ( | const char * | name | ) |
Find a context.
name | name of the context to find |
Will search for the context with the given name.
Definition at line 4174 of file extconf.c.
References ast_copy_string(), ast_hashtab_lookup(), ast_rdlock_contexts(), ast_unlock_contexts(), ast_walk_contexts(), ast_context::name, fake_context::name, NULL, and tmp().
Referenced by _macro_exec(), app_create(), ast_context_destroy_by_name(), ast_context_verify_includes(), ast_ignore_pattern(), handle_cli_dialplan_add_extension(), handle_cli_dialplan_add_include(), isexten_function_read(), register_exten(), register_peer_exten(), and unregister_exten().
struct ast_context* ast_context_find_or_create | ( | struct ast_context ** | extcontexts, |
struct ast_hashtab * | exttable, | ||
const char * | name, | ||
const char * | registrar | ||
) |
Register a new context or find an existing one.
extcontexts | pointer to the ast_context structure pointer |
exttable | pointer to the hashtable that contains all the elements in extcontexts |
name | name of the new context |
registrar | registrar of the context |
This function allows you to play in two environments: the global contexts (active dialplan) or an external context set of your choosing. To act on the external set, make sure extcontexts and exttable are set; for the globals, make sure both extcontexts and exttable are NULL.
This will first search for a context with your name. If it exists already, it will not create a new one. If it does not exist, it will create a new one with the given name and registrar.
Definition at line 6198 of file pbx.c.
References __ast_cli_register_multiple(), ast_context::alts, ast_calloc, ast_copy_string(), ast_debug, ast_hashtab_compare_contexts(), ast_hashtab_create, ast_hashtab_hash_contexts(), ast_hashtab_insert_immediate, ast_hashtab_insert_safe, ast_hashtab_lookup(), ast_hashtab_newsize_java(), ast_hashtab_resize_java(), ast_log, ast_mutex_init, ast_rdlock_contexts(), ast_rwlock_init, ast_strdup, ast_unlock_contexts(), AST_VECTOR_INIT, ast_wrlock_contexts(), contexts, ast_context::ignorepats, ast_context::includes, local_contexts, localized_context_find_or_create(), ast_context::lock, LOG_ERROR, ast_context::macrolock, ast_context::name, fake_context::name, ast_context::next, NULL, ast_context::refcount, ast_context::registrar, ast_context::root, ast_context::root_table, and tmp().
Referenced by add_hints(), app_create(), ast_compile_ael2(), ast_sip_persistent_endpoint_add_to_regcontext(), AST_TEST_DEFINE(), config_parse_variables(), context_merge(), create_test_dialplan(), handle_cli_dialplan_add_extension(), handle_cli_dialplan_add_include(), load_module(), lua_register_hints(), lua_register_switches(), manager_dialplan_extension_add(), parking_duration_callback(), parking_lot_cfg_create_extensions(), pbx_load_config(), pbx_load_users(), reload_config(), set_config(), sla_build_station(), and sla_build_trunk().
int ast_context_ignorepats_count | ( | const struct ast_context * | con | ) |
Definition at line 8740 of file pbx.c.
References AST_VECTOR_SIZE, and ast_context::ignorepats.
Referenced by __ast_context_destroy(), ast_context_add_ignorepat2(), ast_context_remove_ignorepat2(), ast_ignore_pattern(), ast_walk_context_ignorepats(), complete_dialplan_remove_ignorepat(), context_merge_incls_swits_igps_other_registrars(), context_used(), handle_cli_dialplan_save(), lookup_c_ip(), manager_show_dialplan_helper(), and show_dialplan_helper().
const struct ast_ignorepat* ast_context_ignorepats_get | ( | const struct ast_context * | con, |
int | idx | ||
) |
Definition at line 8745 of file pbx.c.
References AST_VECTOR_GET, and ast_context::ignorepats.
Referenced by ast_context_add_ignorepat2(), ast_ignore_pattern(), ast_walk_context_ignorepats(), complete_dialplan_remove_ignorepat(), context_merge_incls_swits_igps_other_registrars(), handle_cli_dialplan_save(), lookup_c_ip(), manager_show_dialplan_helper(), and show_dialplan_helper().
int ast_context_includes_count | ( | const struct ast_context * | con | ) |
Definition at line 8697 of file pbx.c.
References AST_VECTOR_SIZE, and ast_context::includes.
Referenced by __ast_context_destroy(), ast_context_add_include2(), ast_context_remove_include2(), ast_context_verify_includes(), ast_walk_context_includes(), complete_dialplan_remove_include(), context_merge_incls_swits_igps_other_registrars(), context_used(), find_matching_priority(), handle_cli_dialplan_save(), lookup_ci(), manager_show_dialplan_helper(), pbx_find_extension(), and show_dialplan_helper().
const struct ast_include* ast_context_includes_get | ( | const struct ast_context * | con, |
int | idx | ||
) |
Definition at line 8702 of file pbx.c.
References AST_VECTOR_GET, and ast_context::includes.
Referenced by ast_context_add_include2(), ast_context_verify_includes(), ast_walk_context_includes(), complete_dialplan_remove_include(), context_merge_incls_swits_igps_other_registrars(), find_matching_priority(), handle_cli_dialplan_save(), lookup_ci(), manager_show_dialplan_helper(), pbx_find_extension(), and show_dialplan_helper().
int ast_context_lockmacro | ( | const char * | context | ) |
locks the macrolock in the given context
macrocontext | name of the macro-context to lock |
Locks the given macro-context to ensure only one thread (call) can execute it at a time
0 | on success |
-1 | on failure |
context | The context |
Definition at line 5162 of file pbx.c.
References ast_mutex_lock, ast_unlock_contexts(), c, find_context_locked(), and ast_context::macrolock.
Referenced by _macro_exec().
int ast_context_remove_extension | ( | const char * | context, |
const char * | extension, | ||
int | priority, | ||
const char * | registrar | ||
) |
Simply remove extension from context.
context | context to remove extension from |
extension | which extension to remove |
priority | priority of extension to remove (0 to remove all) |
registrar | registrar of the extension |
This function removes an extension from a given context.
0 | on success |
-1 | on failure |
Definition at line 4952 of file pbx.c.
References ast_context_remove_extension_callerid(), AST_EXT_MATCHCID_ANY, and NULL.
Referenced by ast_sip_persistent_endpoint_update_state(), AST_TEST_DEFINE(), conf_ended(), delete_extens(), register_peer_exten(), sla_station_destructor(), sla_trunk_destructor(), unregister_exten(), and unregister_extension().
int ast_context_remove_extension2 | ( | struct ast_context * | con, |
const char * | extension, | ||
int | priority, | ||
const char * | registrar, | ||
int | already_locked | ||
) |
This functionc locks given context, search for the right extension and fires out all peer in this extensions with given priority. If priority is set to 0, all peers are removed. After that, unlock context and return.
Definition at line 4982 of file pbx.c.
References ast_context_remove_extension_callerid2(), AST_EXT_MATCHCID_ANY, and NULL.
Referenced by add_extension(), and add_hints().
int ast_context_remove_extension_callerid | ( | const char * | context, |
const char * | extension, | ||
int | priority, | ||
const char * | callerid, | ||
int | matchcid, | ||
const char * | registrar | ||
) |
Definition at line 4957 of file pbx.c.
References ast_context_remove_extension_callerid2(), ast_unlock_contexts(), c, and find_context_locked().
Referenced by ast_context_remove_extension(), handle_cli_dialplan_remove_extension(), and manager_dialplan_extension_remove().
int ast_context_remove_extension_callerid2 | ( | struct ast_context * | con, |
const char * | extension, | ||
int | priority, | ||
const char * | callerid, | ||
int | matchcid, | ||
const char * | registrar, | ||
int | already_locked | ||
) |
Definition at line 4987 of file pbx.c.
References add_exten_to_pattern_tree(), ast_hashtab_insert_immediate, ast_hashtab_lookup(), ast_hashtab_remove_this_object(), ast_hashtab_size(), ast_log, ast_strlen_zero, ast_unlock_context(), ast_verb, ast_wrlock_context(), ast_exten::cidmatch, match_char::deleted, destroy_exten(), ext_strncpy(), ast_exten::exten, match_char::exten, ast_exten::label, LOG_ERROR, LOG_NOTICE, LOG_WARNING, ast_exten::matchcid, ast_exten::name, ast_context::name, ast_exten::next, NULL, ast_context::pattern_tree, ast_exten::peer, ast_exten::peer_label_table, ast_exten::peer_table, ast_exten::priority, ast_exten::registrar, ast_context::root, ast_context::root_table, and match_char::x.
Referenced by __ast_context_destroy(), ast_context_remove_extension2(), and ast_context_remove_extension_callerid().
int ast_context_remove_ignorepat | ( | const char * | context, |
const char * | ignorepat, | ||
const char * | registrar | ||
) |
Definition at line 6837 of file pbx.c.
References ast_context_remove_ignorepat2(), ast_unlock_contexts(), c, and find_context_locked().
Referenced by handle_cli_dialplan_remove_ignorepat().
int ast_context_remove_ignorepat2 | ( | struct ast_context * | con, |
const char * | ignorepat, | ||
const char * | registrar | ||
) |
Definition at line 6850 of file pbx.c.
References ast_context_ignorepats_count(), ast_get_ignorepat_name(), ast_get_ignorepat_registrar(), ast_unlock_context(), AST_VECTOR_GET, AST_VECTOR_REMOVE_ORDERED, ast_wrlock_context(), errno, ignorepat_free(), and ast_context::ignorepats.
Referenced by ast_context_remove_ignorepat().
int ast_context_remove_include | ( | const char * | context, |
const char * | include, | ||
const char * | registrar | ||
) |
Remove a context include.
0 | on success |
-1 | on failure |
Remove a context include.
Definition at line 4840 of file pbx.c.
References ast_context_remove_include2(), ast_unlock_contexts(), c, and find_context_locked().
Referenced by handle_cli_dialplan_remove_include().
int ast_context_remove_include2 | ( | struct ast_context * | con, |
const char * | include, | ||
const char * | registrar | ||
) |
Removes an include by an ast_context structure.
0 | on success |
-1 | on success |
Removes an include by an ast_context structure.
0 | on success. |
-1 | on failure. |
Definition at line 4863 of file pbx.c.
References ast_context_includes_count(), ast_get_context_name(), ast_get_include_name(), ast_get_include_registrar(), ast_unlock_context(), AST_VECTOR_GET, AST_VECTOR_REMOVE_ORDERED, ast_verb, ast_wrlock_context(), include_free(), and ast_context::includes.
Referenced by ast_context_remove_include().
int ast_context_remove_switch | ( | const char * | context, |
const char * | sw, | ||
const char * | data, | ||
const char * | registrar | ||
) |
Remove a switch.
Removes a switch with the given parameters
0 | on success |
-1 | on failure |
Definition at line 4898 of file pbx.c.
References ast_context_remove_switch2(), ast_unlock_contexts(), c, and find_context_locked().
int ast_context_remove_switch2 | ( | struct ast_context * | con, |
const char * | sw, | ||
const char * | data, | ||
const char * | registrar | ||
) |
This function locks given context, removes switch, unlock context and return.
Definition at line 4920 of file pbx.c.
References ast_context::alts, ast_context_switches_count(), ast_get_context_name(), ast_get_switch_data(), ast_get_switch_name(), ast_get_switch_registrar(), ast_unlock_context(), AST_VECTOR_GET, AST_VECTOR_REMOVE_ORDERED, ast_verb, ast_wrlock_context(), and sw_free().
Referenced by ast_context_remove_switch().
void ast_context_set_autohints | ( | struct ast_context * | con, |
int | enabled | ||
) |
Enable or disable autohints support on a context.
con | pointer to the context |
enabled | whether autohints are enabled |
Definition at line 6272 of file pbx.c.
References __ast_context_destroy(), ast_context::autohints, enabled, and ast_exten::registrar.
Referenced by pbx_load_config().
int ast_context_switches_count | ( | const struct ast_context * | con | ) |
Definition at line 8652 of file pbx.c.
References ast_context::alts, and AST_VECTOR_SIZE.
Referenced by __ast_context_destroy(), ast_context_add_switch2(), ast_context_remove_switch2(), ast_walk_context_switches(), context_merge_incls_swits_igps_other_registrars(), context_used(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), pbx_find_extension(), and show_dialplan_helper().
const struct ast_sw* ast_context_switches_get | ( | const struct ast_context * | con, |
int | idx | ||
) |
Definition at line 8657 of file pbx.c.
References ast_context::alts, and AST_VECTOR_GET.
Referenced by ast_context_add_switch2(), ast_walk_context_switches(), context_merge_incls_swits_igps_other_registrars(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), pbx_find_extension(), and show_dialplan_helper().
int ast_context_unlockmacro | ( | const char * | context | ) |
Unlocks the macrolock in the given context.
macrocontext | name of the macro-context to unlock |
Unlocks the given macro-context so that another thread (call) can execute it
0 | on success |
-1 | on failure |
context | The context |
Definition at line 5184 of file pbx.c.
References ast_mutex_unlock, ast_unlock_contexts(), c, find_context_locked(), and ast_context::macrolock.
Referenced by _macro_exec().
int ast_context_verify_includes | ( | struct ast_context * | con | ) |
Verifies includes in an ast_contect structure.
con | context in which to verify the includes |
0 | if no problems found |
-1 | if there were any missing context |
Definition at line 632 of file conf2ael.c.
References ast_context_find(), ast_context_includes_count(), ast_context_includes_get(), ast_get_context_name(), ast_log, ast_merge_contexts_and_delete(), include_rname(), localized_context_verify_includes(), and LOG_WARNING.
Referenced by ast_context_destroy(), and pbx_load_module().
struct ast_custom_function * ast_custom_function_find | ( | const char * | name | ) |
Definition at line 173 of file ael_main.c.
References ast_custom_function_find_nolock(), AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, events, ast_exten::name, and value.
Referenced by ast_compile_ael2(), ast_func_read(), ast_func_read2(), ast_func_write(), AST_TEST_DEFINE(), chanavail_exec(), check_expr(), config_curl(), destroy_curl(), handle_show_function(), op_func(), pbx_findapp(), realtime_curl(), realtime_multi_curl(), require_curl(), store_curl(), update2_curl(), and update_curl().
int ast_custom_function_unregister | ( | struct ast_custom_function * | acf | ) |
Unregister a custom function.
Definition at line 273 of file pbx_functions.c.
References AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_string_field_free_memory, ast_verb, AST_XML_DOC, ast_custom_function::docsrc, and ast_custom_function::name.
Referenced by load_module(), manager_shutdown(), message_shutdown(), reload(), unload_features_config(), unload_module(), unload_parking_bridge_features(), and unload_pbx().
int ast_destroy_timing | ( | struct ast_timing * | i | ) |
Deallocates memory structures associated with a timing bitmap.
i | Pointer to an ast_timing structure. |
0 | success |
non-zero | failure (number suitable to pass to |
Definition at line 285 of file pbx_timing.c.
References ast_free, NULL, and ast_timing::timezone.
Referenced by iftime(), include_free(), pbx_builtin_execiftime(), and pbx_builtin_gotoiftime().
enum ast_extension_states ast_devstate_to_extenstate | ( | enum ast_device_state | devstate | ) |
Map devstate to an extension state.
[in] | devstate | device state |
Definition at line 3006 of file pbx.c.
References AST_DEVICE_BUSY, AST_DEVICE_INUSE, AST_DEVICE_INVALID, AST_DEVICE_NOT_INUSE, AST_DEVICE_ONHOLD, AST_DEVICE_RINGING, AST_DEVICE_RINGINUSE, AST_DEVICE_TOTAL, AST_DEVICE_UNAVAILABLE, AST_DEVICE_UNKNOWN, AST_EXTENSION_BUSY, AST_EXTENSION_INUSE, AST_EXTENSION_NOT_INUSE, AST_EXTENSION_ONHOLD, AST_EXTENSION_RINGING, and AST_EXTENSION_UNAVAILABLE.
Referenced by ast_extension_state3(), AST_TEST_DEFINE(), and handle_show_device2extenstate().
int ast_exists_extension | ( | struct ast_channel * | c, |
const char * | context, | ||
const char * | exten, | ||
int | priority, | ||
const char * | callerid | ||
) |
Determine whether an extension exists.
c | this is not important |
context | which context to look in |
exten | which extension to search for |
priority | priority of the action within the extension |
callerid | callerid to search for |
Definition at line 4179 of file pbx.c.
References E_MATCH, NULL, and pbx_extension_helper().
Referenced by __analog_ss_thread(), __ast_goto_if_exists(), __ast_pbx_run(), _macro_exec(), acf_isexten_exec(), action_originate(), add_to_regcontext(), analog_ss_thread(), ast_app_dtget(), ast_bridge_setup_after_goto(), ast_pbx_outgoing_exten_predial(), ast_sip_persistent_endpoint_update_state(), cb_events(), chan_pjsip_cng_tone_detected(), cli_console_dial(), comeback_goto(), conf_run(), console_dial(), dahdi_handle_dtmf(), dial_exec_full(), dialplan_has_destination_cb(), disa_exec(), dp_lookup(), dundi_lookup_local(), fax_detect_framehook(), findmeexec(), get_also_info(), get_destination(), get_refer_info(), gosub_exec(), handle_clear_alarms(), handle_gosub(), isexten_function_read(), jingle_new(), join_conference_bridge(), key_dial_page(), leave_voicemail(), local_call(), local_devicestate(), loopback_exists(), mgcp_ss(), minivm_greet_exec(), misdn_overlap_dial_task(), my_handle_dtmf(), new_subscribe(), onModeChanged(), ooh323_rtp_read(), options_on_rx_request(), pbx_builtin_waitexten(), phone_check_exception(), privacy_exec(), process_ast_dsp(), process_sdp(), readexten_exec(), refer_incoming_attended_request(), refer_incoming_blind_request(), register_peer_exten(), setsubstate(), show_debug_helper(), sip_new(), sip_read(), skinny_dialer(), socket_process_helper(), try_calling(), vm_authenticate(), and waitstream_core().
int ast_explicit_goto | ( | struct ast_channel * | chan, |
const char * | context, | ||
const char * | exten, | ||
int | priority | ||
) |
Definition at line 6987 of file pbx.c.
References ast_channel_context_set(), ast_channel_exten_set(), ast_channel_flags(), ast_channel_lock, ast_channel_priority_set(), ast_channel_unlock, AST_FLAG_IN_AUTOLOOP, ast_strlen_zero, ast_test_flag, and ast_exten::priority.
Referenced by __ast_goto_if_exists(), app_control_continue(), ast_async_goto(), ast_bridge_setup_after_goto(), disa_exec(), handle_setpriority(), msg_route(), and pbx_parseable_goto().
int ast_extension_close | ( | const char * | pattern, |
const char * | data, | ||
int | needmore | ||
) |
Definition at line 2418 of file pbx.c.
References ast_log, E_CANMATCH, E_MATCHMORE, extension_match_core(), and LOG_WARNING.
Referenced by lua_find_extension(), and realtime_switch_common().
int ast_extension_cmp | ( | const char * | a, |
const char * | b | ||
) |
Determine if one extension should match before another.
a | extension to compare with b |
b | extension to compare with a |
Checks whether or extension a should match before extension b
0 | if the two extensions have equal matching priority |
1 | on a > b |
-1 | on a < b |
Definition at line 2183 of file pbx.c.
References ext_cmp().
Referenced by lua_extension_cmp().
static int ast_extension_match | ( | const char * | pattern, |
const char * | extension | ||
) |
Determine if a given extension matches a given pattern (in NXX format)
pattern | pattern to match |
extension | extension to check against the pattern. |
Checks whether or not the given extension matches the given pattern.
1 | on match |
0 | on failure |
Definition at line 4297 of file extconf.c.
References E_MATCH, and extension_match_core().
Referenced by ast_ignore_pattern(), do_say(), find_matching_priority(), load_module(), loopback_canmatch(), loopback_exists(), loopback_matchmore(), lua_find_extension(), manager_show_dialplan_helper(), matchcid(), misdn_cfg_is_msn_valid(), realtime_switch_common(), reload(), and show_dialplan_helper().
int ast_extension_patmatch | ( | const char * | pattern, |
const char * | data | ||
) |
int ast_extension_state | ( | struct ast_channel * | c, |
const char * | context, | ||
const char * | exten | ||
) |
Uses hint and devicestate callback to get the state of an extension.
c | this is not important |
context | which context to look in |
exten | which extension to get state |
Uses hint and devicestate callback to get the state of an extension.
Definition at line 3170 of file pbx.c.
References internal_extension_state_extended(), and NULL.
Referenced by action_extensionstate(), extstate_read(), and get_queue_member_status().
const char* ast_extension_state2str | ( | int | extension_state | ) |
Return string representation of the state of an extension.
extension_state | is the numerical state delivered by ast_extension_state |
Return string representation of the state of an extension.
Definition at line 3126 of file pbx.c.
References ARRAY_LEN, extension_states, and cfextension_states::text.
Referenced by action_extensionstate(), action_extensionstatelist(), AST_TEST_DEFINE(), exten_state_publisher_state_cb(), extensionstate_update(), handle_request_subscribe(), handle_show_device2extenstate(), handle_show_hint(), handle_show_hints(), manager_state_cb(), show_channels_cb(), skinny_extensionstate_cb(), and to_ami().
int ast_extension_state_add | ( | const char * | context, |
const char * | exten, | ||
ast_state_cb_type | change_cb, | ||
void * | data | ||
) |
Add watcher for extension states.
context | which context to look in |
exten | which extension to get state |
change_cb | callback to call if state changed |
data | to pass to callback |
-1 | on failure |
0 | Global watcher added successfully |
ID | on success |
Definition at line 3825 of file pbx.c.
References extension_state_add_destroy(), and NULL.
Referenced by __init_manager(), create_queue_member(), publisher_start(), and skinny_register().
int ast_extension_state_add_destroy | ( | const char * | context, |
const char * | exten, | ||
ast_state_cb_type | change_cb, | ||
ast_state_cb_destroy_type | destroy_cb, | ||
void * | data | ||
) |
Add watcher for extension states with destructor.
context | which context to look in |
exten | which extension to get state |
change_cb | callback to call if state changed |
destroy_cb | callback to call when the watcher is destroyed. |
data | to pass to callbacks |
-1 | on failure |
0 | Global watcher added successfully |
ID | on success |
Definition at line 3819 of file pbx.c.
References extension_state_add_destroy().
int ast_extension_state_add_destroy_extended | ( | const char * | context, |
const char * | exten, | ||
ast_state_cb_type | change_cb, | ||
ast_state_cb_destroy_type | destroy_cb, | ||
void * | data | ||
) |
Add watcher for extended extension states with destructor.
context | which context to look in |
exten | which extension to get state |
change_cb | callback to call if state changed |
destroy_cb | callback to call when the watcher is destroyed. |
data | to pass to callbacks |
-1 | on failure |
0 | Global watcher added successfully |
ID | on success |
Definition at line 3831 of file pbx.c.
References extension_state_add_destroy().
Referenced by handle_request_subscribe(), and subscription_established().
int ast_extension_state_add_extended | ( | const char * | context, |
const char * | exten, | ||
ast_state_cb_type | change_cb, | ||
void * | data | ||
) |
Add watcher for extended extension states.
context | which context to look in |
exten | which extension to get state |
change_cb | callback to call if state changed |
data | to pass to callback |
-1 | on failure |
0 | Global watcher added successfully |
ID | on success |
Definition at line 3837 of file pbx.c.
References extension_state_add_destroy(), and NULL.
int ast_extension_state_del | ( | int | id, |
ast_state_cb_type | change_cb | ||
) |
Deletes a state change watcher by ID.
id | of the state watcher to delete (0 for global watcher) |
change_cb | callback to call if state changed (Used if id == 0 (global)) |
0 | success |
-1 | failure |
Definition at line 3858 of file pbx.c.
References ao2_callback, ao2_find, ao2_lock, ao2_ref, ao2_unlock, ast_hint::callbacks, find_hint_by_cb_id(), and OBJ_UNLINK.
Referenced by destroy_queue_member_cb(), dialog_unlink_all(), handle_request_subscribe(), skinny_session_cleanup(), subscription_shutdown(), and unload_module().
int ast_extension_state_extended | ( | struct ast_channel * | c, |
const char * | context, | ||
const char * | exten, | ||
struct ao2_container ** | device_state_info | ||
) |
Uses hint and devicestate callback to get the extended state of an extension.
c | this is not important | |
context | which context to look in | |
exten | which extension to get state | |
[out] | device_state_info | ptr to an ao2_container with extended state info, must be unref'd after use. |
Uses hint and devicestate callback to get the extended state of an extension.
Definition at line 3176 of file pbx.c.
References alloc_device_state_info(), ao2_ref, container, get_device_state_causing_channels(), internal_extension_state_extended(), and NULL.
Referenced by exten_state_data_alloc(), and handle_request_subscribe().
int ast_findlabel_extension | ( | struct ast_channel * | c, |
const char * | context, | ||
const char * | exten, | ||
const char * | label, | ||
const char * | callerid | ||
) |
Find the priority of an extension that has the specified label.
c | this is not important |
context | which context to look in |
exten | which extension to search for |
label | label of the action within the extension to match to priority |
callerid | callerid to search for |
the | priority which matches the given label in the extension |
-1 | if not found. |
Definition at line 4184 of file pbx.c.
References E_FINDLABEL, NULL, and pbx_extension_helper().
Referenced by action_originate(), action_redirect(), ari_channels_handle_originate_with_id(), ast_ari_channels_continue_in_dialplan(), eval_exten_read(), handle_gosub(), handle_setpriority(), isexten_function_read(), and pbx_parseable_goto().
static int ast_findlabel_extension2 | ( | struct ast_channel * | c, |
struct ast_context * | con, | ||
const char * | exten, | ||
const char * | label, | ||
const char * | callerid | ||
) |
Find the priority of an extension that has the specified label.
Definition at line 4978 of file extconf.c.
References E_FINDLABEL, NULL, and pbx_extension_helper().
Referenced by pbx_load_config().
int ast_func_read | ( | struct ast_channel * | chan, |
const char * | function, | ||
char * | workspace, | ||
size_t | len | ||
) |
executes a read operation on a function
chan | Channel to execute on |
function | Data containing the function call string (will be modified) |
workspace | A pointer to safe memory to use for a return value |
len | the number of bytes in workspace |
This application executes a function in read mode on a given channel.
0 | success |
non-zero | failure |
Definition at line 599 of file pbx_functions.c.
References __ast_module_user_add(), __ast_module_user_remove(), args, ast_copy_string(), ast_custom_function_find(), ast_free, ast_log, ast_str_buffer(), ast_str_create, ast_str_size(), ast_strdupa, copy(), func_args(), is_read_allowed(), LOG_ERROR, ast_custom_function::mod, NULL, ast_custom_function::read, ast_custom_function::read2, and str.
Referenced by action_getvar(), assign_uuid(), fetch_access_token(), fetch_google_access_token(), generate_status(), handle_getvariable(), lua_get_variable_value(), and pbx_substitute_variables_helper_full().
int ast_func_read2 | ( | struct ast_channel * | chan, |
const char * | function, | ||
struct ast_str ** | str, | ||
ssize_t | maxlen | ||
) |
executes a read operation on a function
chan | Channel to execute on |
function | Data containing the function call string (will be modified) |
str | A dynamic string buffer into which to place the result. |
maxlen | <0 if the dynamic buffer should not grow; >0 if the dynamic buffer should be limited to that number of bytes; 0 if the dynamic buffer has no upper limit |
This application executes a function in read mode on a given channel.
0 | success |
non-zero | failure |
Definition at line 642 of file pbx_functions.c.
References __ast_module_user_add(), __ast_module_user_remove(), args, ast_custom_function_find(), ast_log, ast_str_buffer(), ast_str_make_space, ast_str_reset(), ast_str_size(), ast_strdupa, copy(), func_args(), is_read_allowed(), LOG_ERROR, maxsize, ast_custom_function::mod, NULL, ast_custom_function::read, ast_custom_function::read2, ast_custom_function::read_max, and VAR_BUF_SIZE.
Referenced by ast_ari_channels_get_channel_var(), ast_str_substitute_variables_full(), AST_TEST_DEFINE(), and channel_get_external_vars().
int ast_func_write | ( | struct ast_channel * | chan, |
const char * | function, | ||
const char * | value | ||
) |
executes a write operation on a function
chan | Channel to execute on |
function | Data containing the function call string (will be modified) |
value | A value parameter to pass for writing |
This application executes a function in write mode on a given channel.
0 | success |
non-zero | failure |
Definition at line 692 of file pbx_functions.c.
References __ast_module_user_add(), __ast_module_user_remove(), args, ast_custom_function_find(), ast_log, ast_strdupa, copy(), func_args(), is_write_allowed(), LOG_ERROR, ast_custom_function::mod, NULL, and ast_custom_function::write.
Referenced by ast_channel_hangupcause_hash_set(), AST_TEST_DEFINE(), chanavail_exec(), conf_run(), confbridge_exec(), fetch_google_access_token(), pbx_builtin_pushvar_helper(), pbx_builtin_setvar_helper(), setup_profile_bridge(), setup_profile_caller(), and setup_profile_paged().
static const char * ast_get_context_name | ( | struct ast_context * | con | ) |
Definition at line 421 of file ael_main.c.
References ast_walk_context_extensions(), ast_exten::exten, ast_context::name, and NULL.
Referenced by _macro_exec(), add_extension(), ast_add_hint(), ast_change_hint(), ast_compile_ael2(), ast_context_add_include2(), ast_context_add_switch2(), ast_context_destroy(), ast_context_remove_include2(), ast_context_remove_switch2(), ast_context_verify_includes(), ast_merge_contexts_and_delete(), ast_remove_hint(), complete_dialplan_add_extension(), complete_dialplan_add_ignorepat(), complete_dialplan_add_include(), complete_dialplan_remove_context(), complete_dialplan_remove_extension(), complete_dialplan_remove_ignorepat(), complete_dialplan_remove_include(), complete_show_dialplan_context(), context_merge_incls_swits_igps_other_registrars(), device_state_notify_callbacks(), dundi_precache_full(), extension_is_compatible(), find_matching_endif(), find_matching_endwhile(), find_matching_priority(), handle_cli_dialplan_save(), handle_show_hint(), handle_show_hints(), manager_show_dialplan_helper(), presence_state_notify_callbacks(), print_hintdevices_key(), print_hints_key(), show_debug_helper(), and show_dialplan_helper().
const char* ast_get_context_registrar | ( | struct ast_context * | c | ) |
Definition at line 8566 of file pbx.c.
References NULL, and ast_context::registrar.
Referenced by handle_cli_dialplan_save(), show_debug_helper(), and show_dialplan_helper().
const char* ast_get_extension_app | ( | struct ast_exten * | e | ) |
Definition at line 8596 of file pbx.c.
References ast_exten::app, and NULL.
Referenced by _macro_exec(), add_extension(), ast_add_hint(), ast_change_hint(), ast_extension_state2(), ast_get_hint(), ast_str_get_hint(), check_retrieve_call_extensions(), device_state_notify_callbacks(), extension_is_compatible(), extension_presence_state_helper(), find_matching_endif(), find_matching_endwhile(), handle_cli_dialplan_save(), handle_show_hint(), handle_show_hints(), manager_show_dialplan_helper(), parking_is_exten_park(), presence_state_notify_callbacks(), and print_ext().
void* ast_get_extension_app_data | ( | struct ast_exten * | e | ) |
Definition at line 8601 of file pbx.c.
References ast_exten::data, and NULL.
Referenced by _macro_exec(), add_extension(), ast_get_hint(), ast_str_get_hint(), get_extension_data(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), parking_blind_transfer_park(), and print_ext().
const char* ast_get_extension_cidmatch | ( | struct ast_exten * | e | ) |
Definition at line 8591 of file pbx.c.
References ast_exten::cidmatch_display, and NULL.
Referenced by complete_dialplan_remove_extension(), find_matching_priority(), handle_cli_dialplan_save(), and test_exten().
struct ast_context* ast_get_extension_context | ( | struct ast_exten * | exten | ) |
Definition at line 8543 of file pbx.c.
References NULL, and ast_exten::parent.
Referenced by ast_add_hint(), ast_change_hint(), ast_remove_hint(), device_state_notify_callbacks(), extension_is_compatible(), handle_show_hint(), handle_show_hints(), presence_state_notify_callbacks(), print_hintdevices_key(), and print_hints_key().
const char* ast_get_extension_label | ( | struct ast_exten * | e | ) |
Definition at line 8553 of file pbx.c.
References ast_exten::label, and NULL.
Referenced by handle_cli_dialplan_save(), manager_show_dialplan_helper(), and show_dialplan_helper().
int ast_get_extension_matchcid | ( | struct ast_exten * | e | ) |
Definition at line 8586 of file pbx.c.
References ast_exten::matchcid.
Referenced by complete_dialplan_remove_extension(), find_matching_priority(), and handle_cli_dialplan_save().
const char* ast_get_extension_name | ( | struct ast_exten * | exten | ) |
Definition at line 8548 of file pbx.c.
References ast_exten::name, and NULL.
Referenced by ast_add_hint(), ast_change_hint(), ast_remove_hint(), complete_core_show_hint(), complete_dialplan_remove_extension(), device_state_notify_callbacks(), dundi_precache_full(), extension_is_compatible(), find_matching_priority(), handle_cli_dialplan_save(), handle_show_hint(), handle_show_hints(), hint_hash(), manager_show_dialplan_helper(), presence_state_notify_callbacks(), print_hintdevices_key(), print_hints_key(), show_dialplan_helper(), and test_exten().
int ast_get_extension_priority | ( | struct ast_exten * | exten | ) |
Definition at line 8558 of file pbx.c.
References ast_exten::priority.
Referenced by complete_dialplan_remove_extension(), find_matching_priority(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), and print_ext().
const char* ast_get_extension_registrar | ( | struct ast_exten * | e | ) |
Definition at line 8571 of file pbx.c.
References NULL, and ast_exten::registrar.
Referenced by extension_is_compatible(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), parking_duration_callback(), parking_lot_cfg_create_extensions(), and show_dialplan_helper_extension_output().
const char* ast_get_extension_registrar_file | ( | struct ast_exten * | e | ) |
Get name of configuration file used by registrar to register this extension.
NULL | if registrar did not indicate config file when registering the extension |
name | of the file used to register the extension |
Definition at line 8576 of file pbx.c.
References NULL, and ast_exten::registrar_file.
Referenced by show_dialplan_helper_extension_output().
int ast_get_extension_registrar_line | ( | struct ast_exten * | e | ) |
Get line number of configuration file used by registrar to register this extension.
0 | if the line wasn't indicated when the extension was registered |
positive | integer indicating what line in the config file was responsible for registering the extension. |
Definition at line 8581 of file pbx.c.
References ast_exten::registrar_line.
Referenced by show_dialplan_helper_extension_output().
int ast_get_hint | ( | char * | hint, |
int | hintsize, | ||
char * | name, | ||
int | namesize, | ||
struct ast_channel * | c, | ||
const char * | context, | ||
const char * | exten | ||
) |
If an extension hint exists, return non-zero.
hint | buffer for hint |
hintsize | size of hint buffer, in bytes |
name | buffer for name portion of hint |
namesize | size of name buffer |
c | Channel from which to return the hint. This is only important when the hint or name contains an expression to be expanded. |
context | which context to look in |
exten | which extension to search for |
If an extension hint exists, return non-zero.
Definition at line 4141 of file pbx.c.
References ast_copy_string(), ast_get_extension_app(), ast_get_extension_app_data(), ast_hint_extension(), and tmp().
Referenced by action_extensionstate(), device_state_cb(), get_cid_name(), get_destination(), hint_read(), manager_state_cb(), skinny_extensionstate_cb(), and state_notify_build_xml().
const char* ast_get_ignorepat_name | ( | const struct ast_ignorepat * | ip | ) |
Definition at line 42 of file pbx_ignorepat.c.
References NULL, and ast_ignorepat::pattern.
Referenced by ast_context_add_ignorepat2(), ast_context_remove_ignorepat2(), ast_ignore_pattern(), complete_dialplan_remove_ignorepat(), context_merge_incls_swits_igps_other_registrars(), handle_cli_dialplan_save(), lookup_c_ip(), manager_show_dialplan_helper(), and show_dialplan_helper().
const char* ast_get_ignorepat_registrar | ( | const struct ast_ignorepat * | ip | ) |
Definition at line 47 of file pbx_ignorepat.c.
References NULL, and ast_ignorepat::registrar.
Referenced by __ast_context_destroy(), ast_context_remove_ignorepat2(), context_merge_incls_swits_igps_other_registrars(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), and show_dialplan_helper().
const char* ast_get_include_name | ( | const struct ast_include * | include | ) |
Definition at line 50 of file pbx_include.c.
References ast_include::name, and NULL.
Referenced by ast_context_add_include2(), ast_context_remove_include2(), complete_dialplan_remove_include(), context_merge_incls_swits_igps_other_registrars(), find_matching_priority(), handle_cli_dialplan_save(), lookup_ci(), manager_show_dialplan_helper(), and show_dialplan_helper().
const char* ast_get_include_registrar | ( | const struct ast_include * | i | ) |
Definition at line 60 of file pbx_include.c.
References NULL, and ast_include::registrar.
Referenced by __ast_context_destroy(), ast_context_remove_include2(), context_merge_incls_swits_igps_other_registrars(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), and show_dialplan_helper().
const char* ast_get_switch_data | ( | const struct ast_sw * | sw | ) |
Definition at line 53 of file pbx_sw.c.
References ast_sw::data, and NULL.
Referenced by ast_context_add_switch2(), ast_context_remove_switch2(), context_merge_incls_swits_igps_other_registrars(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), pbx_find_extension(), and show_dialplan_helper().
int ast_get_switch_eval | ( | const struct ast_sw * | sw | ) |
Definition at line 58 of file pbx_sw.c.
References ast_sw::eval.
Referenced by context_merge_incls_swits_igps_other_registrars(), and pbx_find_extension().
const char* ast_get_switch_name | ( | const struct ast_sw * | sw | ) |
Definition at line 48 of file pbx_sw.c.
References ast_sw::name, and NULL.
Referenced by ast_context_add_switch2(), ast_context_remove_switch2(), context_merge_incls_swits_igps_other_registrars(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), pbx_find_extension(), and show_dialplan_helper().
const char* ast_get_switch_registrar | ( | const struct ast_sw * | sw | ) |
Definition at line 63 of file pbx_sw.c.
References NULL, and ast_sw::registrar.
Referenced by __ast_context_destroy(), ast_context_remove_switch2(), context_merge_incls_swits_igps_other_registrars(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), and show_dialplan_helper().
int ast_goto_if_exists | ( | struct ast_channel * | chan, |
const char * | context, | ||
const char * | exten, | ||
int | priority | ||
) |
Definition at line 8793 of file pbx.c.
References __ast_goto_if_exists().
Referenced by ast_bridge_setup_after_goto(), background_detect_exec(), channel_spy(), common_exec(), conf_run(), goto_exten(), onedigit_goto(), select_entry(), valid_exit(), vm_execmain(), and vmauthenticate().
int ast_hashtab_compare_contexts | ( | const void * | ah_a, |
const void * | ah_b | ||
) |
hashtable functions for contexts
Definition at line 589 of file ael_main.c.
References ast_hashtab_hash_contexts(), bc, and ast_context::name.
Referenced by ast_context_find_or_create(), lua_register_hints(), lua_register_switches(), main(), pbx_find_extension(), and pbx_load_module().
unsigned int ast_hashtab_hash_contexts | ( | const void * | obj | ) |
Definition at line 596 of file ael_main.c.
References ast_hashtab_hash_string(), and ast_context::name.
Referenced by ast_context_find_or_create(), ast_hashtab_compare_contexts(), lua_register_hints(), lua_register_switches(), and pbx_load_module().
int ast_hint_presence_state | ( | struct ast_channel * | c, |
const char * | context, | ||
const char * | exten, | ||
char ** | subtype, | ||
char ** | message | ||
) |
Uses hint and presence state callback to get the presence state of an extension.
c | this is not important | |
context | which context to look in | |
exten | which extension to get state | |
[out] | subtype | Further information regarding the presence returned |
[out] | message | Custom message further describing current presence |
Definition at line 3226 of file pbx.c.
References ao2_lock, ao2_unlock, ast_exten::app, ast_add_extension(), ast_free_ptr(), ast_hint_extension(), ast_strdup, ast_exten::cidmatch, ast_exten::data, ast_exten::exten, extension_presence_state_helper(), ast_exten::label, ast_exten::matchcid, ast_context::name, NULL, ast_exten::parent, ast_exten::priority, and ast_exten::registrar.
Referenced by exten_state_data_alloc(), and handle_request_subscribe().
int ast_ignore_pattern | ( | const char * | context, |
const char * | pattern | ||
) |
Checks to see if a number should be ignored.
context | context to search within |
pattern | to check whether it should be ignored or not |
Check if a number should be ignored with respect to dialtone cancellation.
0 | if the pattern should not be ignored |
non-zero | if the pattern should be ignored |
Definition at line 6921 of file pbx.c.
References ast_context_find(), ast_context_ignorepats_count(), ast_context_ignorepats_get(), ast_extension_match(), ast_get_ignorepat_name(), ast_rdlock_contexts(), and ast_unlock_contexts().
Referenced by __analog_ss_thread(), analog_ss_thread(), ast_app_dtget(), disa_exec(), dp_lookup(), dundi_lookup_local(), and mgcp_ss().
int ast_matchmore_extension | ( | struct ast_channel * | c, |
const char * | context, | ||
const char * | exten, | ||
int | priority, | ||
const char * | callerid | ||
) |
Looks to see if adding anything to this extension might match something. (exists ^ canmatch)
c | not really important XXX |
context | context to serach within |
exten | extension to check |
priority | priority of extension path |
callerid | callerid of extension being searched for |
Definition at line 4199 of file pbx.c.
References E_MATCHMORE, NULL, and pbx_extension_helper().
Referenced by __analog_ss_thread(), __ast_pbx_run(), analog_ss_thread(), ast_app_dtget(), collect_digits(), disa_exec(), dp_lookup(), dundi_lookup_local(), handle_clear_alarms(), key_dial_page(), loopback_matchmore(), mgcp_ss(), pbx_builtin_background(), readexten_exec(), and skinny_dialer().
void ast_merge_contexts_and_delete | ( | struct ast_context ** | extcontexts, |
struct ast_hashtab * | exttable, | ||
const char * | registrar | ||
) |
Merge the temporary contexts into a global contexts list and delete from the global list the ones that are being added.
extcontexts | pointer to the ast_context structure |
exttable | pointer to the ast_hashtab structure that contains all the elements in extcontexts |
registrar | of the context; if it's set the routine will delete all contexts that belong to that registrar; if NULL only the contexts that are specified in extcontexts |
Definition at line 639 of file conf2ael.c.
References __ast_internal_context_destroy(), ao2_callback, ao2_container_count(), ao2_find, ao2_iterator_destroy(), AO2_ITERATOR_DONTLOCK, ao2_iterator_init(), ao2_iterator_next, ao2_link, ao2_lock, ao2_ref, ao2_unlock, ast_exten::app, ast_add_extension_nolock(), ast_calloc, ast_copy_string(), ast_free, ast_free_ptr(), ast_get_context_name(), ast_hashtab_destroy(), ast_hashtab_end_traversal(), ast_hashtab_next(), ast_hashtab_start_traversal, ast_hint_extension_nolock(), AST_HINT_UPDATE_DEVICE, AST_LIST_HEAD_NOLOCK_INIT_VALUE, AST_LIST_INSERT_HEAD, AST_LIST_INSERT_TAIL, AST_LIST_REMOVE_HEAD, ast_mutex_lock, ast_mutex_unlock, ast_strdup, ast_tvdiff_us(), ast_tvnow(), ast_unlock_contexts(), ast_verb, ast_wrlock_contexts(), ast_hint::callbacks, store_hint::callbacks, ast_state_cb::change_cb, store_hint::context, context_merge(), context_merge_lock, context_table_create_autohints(), contexts, contexts_table, ast_exten::data, ast_state_cb::data, E_MATCH, execute_state_callback(), ast_exten::exten, ast_hint::exten, store_hint::exten, ast_hint::last_presence_message, store_hint::last_presence_message, ast_hint::last_presence_state, store_hint::last_presence_state, ast_hint::last_presence_subtype, store_hint::last_presence_subtype, ast_hint::laststate, store_hint::laststate, localized_merge_contexts_and_delete(), ast_context::name, ast_exten::next, ast_context::next, NULL, OBJ_UNLINK, ast_exten::parent, pbx_find_extension(), PRIORITY_HINT, ast_exten::registrar, pbx_find_info::stacklen, and tmp().
Referenced by ast_context_verify_includes(), lua_reload_extensions(), and pbx_load_module().
int ast_parseable_goto | ( | struct ast_channel * | chan, |
const char * | goto_string | ||
) |
Definition at line 8859 of file pbx.c.
References pbx_parseable_goto().
Referenced by _if_exec(), _while_exec(), ast_bridge_setup_after_goto(), dial_exec_full(), gosub_exec(), ivr_dispatch(), pbx_builtin_goto(), and while_continue_exec().
void ast_pbx_h_exten_run | ( | struct ast_channel * | chan, |
const char * | context | ||
) |
Run the h exten from the given context.
chan | Channel to run the h exten on. |
context | Context the h exten is in. |
Definition at line 4209 of file pbx.c.
References ast_channel_caller(), ast_channel_context(), ast_channel_context_set(), ast_channel_exten(), ast_channel_exten_set(), ast_channel_flags(), ast_channel_lock, ast_channel_name(), ast_channel_priority(), ast_channel_priority_set(), ast_channel_unlock, ast_debug, AST_FLAG_BRIDGE_HANGUP_RUN, AST_FLAG_IN_AUTOLOOP, ast_set2_flag, ast_set_flag, AST_SOFTHANGUP_HANGUP_EXEC, ast_softhangup_nolock(), ast_spawn_extension(), ast_test_flag, ast_verb, NULL, and S_COR.
Referenced by __ast_pbx_run(), and ast_bridge_setup_after_goto().
void ast_pbx_hangup_handler_destroy | ( | struct ast_channel * | chan | ) |
Destroy the hangup handler container on a channel.
chan | Channel to destroy the hangup handler container on. |
Definition at line 103 of file pbx_hangup_handler.c.
References ast_channel_hangup_handlers(), ast_channel_lock, ast_channel_unlock, ast_free, and AST_LIST_REMOVE_HEAD.
Referenced by ast_channel_destructor(), and ast_dummy_channel_destructor().
void ast_pbx_hangup_handler_init | ( | struct ast_channel * | chan | ) |
Init the hangup handler container on a channel.
chan | Channel to init the hangup handler container on. |
Definition at line 95 of file pbx_hangup_handler.c.
References ast_channel_hangup_handlers(), and AST_LIST_HEAD_INIT_NOLOCK.
Referenced by __ast_channel_alloc_ap(), and __ast_dummy_channel_alloc().
int ast_pbx_hangup_handler_pop | ( | struct ast_channel * | chan | ) |
Pop the top of the channel hangup handler stack.
chan | Channel to push the hangup handler onto. |
TRUE | if a handler was popped off of the stack. |
Definition at line 119 of file pbx_hangup_handler.c.
References ast_hangup_handler::args, ast_channel_hangup_handlers(), ast_channel_lock, ast_channel_unlock, ast_free, AST_LIST_REMOVE_HEAD, and publish_hangup_handler_message().
Referenced by func_channel_write_real().
void ast_pbx_hangup_handler_push | ( | struct ast_channel * | chan, |
const char * | handler | ||
) |
Push the given hangup handler onto the channel hangup handler stack.
chan | Channel to push the hangup handler onto. |
handler | Gosub application parameter string. |
Definition at line 138 of file pbx_hangup_handler.c.
References ast_hangup_handler::args, ast_app_expand_sub_args(), ast_channel_hangup_handlers(), ast_channel_lock, ast_channel_unlock, ast_free, AST_LIST_INSERT_HEAD, ast_malloc, ast_strlen_zero, and publish_hangup_handler_message().
Referenced by func_channel_write_real().
int ast_pbx_hangup_handler_run | ( | struct ast_channel * | chan | ) |
Run all hangup handlers on the channel.
chan | Channel to run the hangup handlers on. |
Zero | if no hangup handlers run. |
non-zero | if hangup handlers were run. |
Definition at line 58 of file pbx_hangup_handler.c.
References ast_hangup_handler::args, ast_app_exec_sub(), ast_channel_hangup_handlers(), ast_channel_lock, ast_channel_unlock, ast_free, AST_LIST_EMPTY, AST_LIST_REMOVE_HEAD, AST_SOFTHANGUP_HANGUP_EXEC, ast_softhangup_nolock(), NULL, and publish_hangup_handler_message().
Referenced by __ast_pbx_run(), and ast_hangup().
int ast_pbx_outgoing_app | ( | const char * | type, |
struct ast_format_cap * | cap, | ||
const char * | addr, | ||
int | timeout, | ||
const char * | app, | ||
const char * | appdata, | ||
int * | reason, | ||
int | synchronous, | ||
const char * | cid_num, | ||
const char * | cid_name, | ||
struct ast_variable * | vars, | ||
const char * | account, | ||
struct ast_channel ** | locked_channel, | ||
const struct ast_assigned_ids * | assignedids | ||
) |
Synchronously or asynchronously make an outbound call and execute an application on the channel.
Note that when the application stops executing, the channel is hungup.
type | The channel technology to create |
cap | The format capabilities for the channel |
addr | Address data to pass to the channel technology driver |
timeout | How long we should attempt to dial the outbound channel |
app | The name of the application to execute |
appdata | Data to pass to the application |
reason | Optional. If provided, the dialed status of the outgoing channel. Codes are AST_CONTROL_xxx values. Valid only if synchronous is non-zero. |
synchronous | defined by the ast_pbx_outgoing_sync enum. If AST_OUTGOING_NO_WAIT then don't wait for anything. If AST_OUTGOING_WAIT then block until the outbound channel answers or the call fails. If AST_OUTGOING_WAIT_COMPLETE then wait for the call to complete or fail. |
cid_num | The caller ID number to set on the outbound channel |
cid_name | The caller ID name to set on the outbound channel |
vars | Variables to set on the outbound channel |
account | The accountcode for the outbound channel |
locked_channel | Optional. The outbound channel that was created if success is returned. Otherwise it is set to NULL. This is returned both locked and reference bumped. |
assignedids | Optional. The uniqueid(s) to assign the channel(s) that are created. |
0 | on success |
-1 | on failure |
Definition at line 8015 of file pbx.c.
References ast_pbx_outgoing_app_predial(), and NULL.
Referenced by action_originate(), attempt_thread(), fast_originate(), and orig_app().
int ast_pbx_outgoing_app_predial | ( | const char * | type, |
struct ast_format_cap * | cap, | ||
const char * | addr, | ||
int | timeout, | ||
const char * | app, | ||
const char * | appdata, | ||
int * | reason, | ||
int | synchronous, | ||
const char * | cid_num, | ||
const char * | cid_name, | ||
struct ast_variable * | vars, | ||
const char * | account, | ||
struct ast_channel ** | locked_channel, | ||
const struct ast_assigned_ids * | assignedids, | ||
const char * | predial_callee | ||
) |
Definition at line 8025 of file pbx.c.
References ast_strlen_zero, NULL, and pbx_outgoing_attempt().
Referenced by ast_pbx_outgoing_app(), and originate_exec().
int ast_pbx_outgoing_exten | ( | const char * | type, |
struct ast_format_cap * | cap, | ||
const char * | addr, | ||
int | timeout, | ||
const char * | context, | ||
const char * | exten, | ||
int | priority, | ||
int * | reason, | ||
int | synchronous, | ||
const char * | cid_num, | ||
const char * | cid_name, | ||
struct ast_variable * | vars, | ||
const char * | account, | ||
struct ast_channel ** | locked_channel, | ||
int | early_media, | ||
const struct ast_assigned_ids * | assignedids | ||
) |
Synchronously or asynchronously make an outbound call and send it to a particular extension.
type | The channel technology to create |
cap | The format capabilities for the channel |
addr | Address data to pass to the channel technology driver |
timeout | How long we should attempt to dial the outbound channel |
context | The destination context for the outbound channel |
exten | The destination extension for the outbound channel |
priority | The destination priority for the outbound channel |
reason | Optional. If provided, the dialed status of the outgoing channel. Codes are AST_CONTROL_xxx values. Valid only if synchronous is non-zero. |
synchronous | defined by the ast_pbx_outgoing_sync enum. If AST_OUTGOING_NO_WAIT then don't wait for anything. If AST_OUTGOING_WAIT then block until the outbound channel answers or the call fails. If AST_OUTGOING_WAIT_COMPLETE then wait for the call to complete or fail. If AST_OUTGOING_WAIT or AST_OUTGOING_WAIT_COMPLETE is specified, the call doesn't answer, and failed exists then run a channel named OutgoingSpoolFailed at failed . |
cid_num | The caller ID number to set on the outbound channel |
cid_name | The caller ID name to set on the outbound channel |
vars | Variables to set on the outbound channel |
account | The accountcode for the outbound channel |
locked_channel | Optional. The outbound channel that was created if success is returned. Otherwise it is set to NULL. This is returned both locked and reference bumped. |
early_media | If non-zero the channel "answers" when progress is indicated. |
assignedids | Optional. The uniqueid(s) to assign the channel(s) that are created. |
0 | on success |
-1 | on failure |
Definition at line 7951 of file pbx.c.
References ast_pbx_outgoing_exten_predial(), and NULL.
Referenced by action_originate(), attempt_thread(), fast_originate(), hook_launch_thread(), and orig_exten().
int ast_pbx_outgoing_exten_predial | ( | const char * | type, |
struct ast_format_cap * | cap, | ||
const char * | addr, | ||
int | timeout, | ||
const char * | context, | ||
const char * | exten, | ||
int | priority, | ||
int * | reason, | ||
int | synchronous, | ||
const char * | cid_num, | ||
const char * | cid_name, | ||
struct ast_variable * | vars, | ||
const char * | account, | ||
struct ast_channel ** | locked_channel, | ||
int | early_media, | ||
const struct ast_assigned_ids * | assignedids, | ||
const char * | predial_callee | ||
) |
Definition at line 7961 of file pbx.c.
References ast_assert, ast_channel_alloc, ast_channel_name(), ast_channel_unlock, ast_exists_extension(), ast_hangup(), ast_log, ast_pbx_run(), ast_set_variables(), AST_STATE_DOWN, LOG_ERROR, NULL, pbx_builtin_setvar_helper(), and pbx_outgoing_attempt().
Referenced by ast_pbx_outgoing_exten(), and originate_exec().
enum ast_pbx_result ast_pbx_run | ( | struct ast_channel * | c | ) |
Execute the PBX in the current thread.
c | channel to run the pbx on |
This executes the PBX on a given channel. It allocates a new PBX structure for the channel, and provides all PBX functionality. See ast_pbx_start for an asynchronous function to run the PBX in a new thread as opposed to the current one.
Zero | on success |
non-zero | on failure |
Definition at line 4759 of file pbx.c.
References ast_pbx_run_args(), and NULL.
Referenced by __analog_ss_thread(), analog_ss_thread(), ari_originate_dial(), ast_bridge_run_after_goto(), ast_pbx_outgoing_exten_predial(), do_notify(), mgcp_ss(), pbx_outgoing_exec(), skinny_newcall(), and unistim_ss().
enum ast_pbx_result ast_pbx_run_args | ( | struct ast_channel * | c, |
struct ast_pbx_args * | args | ||
) |
Execute the PBX in the current thread.
c | channel to run the pbx on |
args | options for the pbx |
This executes the PBX on a given channel. It allocates a new PBX structure for the channel, and provides all PBX functionality. See ast_pbx_start for an asynchronous function to run the PBX in a new thread as opposed to the current one.
Zero | on success |
non-zero | on failure |
Definition at line 4739 of file pbx.c.
References __ast_pbx_run(), ast_log, AST_OPT_FLAG_FULLY_BOOTED, ast_options, AST_PBX_CALL_LIMIT, AST_PBX_FAILED, AST_PBX_SUCCESS, ast_test_flag, decrease_call_count(), increase_call_count(), and LOG_WARNING.
Referenced by action_dialplan_exec(), ast_pbx_run(), handle_gosub(), msg_route(), and stasis_app_exec().
enum ast_pbx_result ast_pbx_start | ( | struct ast_channel * | c | ) |
Create a new thread and start the PBX.
c | channel to start the pbx on |
Zero | on success |
non-zero | on failure |
Definition at line 4712 of file pbx.c.
References ast_log, AST_OPT_FLAG_FULLY_BOOTED, ast_options, AST_PBX_CALL_LIMIT, AST_PBX_FAILED, AST_PBX_SUCCESS, ast_pthread_create_detached, ast_test_flag, decrease_call_count(), increase_call_count(), LOG_WARNING, NULL, and pbx_thread().
Referenced by alsa_new(), ast_async_goto(), ast_iax2_new(), bridge_failed_peer_goto(), console_new(), dahdi_new(), dial_exec_full(), do_monitor_headset(), generic_recall(), handle_request_invite(), handle_response_clip(), handle_response_cmgr(), jingle_action_session_initiate(), local_call(), mgcp_new(), nbs_new(), ooh323_new(), oss_new(), pbx_start_chan(), pbx_start_incoming_request(), phone_new(), skinny_new(), unistim_new(), and wait_for_digits().
int ast_processed_calls | ( | void | ) |
Retrieve the total number of calls processed through the PBX since last restart.
Definition at line 4769 of file pbx.c.
References totalcalls.
Referenced by ast_var_Config(), get_total_call_count(), handle_chanlist(), and handle_showcalls().
int ast_rdlock_context | ( | struct ast_context * | con | ) |
Read locks a given context.
con | context to lock |
0 | on success |
-1 | on failure |
Definition at line 8525 of file pbx.c.
References ast_rwlock_rdlock, and ast_context::lock.
Referenced by _macro_exec(), complete_dialplan_remove_ignorepat(), complete_dialplan_remove_include(), dundi_precache_full(), find_matching_endif(), find_matching_endwhile(), handle_cli_dialplan_save(), lookup_c_ip(), lookup_ci(), manager_show_dialplan_helper(), show_debug_helper(), and show_dialplan_helper().
int ast_rdlock_contexts | ( | void | ) |
Read locks the context list.
0 | on success |
-1 | on error |
Definition at line 8507 of file pbx.c.
References ast_mutex_lock, and conlock.
Referenced by _macro_exec(), ast_context_find(), ast_context_find_or_create(), ast_hint_extension(), ast_ignore_pattern(), ast_unregister_application(), complete_dialplan_add_extension(), complete_dialplan_add_ignorepat(), complete_dialplan_add_include(), complete_dialplan_remove_context(), complete_dialplan_remove_extension(), complete_dialplan_remove_ignorepat(), complete_dialplan_remove_include(), complete_show_dialplan_context(), dundi_precache_full(), find_context_locked(), find_matching_endif(), find_matching_endwhile(), get_extension_data(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), pbx_extension_helper(), show_debug_helper(), show_dialplan_helper(), and unreference_cached_app().
int ast_register_switch | ( | struct ast_switch * | sw | ) |
Register an alternative dialplan switch.
sw | switch to register |
This function registers a populated ast_switch structure with the asterisk switching architecture.
0 | success |
non-zero | failure |
Definition at line 58 of file pbx_switch.c.
References ast_log, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_switch::list, LOG_WARNING, ast_switch::name, and tmp().
Referenced by load_module().
int ast_spawn_extension | ( | struct ast_channel * | c, |
const char * | context, | ||
const char * | exten, | ||
int | priority, | ||
const char * | callerid, | ||
int * | found, | ||
int | combined_find_spawn | ||
) |
Launch a new extension (i.e. new stack)
c | not important |
context | which context to generate the extension within |
exten | new extension to add |
priority | priority of new extension |
callerid | callerid of extension |
found | |
combined_find_spawn | This adds a new extension to the asterisk extension list. |
0 | on success |
-1 | on failure. |
Definition at line 4204 of file pbx.c.
References E_SPAWN, NULL, and pbx_extension_helper().
Referenced by __ast_pbx_run(), _macro_exec(), ast_pbx_h_exten_run(), gosub_run(), and loopback_exec().
int ast_str_get_hint | ( | struct ast_str ** | hint, |
ssize_t | hintsize, | ||
struct ast_str ** | name, | ||
ssize_t | namesize, | ||
struct ast_channel * | c, | ||
const char * | context, | ||
const char * | exten | ||
) |
If an extension hint exists, return non-zero.
hint | buffer for hint |
hintsize | Maximum size of hint buffer (<0 to prevent growth, >0 to limit growth to that number of bytes, or 0 for unlimited growth) |
name | buffer for name portion of hint |
namesize | Maximum size of name buffer (<0 to prevent growth, >0 to limit growth to that number of bytes, or 0 for unlimited growth) |
c | Channel from which to return the hint. This is only important when the hint or name contains an expression to be expanded. |
context | which context to look in |
exten | which extension to search for |
If an extension hint exists, return non-zero.
Definition at line 4159 of file pbx.c.
References ast_get_extension_app(), ast_get_extension_app_data(), ast_hint_extension(), ast_str_set(), and tmp().
Referenced by ast_str_retrieve_variable().
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().
int ast_thread_inhibit_escalations | ( | void | ) |
Inhibit (in the current thread) the execution of dialplan functions which cause privilege escalations. If pbx_live_dangerously() has been called, this function has no effect.
Definition at line 479 of file pbx_functions.c.
References ast_log, ast_threadstorage_get(), LOG_ERROR, NULL, and thread_inhibit_escalations_tl.
Referenced by ast_add_extension2_lockopt(), and handle_tcptls_connection().
int ast_thread_inhibit_escalations_swap | ( | int | inhibit | ) |
Swap the current thread escalation inhibit setting.
inhibit | New setting. Non-zero to inhibit. |
1 | if dangerous function execution was inhibited. |
0 | if dangerous function execution was allowed. |
-1 | on error. |
Definition at line 494 of file pbx_functions.c.
References ast_log, ast_threadstorage_get(), LOG_ERROR, NULL, and thread_inhibit_escalations_tl.
Referenced by ast_add_extension2_lockopt().
int ast_unlock_context | ( | struct ast_context * | con | ) |
Unlocks | the given context |
con | context to unlock |
0 | on success |
-1 | on failure |
Definition at line 8530 of file pbx.c.
References ast_rwlock_unlock, and ast_context::lock.
Referenced by __ast_context_destroy(), _macro_exec(), add_hints(), ast_add_extension2_lockopt(), ast_context_add_ignorepat2(), ast_context_add_include2(), ast_context_add_switch2(), ast_context_remove_extension_callerid2(), ast_context_remove_ignorepat2(), ast_context_remove_include2(), ast_context_remove_switch2(), complete_dialplan_remove_ignorepat(), complete_dialplan_remove_include(), dundi_precache_full(), find_matching_endif(), find_matching_endwhile(), handle_cli_dialplan_save(), lookup_c_ip(), lookup_ci(), manager_show_dialplan_helper(), parking_duration_callback(), parking_lot_cfg_create_extensions(), show_debug_helper(), and show_dialplan_helper().
int ast_unlock_contexts | ( | void | ) |
Unlocks contexts.
0 | on success |
-1 | on failure |
Definition at line 8512 of file pbx.c.
References ast_mutex_unlock, and conlock.
Referenced by _macro_exec(), add_hints(), ast_add_extension(), ast_context_add_ignorepat(), ast_context_add_include(), ast_context_add_switch(), ast_context_destroy(), ast_context_destroy_by_name(), ast_context_find(), ast_context_find_or_create(), ast_context_lockmacro(), ast_context_remove_extension_callerid(), ast_context_remove_ignorepat(), ast_context_remove_include(), ast_context_remove_switch(), ast_context_unlockmacro(), ast_hint_extension(), ast_ignore_pattern(), ast_merge_contexts_and_delete(), ast_unregister_application(), complete_dialplan_add_extension(), complete_dialplan_add_ignorepat(), complete_dialplan_add_include(), complete_dialplan_remove_context(), complete_dialplan_remove_extension(), complete_dialplan_remove_ignorepat(), complete_dialplan_remove_include(), complete_show_dialplan_context(), dundi_precache_full(), find_context_locked(), find_matching_endif(), find_matching_endwhile(), get_extension_data(), handle_cli_dialplan_save(), manager_dialplan_extension_add(), manager_show_dialplan_helper(), parking_duration_callback(), parking_lot_cfg_create_extensions(), pbx_extension_helper(), show_debug_helper(), show_dialplan_helper(), and unreference_cached_app().
void ast_unregister_switch | ( | struct ast_switch * | sw | ) |
Unregister an alternative switch.
sw | switch to unregister |
Unregisters a switch from asterisk.
Definition at line 76 of file pbx_switch.c.
References AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and ast_switch::list.
Referenced by __unload_module(), and unload_module().
static struct ast_exten * ast_walk_context_extensions | ( | struct ast_context * | con, |
struct ast_exten * | priority | ||
) |
Definition at line 427 of file ael_main.c.
References ast_walk_context_includes(), ast_exten::next, NULL, and ast_context::root.
Referenced by ast_get_context_name(), complete_dialplan_remove_extension(), context_used(), dundi_precache_full(), find_matching_priority(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), pbx_find_extension(), show_dialplan_helper(), and unreference_cached_app().
const struct ast_ignorepat* ast_walk_context_ignorepats | ( | const struct ast_context * | con, |
const struct ast_ignorepat * | ip | ||
) |
Definition at line 8707 of file pbx.c.
References ast_context_ignorepats_count(), ast_context_ignorepats_get(), ast_exten::next, and NULL.
const struct ast_include * ast_walk_context_includes | ( | const struct ast_context * | con, |
const struct ast_include * | inc | ||
) |
Definition at line 657 of file conf2ael.c.
References ast_context_includes_count(), ast_context_includes_get(), AST_VECTOR_GET, context, ast_context::includes, ast_exten::next, NULL, and pbx_find_extension().
Referenced by ast_walk_context_extensions().
const struct ast_sw* ast_walk_context_switches | ( | const struct ast_context * | con, |
const struct ast_sw * | sw | ||
) |
Definition at line 8623 of file pbx.c.
References ast_context_switches_count(), ast_context_switches_get(), ast_exten::next, and NULL.
static struct ast_context * ast_walk_contexts | ( | struct ast_context * | con | ) |
Definition at line 618 of file conf2ael.c.
References ast_context_destroy(), contexts, localized_walk_contexts(), ast_context::next, and ast_exten::registrar.
Referenced by _macro_exec(), ast_cli_unregister_multiple(), ast_context_find(), complete_dialplan_add_extension(), complete_dialplan_add_ignorepat(), complete_dialplan_add_include(), complete_dialplan_remove_context(), complete_dialplan_remove_extension(), complete_dialplan_remove_ignorepat(), complete_dialplan_remove_include(), complete_show_dialplan_context(), dundi_precache_full(), find_matching_endif(), find_matching_endwhile(), find_matching_priority(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), pbx_load_module(), show_debug_helper(), show_dialplan_helper(), and unreference_cached_app().
static struct ast_exten * ast_walk_extension_priorities | ( | struct ast_exten * | exten, |
struct ast_exten * | priority | ||
) |
Definition at line 4063 of file extconf.c.
References ast_exten::exten, and ast_exten::peer.
Referenced by complete_dialplan_remove_extension(), find_matching_priority(), handle_cli_dialplan_save(), manager_show_dialplan_helper(), show_dialplan_helper(), and unreference_cached_app().
int ast_wrlock_context | ( | struct ast_context * | con | ) |
Write locks a given context.
con | context to lock |
0 | on success |
-1 | on failure |
Definition at line 8520 of file pbx.c.
References ast_rwlock_wrlock, and ast_context::lock.
Referenced by __ast_context_destroy(), add_hints(), ast_add_extension2_lockopt(), ast_context_add_ignorepat2(), ast_context_add_include2(), ast_context_add_switch2(), ast_context_remove_extension_callerid2(), ast_context_remove_ignorepat2(), ast_context_remove_include2(), ast_context_remove_switch2(), parking_duration_callback(), and parking_lot_cfg_create_extensions().
int ast_wrlock_contexts | ( | void | ) |
Write locks the context list.
0 | on success |
-1 | on error |
Definition at line 8502 of file pbx.c.
References ast_mutex_lock, and conlock.
Referenced by add_hints(), ast_context_destroy(), ast_context_destroy_by_name(), ast_context_find_or_create(), ast_merge_contexts_and_delete(), complete_dialplan_remove_include(), manager_dialplan_extension_add(), parking_duration_callback(), and parking_lot_cfg_create_extensions().
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_raise_exception | ( | struct ast_channel * | chan, |
const char * | data | ||
) |
Definition at line 703 of file pbx_builtins.c.
References raise_exception().
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, c, localized_pbx_builtin_setvar(), LOG_WARNING, name, pbx_builtin_setvar_helper(), pbx_substitute_variables_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 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().
int pbx_checkcondition | ( | const char * | condition | ) |
Evaluate a condition.
0 | if the condition is NULL or of zero length |
int | If the string is an integer, the integer representation of the integer is returned |
1 | Any other non-empty string |
Definition at line 8321 of file pbx.c.
References ast_strlen_zero.
Referenced by _if_exec(), _macro_exec(), _while_exec(), acf_if(), execif_exec(), gosubif_exec(), macroif_exec(), pbx_builtin_gotoif(), and testtime_write().
int pbx_exec | ( | struct ast_channel * | c, |
struct ast_app * | app, | ||
const char * | data | ||
) |
Execute an application.
c | channel to execute on |
app | which app to execute |
data | the data passed into the app |
This application executes an application on a given channel. It saves the stack and executes the given application passing in the given data.
0 | success |
-1 | failure |
c | Channel |
app | Application |
data | Data for execution |
Definition at line 471 of file pbx_app.c.
References __ast_module_user_add(), __ast_module_user_remove(), ast_channel_appl(), ast_channel_appl_set(), ast_channel_data(), ast_channel_data_set(), ast_channel_lock, ast_channel_publish_snapshot(), ast_channel_unlock, ast_app::execute, NULL, and S_OR.
Referenced by aelsub_exec(), answer_exec_run(), ari_channel_thread(), ari_originate_dial(), ast_app_exec_macro(), AST_TEST_DEFINE(), bridge_check_monitor(), bridge_stasis_run_cb(), conf_run(), conf_start_record(), disa_exec(), do_magic_pickup(), dundi_exec(), exec_exec(), execif_exec(), forward_message(), handle_exec(), iax2_exec(), lua_pbx_exec(), page_exec(), pbx_builtin_execiftime(), pbx_extension_helper(), pbx_outgoing_exec(), realtime_exec(), run_app_helper(), snoop_stasis_thread(), try_calling(), and tryexec_exec().
static struct ast_exten * pbx_find_extension | ( | struct ast_channel * | chan, |
struct ast_context * | bypass, | ||
struct pbx_find_info * | q, | ||
const char * | context, | ||
const char * | exten, | ||
int | priority, | ||
const char * | label, | ||
const char * | callerid, | ||
enum ext_match_t | action | ||
) |
Definition at line 152 of file ael_main.c.
References ast_autoservice_start(), ast_autoservice_stop(), ast_context_includes_count(), ast_context_includes_get(), ast_context_switches_count(), ast_context_switches_get(), ast_debug, ast_get_switch_data(), ast_get_switch_eval(), ast_get_switch_name(), ast_hashtab_compare_contexts(), ast_hashtab_lookup(), ast_log, AST_PBX_MAX_STACK, ast_str_buffer(), ast_str_size(), ast_str_thread_get(), ast_strdupa, ast_strlen_zero, ast_walk_context_extensions(), ast_switch::canmatch, scoreboard::canmatch_exten, context, create_match_char_tree(), pbx_find_info::data, E_CANMATCH, E_FINDLABEL, E_MATCHMORE, ast_switch::exists, ast_exten::exten, scoreboard::exten, extension_match_core(), find_context(), pbx_find_info::foundcontext, include_rname(), include_valid(), pbx_find_info::incstack, ast_exten::label, scoreboard::last_char, localized_find_extension(), LOG_NOTICE, LOG_WARNING, match(), ast_exten::matchcid, ast_switch::matchmore, ast_exten::name, ast_context::name, new_find_extension(), scoreboard::node, NULL, ast_context::pattern_tree, pbx_findswitch(), pbx_substitute_variables_helper(), ast_exten::priority, ast_context::root_table, pbx_find_info::stacklen, pbx_find_info::status, STATUS_NO_CONTEXT, STATUS_NO_EXTENSION, STATUS_NO_LABEL, STATUS_NO_PRIORITY, STATUS_SUCCESS, strsep(), switch_data, pbx_find_info::swo, tmp(), scoreboard::total_length, scoreboard::total_specificity, and trie_find_next_match().
Referenced by add_extension(), ast_hint_extension_nolock(), ast_log(), ast_merge_contexts_and_delete(), ast_sip_persistent_endpoint_update_state(), ast_walk_context_includes(), check_goto(), check_pval_item(), check_retrieve_call_extensions(), conf_ended(), delete_extens(), get_extension_data(), parking_blind_transfer_park(), parking_duration_callback(), parking_is_exten_park(), parking_lot_cfg_create_extensions(), pbx_extension_helper(), register_peer_exten(), and test_exten().
struct ast_app * pbx_findapp | ( | const char * | app | ) |
Look up an application.
app | name of the app |
This function searches for the ast_app structure within the apps that are registered for the one with the name you passed in.
Definition at line 165 of file ael_main.c.
References ast_custom_function_find(), AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, namelist::name, and pbx_findapp_nolock().
Referenced by aelsub_exec(), answer_exec_run(), ari_channel_thread(), ari_originate_dial(), ast_app_exec_macro(), AST_TEST_DEFINE(), bridge_check_monitor(), bridge_stasis_run_cb(), conf_run(), conf_start_record(), disa_exec(), do_magic_pickup(), dundi_exec(), exec_exec(), execif_exec(), forward_message(), handle_exec(), iax2_exec(), lua_pbx_exec(), page_exec(), pbx_builtin_execiftime(), pbx_extension_helper(), pbx_outgoing_exec(), realtime_exec(), run_app_helper(), snoop_stasis_thread(), try_calling(), and tryexec_exec().
void pbx_live_dangerously | ( | int | new_live_dangerously | ) |
Enable/disable the execution of 'dangerous' functions from external protocols (AMI, etc.).
These dialplan functions (such as SHELL
) provide an opportunity for privilege escalation. They are okay to invoke from the dialplan, but external protocols with permission controls should not normally invoke them.
This function can globally enable/disable the execution of dangerous functions from external protocols.
new_live_dangerously | If true, enable the execution of escalating functions from external protocols. |
Definition at line 466 of file pbx_functions.c.
References ast_log, live_dangerously, LOG_NOTICE, and LOG_WARNING.
Referenced by load_asterisk_conf().
void pbx_retrieve_variable | ( | struct ast_channel * | c, |
const char * | var, | ||
char ** | ret, | ||
char * | workspace, | ||
int | workspacelen, | ||
struct varshead * | headp | ||
) |
Retrieve the value of a builtin variable or variable from the channel variable stack.
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().
int pbx_set_autofallthrough | ( | int | newval | ) |
Set "autofallthrough" flag, if newval is <0, does not actually set. If set to 1, sets to auto fall through. If newval set to 0, sets to no auto fall through (reads extension instead). Returns previous value.
Definition at line 4774 of file pbx.c.
References autofallthrough.
Referenced by pbx_load_module().
int pbx_set_extenpatternmatchnew | ( | int | newval | ) |
Set "extenpatternmatchnew" flag, if newval is <0, does not actually set. If set to 1, sets to use the new Trie-based pattern matcher. If newval set to 0, sets to use the old linear-search algorithm. Returns previous value.
Definition at line 4781 of file pbx.c.
References extenpatternmatchnew.
Referenced by AST_TEST_DEFINE(), handle_set_extenpatternmatchnew(), handle_unset_extenpatternmatchnew(), and pbx_load_module().
void pbx_set_overrideswitch | ( | const char * | newval | ) |
Set "overrideswitch" field. If set and of nonzero length, all contexts will be tried directly through the named switch prior to any other matching within that context.
Definition at line 4788 of file pbx.c.
References ast_free, ast_strdup, ast_strlen_zero, and NULL.
Referenced by pbx_load_module().
static void pbx_substitute_variables_helper | ( | struct ast_channel * | c, |
const char * | cp1, | ||
char * | cp2, | ||
int | count | ||
) |
Definition at line 211 of file ael_main.c.
References ast_channel_varshead(), AST_MAX_EXTENSION, NULL, and pbx_substitute_variables_helper_full().
Referenced by __ast_cli_register_multiple(), add_extensions(), ast_add_extension2_lockopt(), AST_TEST_DEFINE(), dtmf_store_framehook(), escape_and_substitute(), eval_exten_read(), function_eval(), get_mapping_weight(), import_helper(), launch_monitor_thread(), load_values_config(), manager_log(), pbx_builtin_importvar(), pbx_builtin_setvar(), pbx_extension_helper(), pbx_find_extension(), pbx_load_config(), realtime_exec(), rotate_file(), substituted(), test_chan_function(), test_chan_integer(), test_chan_integer_accessor(), test_chan_string(), test_chan_variable(), and write_cel().
void pbx_substitute_variables_helper_full | ( | struct ast_channel * | c, |
struct varshead * | headp, | ||
const char * | cp1, | ||
char * | cp2, | ||
int | cp2_size, | ||
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().