Asterisk - The Open Source Telephony Project
18.5.0
|
Convenient Application Routines. More...
#include "asterisk.h"
#include <sys/stat.h>
#include <regex.h>
#include <sys/file.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <dirent.h>
#include <sys/capability.h>
#include "asterisk/paths.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/file.h"
#include "asterisk/app.h"
#include "asterisk/dsp.h"
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#include "asterisk/indications.h"
#include "asterisk/linkedlists.h"
#include "asterisk/threadstorage.h"
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/astobj2.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/json.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | groups |
struct | linear_state |
struct | path_lock |
struct | path_lock_list |
struct | zombie |
struct | zombies |
Macros | |
#define | AST_MAX_FORMATS 10 |
#define | FMT "%30Lf%9s" |
#define | RES_EXIT (1 << 17) |
#define | RES_REPEAT (1 << 18) |
#define | RES_RESTART ((1 << 19) | RES_REPEAT) |
#define | RES_UPONE (1 << 16) |
#define | VM_API_CALL(res, api_call, api_parms) |
#define | VM_GREETER_API_CALL(res, api_call, api_parms) |
Enumerations | |
enum | control_tone_frame_response_result { CONTROL_TONE_RESPONSE_FAILED = -1, CONTROL_TONE_RESPONSE_NORMAL = 0, CONTROL_TONE_RESPONSE_FINISHED = 1 } |
Functions | |
unsigned int | __ast_app_separate_args (char *buf, char delim, int remove_chars, char **array, int arraylen) |
Separate a string into arguments in an array. More... | |
static int | __ast_play_and_record (struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int *sound_duration, int beep, int silencethreshold, int maxsilence, const char *path, int prepend, const char *acceptdtmf, const char *canceldtmf, int skip_confirmation_sound, enum ast_record_if_exists if_exists) |
int | __ast_vm_greeter_register (const struct ast_vm_greeter_functions *vm_table, struct ast_module *module) |
Set voicemail greeter function callbacks. More... | |
int | __ast_vm_register (const struct ast_vm_functions *vm_table, struct ast_module *module) |
Set voicemail function callbacks. More... | |
static | AO2_GLOBAL_OBJ_STATIC (vm_provider) |
The container for the voicemail provider. More... | |
static | AO2_GLOBAL_OBJ_STATIC (vm_provider_holder) |
Holding container for the voicemail provider used while testing. More... | |
static | AO2_GLOBAL_OBJ_STATIC (vm_greeter_provider) |
The container for the voicemail greeter provider. More... | |
static void | app_cleanup (void) |
int | app_init (void) |
Initialize the application core. More... | |
int | ast_app_copy_recording_to_vm (struct ast_vm_recording_data *vm_rec_data) |
param[in] vm_rec_data Contains data needed to make the recording. retval 0 voicemail successfully created from recording. retval -1 Failure More... | |
int | ast_app_dtget (struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout) |
This function presents a dialtone and reads an extension into 'collect' which must be a pointer to a pre-initialized array of char having a size of 'size' suitable for writing to. It will collect no more than the smaller of 'maxlen' or 'size' minus the original strlen() of collect digits. More... | |
int | ast_app_exec_macro (struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const char *macro_args) |
Run a macro on a channel, placing an optional second channel into autoservice. More... | |
int | ast_app_exec_sub (struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const char *sub_args, int ignore_hangup) |
Run a subroutine on a channel, placing an optional second channel into autoservice. More... | |
const char * | ast_app_expand_sub_args (struct ast_channel *chan, const char *args) |
Add missing context/exten to subroutine argument string. More... | |
enum ast_getdata_result | ast_app_getdata (struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout) |
ast_app_getdata More... | |
int | ast_app_getdata_full (struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd) |
Full version with audiofd and controlfd. NOTE: returns '2' on ctrlfd available, not '1' like other full functions. More... | |
int | ast_app_group_discard (struct ast_channel *chan) |
Discard all group counting for a channel. More... | |
int | ast_app_group_get_count (const char *group, const char *category) |
Get the current channel count of the specified group and category. More... | |
struct ast_group_info * | ast_app_group_list_head (void) |
Get the head of the group count list. More... | |
int | ast_app_group_list_rdlock (void) |
Read Lock the group count list. More... | |
int | ast_app_group_list_unlock (void) |
Unlock the group count list. More... | |
int | ast_app_group_list_wrlock (void) |
Write Lock the group count list. More... | |
int | ast_app_group_match_get_count (const char *groupmatch, const char *category) |
Get the current channel count of all groups that match the specified pattern and category. More... | |
int | ast_app_group_set_channel (struct ast_channel *chan, const char *data) |
Set the group for a channel, splitting the provided data into group and category, if specified. More... | |
int | ast_app_group_split_group (const char *data, char *group, int group_max, char *category, int category_max) |
Split a group string into group and category, returning a default category if none is provided. More... | |
int | ast_app_group_update (struct ast_channel *old, struct ast_channel *new) |
Update all group counting for a channel to a new one. More... | |
int | ast_app_has_voicemail (const char *mailboxes, const char *folder) |
Determine if a given mailbox has any voicemail If folder is NULL, defaults to "INBOX". If folder is "INBOX", includes the number of messages in the "Urgent" folder. More... | |
int | ast_app_inboxcount (const char *mailboxes, int *newmsgs, int *oldmsgs) |
Determine number of new/old messages in a mailbox. More... | |
int | ast_app_inboxcount2 (const char *mailboxes, int *urgentmsgs, int *newmsgs, int *oldmsgs) |
Determine number of urgent/new/old messages in a mailbox. More... | |
int | ast_app_messagecount (const char *mailbox_id, const char *folder) |
Get the number of messages in a given mailbox folder. More... | |
void | ast_app_options2str64 (const struct ast_app_option *options, struct ast_flags64 *flags, char *buf, size_t len) |
Given a list of options array, return an option string based on passed flags. More... | |
int | ast_app_parse_options (const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr) |
Parses a string containing application options and sets flags/arguments. More... | |
int | ast_app_parse_options64 (const struct ast_app_option *options, struct ast_flags64 *flags, char **args, char *optstr) |
Parses a string containing application options and sets flags/arguments. More... | |
int | ast_app_parse_timelen (const char *timestr, int *result, enum ast_timelen unit) |
Common routine to parse time lengths, with optional time unit specifier. More... | |
int | ast_app_run_macro (struct ast_channel *autoservice_chan, struct ast_channel *macro_chan, const char *macro_name, const char *macro_args) |
Run a macro on a channel, placing an optional second channel into autoservice. More... | |
int | ast_app_run_sub (struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const char *sub_location, const char *sub_args, int ignore_hangup) |
Run a subroutine on a channel, placing an optional second channel into autoservice. More... | |
int | ast_app_sayname (struct ast_channel *chan, const char *mailbox_id) |
Play a recorded user name for the mailbox to the specified channel. More... | |
void | ast_close_fds_above_n (int n) |
Common routine for child processes, to close all fds prior to exec(2) More... | |
int | ast_control_streamfile (struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *suspend, const char *restart, int skipms, long *offsetms) |
Stream a file with fast forward, pause, reverse, restart. More... | |
int | ast_control_streamfile_lang (struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *suspend, const char *restart, int skipms, const char *lang, long *offsetms) |
Version of ast_control_streamfile() which allows the language of the media file to be specified. More... | |
int | ast_control_streamfile_w_cb (struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *suspend, const char *restart, int skipms, long *offsetms, ast_waitstream_fr_cb cb) |
Stream a file with fast forward, pause, reverse, restart. More... | |
int | ast_control_tone (struct ast_channel *chan, const char *tone) |
Controls playback of a tone. More... | |
int | ast_dtmf_stream (struct ast_channel *chan, struct ast_channel *peer, const char *digits, int between, unsigned int duration) |
Send a string of DTMF digits to a channel. More... | |
void | ast_dtmf_stream_external (struct ast_channel *chan, const char *digits, int between, unsigned int duration) |
Send a string of DTMF digits to a channel from an external thread. More... | |
int | ast_get_encoded_char (const char *stream, char *result, size_t *consumed) |
Decode an encoded control or extended ASCII character. More... | |
char * | ast_get_encoded_str (const char *stream, char *result, size_t result_size) |
Decode a stream of encoded control or extended ASCII characters. More... | |
void | ast_install_stack_functions (const struct ast_app_stack_funcs *funcs) |
Set stack application function callbacks. More... | |
void | ast_install_vm_test_functions (ast_vm_test_create_user_fn *vm_test_create_user_func, ast_vm_test_destroy_user_fn *vm_test_destroy_user_func) |
int | ast_ivr_menu_run (struct ast_channel *chan, struct ast_ivr_menu *menu, void *cbdata) |
Runs an IVR menu. More... | |
static int | ast_ivr_menu_run_internal (struct ast_channel *chan, struct ast_ivr_menu *menu, void *cbdata) |
int | ast_linear_stream (struct ast_channel *chan, const char *filename, int fd, int allowoverride) |
Stream a filename (or file descriptor) as a generator. More... | |
enum AST_LOCK_RESULT | ast_lock_path (const char *path) |
Lock a filesystem path. More... | |
static enum AST_LOCK_RESULT | ast_lock_path_flock (const char *path) |
static enum AST_LOCK_RESULT | ast_lock_path_lockfile (const char *path) |
int | ast_mf_stream (struct ast_channel *chan, struct ast_channel *peer, const char *digits, int between, unsigned int duration, unsigned int durationkp, unsigned int durationst, int is_external) |
Send a string of MF digits to a channel. More... | |
int | ast_play_and_prepend (struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, char *fmt, int *duration, int *sound_duration, int beep, int silencethreshold, int maxsilence) |
Record a file based on input frm a channel. Recording is performed in 'prepend' mode which works a little differently from normal recordings This function will not play a success message due to post-recording control in the application this was added for. More... | |
int | ast_play_and_record (struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int *sound_duration, int silencethreshold, int maxsilence, const char *path) |
Record a file based on input from a channel. Use default accept and cancel DTMF. This function will play "auth-thankyou" upon successful recording. More... | |
int | ast_play_and_record_full (struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int *sound_duration, int beep, int silencethreshold, int maxsilence, const char *path, const char *acceptdtmf, const char *canceldtmf, int skip_confirmation_sound, enum ast_record_if_exists if_exists) |
Record a file based on input from a channel This function will play "auth-thankyou" upon successful recording if skip_confirmation_sound is false. More... | |
int | ast_play_and_wait (struct ast_channel *chan, const char *fn) |
Play a stream and wait for a digit, returning the digit that was pressed. More... | |
struct stasis_topic * | ast_queue_topic (const char *queuename) |
Get the Stasis Message Bus API topic for queue messages for a particular queue name. More... | |
struct stasis_topic * | ast_queue_topic_all (void) |
Get the Stasis Message Bus API topic for queue messages. More... | |
char * | ast_read_textfile (const char *filename) |
Read a file into asterisk. More... | |
int | ast_record_review (struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, const char *path) |
Allow to record message and have a review option. More... | |
int | ast_safe_fork (int stop_reaper) |
Common routine to safely fork without a chance of a signal handler firing badly in the child. More... | |
void | ast_safe_fork_cleanup (void) |
Common routine to cleanup after fork'ed process is complete (if reaping was stopped) More... | |
void | ast_set_lock_type (enum AST_LOCK_TYPE type) |
Set the type of locks used by ast_lock_path() More... | |
int | ast_str_get_encoded_str (struct ast_str **str, int maxlen, const char *stream) |
Decode a stream of encoded control or extended ASCII characters. More... | |
AST_THREADSTORAGE_PUBLIC (ast_str_thread_global_buf) | |
void | ast_uninstall_vm_test_functions (void) |
int | ast_unlock_path (const char *path) |
Unlock a path. More... | |
static int | ast_unlock_path_flock (const char *path) |
static int | ast_unlock_path_lockfile (const char *path) |
int | ast_vm_greeter_is_registered (void) |
Determine if a voicemail greeter provider is registered. More... | |
void | ast_vm_greeter_unregister (const char *module_name) |
Unregister the specified voicemail greeter provider. More... | |
const char * | ast_vm_index_to_foldername (int id) |
Return name of folder, given an id. More... | |
int | ast_vm_is_registered (void) |
Determine if a voicemail provider is registered. More... | |
struct ast_vm_mailbox_snapshot * | ast_vm_mailbox_snapshot_create (const char *mailbox, const char *context, const char *folder, int descending, enum ast_vm_snapshot_sort_val sort_val, int combine_INBOX_and_OLD) |
Create a snapshot of a mailbox which contains information about every msg. More... | |
struct ast_vm_mailbox_snapshot * | ast_vm_mailbox_snapshot_destroy (struct ast_vm_mailbox_snapshot *mailbox_snapshot) |
destroy a snapshot More... | |
int | ast_vm_msg_forward (const char *from_mailbox, const char *from_context, const char *from_folder, const char *to_mailbox, const char *to_context, const char *to_folder, size_t num_msgs, const char *msg_ids[], int delete_old) |
forward a message from one mailbox to another. More... | |
int | ast_vm_msg_move (const char *mailbox, const char *context, size_t num_msgs, const char *oldfolder, const char *old_msg_ids[], const char *newfolder) |
Move messages from one folder to another. More... | |
int | ast_vm_msg_play (struct ast_channel *chan, const char *mailbox, const char *context, const char *folder, const char *msg_num, ast_vm_msg_play_cb *cb) |
Play a voicemail msg back on a channel. More... | |
int | ast_vm_msg_remove (const char *mailbox, const char *context, size_t num_msgs, const char *folder, const char *msgs[]) |
Remove/delete messages from a mailbox folder. More... | |
int | ast_vm_test_create_user (const char *context, const char *mailbox) |
int | ast_vm_test_destroy_user (const char *context, const char *mailbox) |
void | ast_vm_test_swap_table_in (const struct ast_vm_functions *vm_table) |
Swap out existing voicemail functions with a temporary set of functions for use with unit tests. More... | |
void | ast_vm_test_swap_table_out (void) |
Used after ast_vm_test_swap_table_in to restore the original set of voicemail functions. More... | |
void | ast_vm_unregister (const char *module_name) |
Unregister the specified voicemail provider. More... | |
static int | control_streamfile (struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *suspend, const char *restart, int skipms, long *offsetms, const char *lang, ast_waitstream_fr_cb cb) |
static enum control_tone_frame_response_result | control_tone_frame_response (struct ast_channel *chan, struct ast_frame *fr, struct ast_tone_zone_sound *ts, const char *tone, int *paused) |
static int | dtmf_stream (struct ast_channel *chan, const char *digits, int between, unsigned int duration, int is_external) |
static int | external_sleep (struct ast_channel *chan, int ms) |
static int | ivr_dispatch (struct ast_channel *chan, struct ast_ivr_option *option, char *exten, void *cbdata) |
static void * | linear_alloc (struct ast_channel *chan, void *params) |
static int | linear_generator (struct ast_channel *chan, void *data, int len, int samples) |
static void | linear_release (struct ast_channel *chan, void *params) |
static struct ast_frame * | make_silence (const struct ast_frame *orig) |
Construct a silence frame of the same duration as orig. More... | |
static int | mf_stream (struct ast_channel *chan, const char *digits, int between, unsigned int duration, unsigned int durationkp, unsigned int durationst, int is_external) |
static int | option_exists (struct ast_ivr_menu *menu, char *option) |
static int | option_matchmore (struct ast_ivr_menu *menu, char *option) |
static int | parse_options (const struct ast_app_option *options, void *_flags, char **args, char *optstr, int flaglen) |
static int | parse_tone_uri (char *tone_parser, const char **tone_indication, const char **tone_zone) |
static void | path_lock_destroy (struct path_lock *obj) |
static int | read_newoption (struct ast_channel *chan, struct ast_ivr_menu *menu, char *exten, int maxexten) |
static int | set_read_to_slin (struct ast_channel *chan, struct ast_format **orig_format) |
Sets a channel's read format to AST_FORMAT_SLINEAR, recording its original format. More... | |
static void * | shaun_of_the_dead (void *data) |
static void | vm_greeter_warn_no_provider (void) |
static void | vm_warn_no_provider (void) |
Convenient Application Routines.
Definition in file main/app.c.
#define AST_MAX_FORMATS 10 |
Definition at line 121 of file main/app.c.
Referenced by __ast_play_and_record().
#define FMT "%30Lf%9s" |
Referenced by ast_app_parse_timelen().
#define RES_EXIT (1 << 17) |
Definition at line 2584 of file main/app.c.
Referenced by ast_ivr_menu_run_internal(), and ivr_dispatch().
#define RES_REPEAT (1 << 18) |
Definition at line 2585 of file main/app.c.
Referenced by ast_ivr_menu_run_internal(), and ivr_dispatch().
#define RES_RESTART ((1 << 19) | RES_REPEAT) |
Definition at line 2586 of file main/app.c.
Referenced by ast_ivr_menu_run_internal(), and ivr_dispatch().
#define RES_UPONE (1 << 16) |
Definition at line 2583 of file main/app.c.
Referenced by ast_ivr_menu_run_internal(), and ivr_dispatch().
#define VM_API_CALL | ( | res, | |
api_call, | |||
api_parms | |||
) |
Definition at line 620 of file main/app.c.
Referenced by ast_app_copy_recording_to_vm(), ast_app_has_voicemail(), ast_app_inboxcount(), ast_app_inboxcount2(), ast_app_messagecount(), ast_vm_index_to_foldername(), ast_vm_mailbox_snapshot_create(), ast_vm_mailbox_snapshot_destroy(), ast_vm_msg_forward(), ast_vm_msg_move(), ast_vm_msg_play(), and ast_vm_msg_remove().
#define VM_GREETER_API_CALL | ( | res, | |
api_call, | |||
api_parms | |||
) |
Definition at line 641 of file main/app.c.
Referenced by ast_app_sayname().
Enumerator | |
---|---|
CONTROL_TONE_RESPONSE_FAILED | |
CONTROL_TONE_RESPONSE_NORMAL | |
CONTROL_TONE_RESPONSE_FINISHED |
Definition at line 1334 of file main/app.c.
unsigned int __ast_app_separate_args | ( | char * | buf, |
char | delim, | ||
int | remove_chars, | ||
char ** | array, | ||
int | arraylen | ||
) |
Separate a string into arguments in an array.
buf | The string to be parsed (this must be a writable copy, as it will be modified) |
delim | The character to be used to delimit arguments |
remove_chars | Remove backslashes and quote characters, while parsing |
array | An array of 'char *' to be filled in with pointers to the found arguments |
arraylen | The number of elements in the array (i.e. the number of arguments you will accept) |
Note: if there are more arguments in the string than the array will hold, the last element of the array will contain the remaining arguments, not separated.
The array will be completely zeroed by this function before it populates any entries.
Definition at line 2199 of file main/app.c.
References buf, NULL, paren, and quote().
|
static |
Optionally play a sound file or a beep, then record audio and video from the channel.
chan | Channel to playback to/record from. |
playfile | Filename of sound to play before recording begins. |
recordfile | Filename to record to. |
maxtime | Maximum length of recording (in seconds). |
fmt | Format(s) to record message in. Multiple formats may be specified by separating them with a '|'. |
duration | Where to store actual length of the recorded message (in milliseconds). |
sound_duration | Where to store the length of the recorded message (in milliseconds), minus any silence |
beep | Whether to play a beep before starting to record. |
silencethreshold | |
maxsilence | Length of silence that will end a recording (in milliseconds). |
path | Optional filesystem path to unlock. |
prepend | If true, prepend the recorded audio to an existing file and follow prepend mode recording rules |
acceptdtmf | DTMF digits that will end the recording. |
canceldtmf | DTMF digits that will cancel the recording. |
skip_confirmation_sound | If true, don't play auth-thankyou at end. Nice for custom recording prompts in apps. |
-1 | failure or hangup |
'S' | Recording ended from silence timeout |
't' | Recording ended from the message exceeding the maximum duration, or via DTMF in prepend mode |
dtmfchar | Recording ended via the return value's DTMF character for either cancel or accept. |
Note that we still want to use the number of seconds passed for the max message, otherwise we could get a situation where this stream is never closed (which would create a resource leak).
Definition at line 1580 of file main/app.c.
References ao2_cleanup, ast_assert, ast_channel_name(), ast_channel_start_silence_generator(), ast_channel_stop_silence_generator(), ast_closestream(), AST_CONTROL_RECORD_CANCEL, AST_CONTROL_RECORD_MUTE, AST_CONTROL_RECORD_STOP, AST_CONTROL_RECORD_SUSPEND, AST_CONTROL_VIDUPDATE, ast_copy_string(), ast_debug, ast_dsp_free(), ast_dsp_new(), ast_dsp_set_threshold(), ast_dsp_silence(), AST_FILE_MODE, ast_filedelete(), ast_filerename(), ast_format_get_name(), AST_FRAME_CONTROL, AST_FRAME_DTMF, ast_frame_dtor(), AST_FRAME_VIDEO, AST_FRAME_VOICE, ast_frfree, ast_indicate(), ast_log, AST_MAX_FORMATS, ast_opt_transmit_silence, ast_play_and_wait(), ast_read(), ast_readfile(), ast_readframe(), AST_RECORD_IF_EXISTS_APPEND, AST_RECORD_IF_EXISTS_ERROR, AST_RECORD_IF_EXISTS_FAIL, AST_RECORD_IF_EXISTS_OVERWRITE, ast_set_read_format(), ast_strdupa, ast_stream_and_wait(), ast_stream_rewind(), ast_tellstream(), ast_truncstream(), ast_unlock_path(), ast_verb, ast_waitfor(), ast_writefile(), ast_writestream(), comment, d, end, ast_frame::frametype, global_maxsilence, global_silence_threshold, ast_frame_subclass::integer, LOG_WARNING, make_silence(), muted, NULL, PATH_MAX, set_read_to_slin(), strsep(), ast_frame::subclass, and ast_dsp::totalsilence.
Referenced by ast_play_and_prepend(), ast_play_and_record(), and ast_play_and_record_full().
int __ast_vm_greeter_register | ( | const struct ast_vm_greeter_functions * | vm_table, |
struct ast_module * | module | ||
) |
Set voicemail greeter function callbacks.
vm_table | Voicemail greeter function table to install. |
module | Pointer to the module implementing the interface |
0 | on success. |
-1 | on error. |
AST_MODULE_LOAD_DECLINE | if there's already another greeter registered. |
Definition at line 552 of file main/app.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_global_obj_ref, ao2_global_obj_replace_unref, ast_log, AST_MODULE_LOAD_DECLINE, LOG_ERROR, LOG_WARNING, ast_vm_greeter_functions::module, ast_vm_greeter_functions::module_name, ast_vm_greeter_functions::module_version, NULL, RAII_VAR, table, VM_GREETER_MODULE_VERSION, and vm_table.
int __ast_vm_register | ( | const struct ast_vm_functions * | vm_table, |
struct ast_module * | module | ||
) |
Set voicemail function callbacks.
vm_table | Voicemail function table to install. |
module | Pointer to the module implementing the interface |
0 | on success. |
-1 | on error. |
AST_MODULE_LOAD_DECLINE | if there's already another provider registered. |
Definition at line 441 of file main/app.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_global_obj_ref, ao2_global_obj_replace_unref, ast_log, AST_MODULE_LOAD_DECLINE, LOG_ERROR, LOG_WARNING, ast_vm_functions::module, ast_vm_functions::module_name, ast_vm_functions::module_version, NULL, RAII_VAR, table, VM_MODULE_VERSION, and vm_table.
|
static |
The container for the voicemail provider.
Referenced by ast_app_run_sub(), ast_vm_test_swap_table_out(), and ast_vm_unregister().
|
static |
Holding container for the voicemail provider used while testing.
|
static |
The container for the voicemail greeter provider.
|
static |
Definition at line 3194 of file main/app.c.
References ao2_cleanup, child_cap, and NULL.
Referenced by app_init().
int app_init | ( | void | ) |
Initialize the application core.
0 | Success |
-1 | Failure |
Definition at line 3205 of file main/app.c.
References app_cleanup(), ast_register_cleanup(), child_cap, stasis_topic_create(), and stasis_topic_pool_create().
Referenced by asterisk_daemon().
int ast_app_copy_recording_to_vm | ( | struct ast_vm_recording_data * | vm_rec_data | ) |
param[in] vm_rec_data Contains data needed to make the recording. retval 0 voicemail successfully created from recording. retval -1 Failure
Definition at line 669 of file main/app.c.
References VM_API_CALL.
Referenced by copy_to_voicemail().
int ast_app_dtget | ( | struct ast_channel * | chan, |
const char * | context, | ||
char * | collect, | ||
size_t | size, | ||
int | maxlen, | ||
int | timeout | ||
) |
This function presents a dialtone and reads an extension into 'collect' which must be a pointer to a pre-initialized array of char having a size of 'size' suitable for writing to. It will collect no more than the smaller of 'maxlen' or 'size' minus the original strlen() of collect digits.
Present a dialtone and collect a certain length extension.
chan | struct. |
context | |
collect | |
size | |
maxlen | |
timeout | timeout in milliseconds |
Definition at line 139 of file main/app.c.
References ast_channel_caller(), ast_channel_pbx(), ast_channel_zone(), ast_exists_extension(), ast_get_indication_tone(), ast_ignore_pattern(), ast_log, ast_matchmore_extension(), ast_playtones_start(), ast_playtones_stop(), ast_tone_zone_sound_unref(), ast_waitfordigit(), ast_tone_zone_sound::data, ast_pbx::dtimeoutms, LOG_NOTICE, NULL, and S_COR.
Referenced by grab_transfer().
int ast_app_exec_macro | ( | struct ast_channel * | autoservice_chan, |
struct ast_channel * | macro_chan, | ||
const char * | macro_args | ||
) |
Run a macro on a channel, placing an optional second channel into autoservice.
This is a shorthand method that makes it very easy to run a macro on any given channel. It is perfectly reasonable to supply a NULL autoservice_chan here in case there is no channel to place into autoservice.
autoservice_chan | A channel to place into autoservice while the macro is run |
macro_chan | Channel to execute macro on. |
macro_args | Macro application argument string. |
0 | success |
-1 | on error |
Definition at line 273 of file main/app.c.
References ast_autoservice_start(), ast_autoservice_stop(), ast_channel_context(), ast_channel_exten(), ast_channel_name(), ast_channel_priority(), ast_check_hangup_locked(), ast_debug, ast_log, ast_queue_hangup(), LOG_WARNING, pbx_exec(), and pbx_findapp().
Referenced by ast_app_run_macro(), dial_exec_full(), generic_recall(), run_app_helper(), and try_calling().
int ast_app_exec_sub | ( | struct ast_channel * | autoservice_chan, |
struct ast_channel * | sub_chan, | ||
const char * | sub_args, | ||
int | ignore_hangup | ||
) |
Run a subroutine on a channel, placing an optional second channel into autoservice.
This is a shorthand method that makes it very easy to run a subroutine on any given channel. It is perfectly reasonable to supply a NULL autoservice_chan here in case there is no channel to place into autoservice.
autoservice_chan | A channel to place into autoservice while the subroutine is run |
sub_chan | Channel to execute subroutine on. |
sub_args | Gosub application argument string. |
ignore_hangup | TRUE if a hangup does not stop execution of the routine. |
0 | success |
-1 | on error |
Definition at line 370 of file main/app.c.
References app_stack_callbacks, ast_autoservice_start(), ast_autoservice_stop(), ast_check_hangup_locked(), ast_log, ast_module_running_ref, ast_module_unref, ast_queue_hangup(), LOG_WARNING, ast_app_stack_funcs::module, and ast_app_stack_funcs::run_sub.
Referenced by app_exec(), ast_app_run_sub(), ast_pbx_hangup_handler_run(), ast_pre_call(), dial_exec_full(), generic_recall(), originate_exec(), page_exec(), queue_exec(), run_app_helper(), and try_calling().
const char* ast_app_expand_sub_args | ( | struct ast_channel * | chan, |
const char * | args | ||
) |
Add missing context/exten to subroutine argument string.
chan | Channel to obtain context/exten. |
args | Gosub application argument string. |
Fills in the optional context and exten from the given channel.
New-args | Gosub argument string on success. Must be freed. |
NULL | on error. |
Definition at line 351 of file main/app.c.
References app_stack_callbacks, ast_log, ast_module_running_ref, ast_module_unref, ast_app_stack_funcs::expand_sub_args, LOG_WARNING, ast_app_stack_funcs::module, and NULL.
Referenced by app_exec(), ast_pbx_hangup_handler_push(), dial_exec_full(), and page_exec().
enum ast_getdata_result ast_app_getdata | ( | struct ast_channel * | c, |
const char * | prompt, | ||
char * | s, | ||
int | maxlen, | ||
int | timeout | ||
) |
ast_app_getdata
Plays a stream and gets DTMF data from a channel.
c | The channel to read from |
prompt | The file to stream to the channel |
s | The string to read in to. Must be at least the size of your length |
maxlen | How many digits to read (maximum) |
timeout | set timeout to 0 for "standard" timeouts. Set timeout to -1 for "ludicrous time" (essentially never times out) |
Definition at line 197 of file main/app.c.
References ast_channel_language(), ast_channel_pbx(), AST_GETDATA_EMPTY_END_TERMINATED, ast_readstring(), ast_strdupa, ast_streamfile(), ast_strlen_zero, ast_pbx::dtimeoutms, ast_pbx::rtimeoutms, strsep(), and timeout.
Referenced by auth_exec(), conf_exec(), conf_get_pin(), dictate_exec(), find_conf(), read_exec(), testclient_exec(), testserver_exec(), and vm_exec().
int ast_app_getdata_full | ( | struct ast_channel * | c, |
const char * | prompt, | ||
char * | s, | ||
int | maxlen, | ||
int | timeout, | ||
int | audiofd, | ||
int | ctrlfd | ||
) |
Full version with audiofd and controlfd. NOTE: returns '2' on ctrlfd available, not '1' like other full functions.
Definition at line 250 of file main/app.c.
References ast_channel_language(), ast_readstring_full(), ast_streamfile(), ast_strlen_zero, and timeout.
Referenced by handle_getdata().
int ast_app_group_discard | ( | struct ast_channel * | chan | ) |
Discard all group counting for a channel.
Definition at line 2162 of file main/app.c.
References ast_free, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_group_info::chan, ast_group_info::group_list, and NULL.
Referenced by ast_channel_destructor().
int ast_app_group_get_count | ( | const char * | group, |
const char * | category | ||
) |
Get the current channel count of the specified group and category.
Definition at line 2083 of file main/app.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_strlen_zero, ast_group_info::category, ast_group_info::group, ast_group_info::group_list, and NULL.
Referenced by group_count_function_read().
struct ast_group_info* ast_app_group_list_head | ( | void | ) |
Get the head of the group count list.
Definition at line 2189 of file main/app.c.
References AST_RWLIST_FIRST.
Referenced by group_count_function_read(), group_function_read(), group_list_function_read(), and group_show_channels().
int ast_app_group_list_rdlock | ( | void | ) |
Read Lock the group count list.
Definition at line 2184 of file main/app.c.
References AST_RWLIST_RDLOCK.
Referenced by group_count_function_read(), group_function_read(), group_list_function_read(), and group_show_channels().
int ast_app_group_list_unlock | ( | void | ) |
Unlock the group count list.
Definition at line 2194 of file main/app.c.
References AST_RWLIST_UNLOCK.
Referenced by group_count_function_read(), group_function_read(), group_list_function_read(), and group_show_channels().
int ast_app_group_list_wrlock | ( | void | ) |
Write Lock the group count list.
Definition at line 2179 of file main/app.c.
References AST_RWLIST_WRLOCK.
int ast_app_group_match_get_count | ( | const char * | groupmatch, |
const char * | category | ||
) |
Get the current channel count of all groups that match the specified pattern and category.
Definition at line 2103 of file main/app.c.
References ast_log, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_strlen_zero, ast_group_info::category, ast_group_info::group, ast_group_info::group_list, LOG_ERROR, LOG_NOTICE, and NULL.
Referenced by AST_TEST_DEFINE(), and group_match_count_function_read().
int ast_app_group_set_channel | ( | struct ast_channel * | chan, |
const char * | data | ||
) |
Set the group for a channel, splitting the provided data into group and category, if specified.
Definition at line 2036 of file main/app.c.
References ast_app_group_split_group(), ast_calloc, ast_free, AST_RWLIST_INSERT_TAIL, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_strlen_zero, ast_group_info::category, ast_group_info::chan, ast_group_info::group, ast_group_info::group_list, len(), and NULL.
Referenced by AST_TEST_DEFINE(), dial_exec_full(), and group_function_write().
int ast_app_group_split_group | ( | const char * | data, |
char * | group, | ||
int | group_max, | ||
char * | category, | ||
int | category_max | ||
) |
Split a group string into group and category, returning a default category if none is provided.
Definition at line 2009 of file main/app.c.
References ast_copy_string(), ast_strlen_zero, NULL, and tmp().
Referenced by ast_app_group_set_channel(), group_count_function_read(), and group_match_count_function_read().
int ast_app_group_update | ( | struct ast_channel * | old, |
struct ast_channel * | new | ||
) |
Update all group counting for a channel to a new one.
Definition at line 2143 of file main/app.c.
References ast_free, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_group_info::chan, ast_group_info::group_list, and NULL.
Referenced by channel_do_masquerade().
int ast_app_has_voicemail | ( | const char * | mailboxes, |
const char * | folder | ||
) |
Determine if a given mailbox has any voicemail If folder is NULL, defaults to "INBOX". If folder is "INBOX", includes the number of messages in the "Urgent" folder.
1 | Mailbox has voicemail |
0 | No new voicemail in specified mailbox |
-1 | Failure |
Definition at line 655 of file main/app.c.
References has_voicemail(), and VM_API_CALL.
Referenced by action_mailboxstatus(), AST_TEST_DEFINE(), has_voicemail(), mwi_update_cb(), notify_new_message(), play_dialtone(), poll_mailbox(), run_externnotify(), skinny_register(), and unistim_send_mwi_to_peer().
int ast_app_inboxcount | ( | const char * | mailboxes, |
int * | newmsgs, | ||
int * | oldmsgs | ||
) |
Determine number of new/old messages in a mailbox.
[in] | mailboxes | Mailbox specification in the format /code mbox[@context][&mbox2[@context2]][...] /code |
[out] | newmsgs | Number of messages in the "INBOX" folder. Includes number of messages in the "Urgent" folder, if any. |
[out] | oldmsgs | Number of messages in the "Old" folder. |
0 | Success |
-1 | Failure |
Definition at line 677 of file main/app.c.
References inboxcount(), and VM_API_CALL.
Referenced by AST_TEST_DEFINE(), sip_send_mwi_to_peer(), and update_registry().
int ast_app_inboxcount2 | ( | const char * | mailboxes, |
int * | urgentmsgs, | ||
int * | newmsgs, | ||
int * | oldmsgs | ||
) |
Determine number of urgent/new/old messages in a mailbox.
[in] | mailboxes | the mailbox context to use |
[out] | urgentmsgs | the urgent message count |
[out] | newmsgs | the new message count |
[out] | oldmsgs | the old message count |
Definition at line 692 of file main/app.c.
References inboxcount2(), and VM_API_CALL.
Referenced by action_mailboxcount(), AST_TEST_DEFINE(), mwi_retrieve_then_create_state(), notify_new_message(), notify_new_state(), and vm_execmain().
int ast_app_messagecount | ( | const char * | mailbox_id, |
const char * | folder | ||
) |
Get the number of messages in a given mailbox folder.
[in] | mailbox_id | Mailbox name |
[in] | folder | The folder to look in. Default is INBOX if not provided. |
Definition at line 718 of file main/app.c.
References messagecount(), and VM_API_CALL.
Referenced by acf_vmcount_exec(), and AST_TEST_DEFINE().
void ast_app_options2str64 | ( | const struct ast_app_option * | options, |
struct ast_flags64 * | flags, | ||
char * | buf, | ||
size_t | len | ||
) |
Given a list of options array, return an option string based on passed flags.
options | The array of possible options declared with AST_APP_OPTIONS |
flags | The flags of the options that you wish to populate the buffer with |
buf | The buffer to fill with the string of options |
len | The maximum length of buf |
Definition at line 2916 of file main/app.c.
References ast_test_flag64, and len().
int ast_app_parse_options | ( | const struct ast_app_option * | options, |
struct ast_flags * | flags, | ||
char ** | args, | ||
char * | optstr | ||
) |
Parses a string containing application options and sets flags/arguments.
options | The array of possible options declared with AST_APP_OPTIONS |
flags | The flag structure to have option flags set |
args | The array of argument pointers to hold arguments found |
optstr | The string containing the options to be parsed |
Definition at line 2906 of file main/app.c.
References parse_options().
Referenced by agent_login_exec(), app_exec(), ast_multicast_rtp_create_options(), AST_TEST_DEFINE(), audiosocket_request(), auth_exec(), bridge_exec(), bridgewait_exec(), cdr_read_callback(), cdr_write_callback(), chanspy_exec(), connectedline_write(), controlplayback_exec(), detect_write(), directory_exec(), disa_exec(), dundi_query_read(), dundifunc_read(), extenspy_exec(), forkcdr_exec(), handle_options(), hint_read(), manager_mixmonitor(), minivm_accmess_exec(), minivm_greet_exec(), minivm_record_exec(), mixmonitor_exec(), page_exec(), park_app_parse_data(), pbx_builtin_background(), pbx_builtin_waitexten(), pickupchan_exec(), queue_exec(), read_exec(), read_mf_exec(), read_sf_exec(), readexten_exec(), realtime_common(), receivefax_exec(), record_exec(), redirecting_write(), resetcdr_exec(), sendfax_exec(), sendurl_exec(), sla_trunk_exec(), smdi_msg_retrieve_read(), sms_exec(), softhangup_exec(), speech_background(), start_monitor_exec(), unicast_rtp_request(), vm_exec(), vm_execmain(), volume_write(), and wait_exec().
int ast_app_parse_options64 | ( | const struct ast_app_option * | options, |
struct ast_flags64 * | flags, | ||
char ** | args, | ||
char * | optstr | ||
) |
Parses a string containing application options and sets flags/arguments.
options | The array of possible options declared with AST_APP_OPTIONS |
flags | The 64-bit flag structure to have option flags set |
args | The array of argument pointers to hold arguments found |
optstr | The string containing the options to be parsed |
Definition at line 2911 of file main/app.c.
References parse_options().
Referenced by AST_TEST_DEFINE(), conf_exec(), dial_exec_full(), find_conf_realtime(), originate_exec(), and sayunixtime_exec().
int ast_app_parse_timelen | ( | const char * | timestr, |
int * | result, | ||
enum ast_timelen | defunit | ||
) |
Common routine to parse time lengths, with optional time unit specifier.
[in] | timestr | String to parse |
[in] | defunit | Default unit type |
[out] | result | Resulting value, specified in milliseconds |
0 | Success |
-1 | Failure |
Definition at line 3113 of file main/app.c.
References FMT, TIMELEN_HOURS, TIMELEN_MILLISECONDS, TIMELEN_MINUTES, and TIMELEN_SECONDS.
Referenced by ast_eivr_senddtmf(), ast_parse_arg(), new_realtime_sqlite3_db(), pbx_builtin_wait(), pbx_builtin_waitdigit(), pbx_builtin_waitexten(), senddtmf_exec(), and sendmf_exec().
int ast_app_run_macro | ( | struct ast_channel * | autoservice_chan, |
struct ast_channel * | macro_chan, | ||
const char * | macro_name, | ||
const char * | macro_args | ||
) |
Run a macro on a channel, placing an optional second channel into autoservice.
This is a shorthand method that makes it very easy to run a macro on any given channel. It is perfectly reasonable to supply a NULL autoservice_chan here in case there is no channel to place into autoservice.
autoservice_chan | A channel to place into autoservice while the macro is run |
macro_chan | Channel to execute macro on. |
macro_name | The name of the macro to run. |
macro_args | The arguments to pass to the macro. |
0 | success |
-1 | on error |
Definition at line 320 of file main/app.c.
References ast_app_exec_macro(), ast_free, ast_malloc, and ast_strlen_zero.
Referenced by ast_channel_connected_line_macro(), and ast_channel_redirecting_macro().
int ast_app_run_sub | ( | struct ast_channel * | autoservice_chan, |
struct ast_channel * | sub_chan, | ||
const char * | sub_location, | ||
const char * | sub_args, | ||
int | ignore_hangup | ||
) |
Run a subroutine on a channel, placing an optional second channel into autoservice.
This is a shorthand method that makes it very easy to run a subroutine on any given channel. It is perfectly reasonable to supply a NULL autoservice_chan here in case there is no channel to place into autoservice.
autoservice_chan | A channel to place into autoservice while the subroutine is run |
sub_chan | Channel to execute subroutine on. |
sub_location | The location of the subroutine to run. |
sub_args | The arguments to pass to the subroutine. |
ignore_hangup | TRUE if a hangup does not stop execution of the routine. |
0 | success |
-1 | on error |
Definition at line 401 of file main/app.c.
References AO2_GLOBAL_OBJ_STATIC(), ast_app_exec_sub(), ast_free, ast_malloc, and ast_strlen_zero.
Referenced by ast_channel_connected_line_sub(), and ast_channel_redirecting_sub().
int ast_app_sayname | ( | struct ast_channel * | chan, |
const char * | mailbox_id | ||
) |
Play a recorded user name for the mailbox to the specified channel.
chan | Where to play the recorded name file. |
mailbox_id | The mailbox name. |
0 | Name played without interruption |
dtmf | ASCII value of the DTMF which interrupted playback. |
-1 | Unable to locate mailbox or hangup occurred. |
Definition at line 710 of file main/app.c.
References sayname(), and VM_GREETER_API_CALL.
Referenced by play_mailbox_owner(), and spy_sayname().
void ast_close_fds_above_n | ( | int | n | ) |
Common routine for child processes, to close all fds prior to exec(2)
[in] | n | starting file descriptor number for closing all higher file descriptors |
Definition at line 3042 of file main/app.c.
References closefrom().
Referenced by app_exec(), asterisk_daemon(), icesencode(), launch_script(), mp3play(), NBScatplay(), safe_exec_prep(), send_waveform_to_fd(), spawn_mp3(), spawn_ras(), and vm_check_password_shell().
int ast_control_streamfile | ( | struct ast_channel * | chan, |
const char * | file, | ||
const char * | fwd, | ||
const char * | rev, | ||
const char * | stop, | ||
const char * | pause, | ||
const char * | restart, | ||
int | skipms, | ||
long * | offsetms | ||
) |
Stream a file with fast forward, pause, reverse, restart.
chan | Channel |
file | File to play. |
fwd,rev,stop,pause,restart | DTMF keys for media control |
skipms | Number of milliseconds to skip for fwd/rev. |
offsetms | Number of milliseconds to skip when starting the media. |
Before calling this function, set this to be the number of ms to start from the beginning of the file. When the function returns, it will be the number of ms from the beginning where the playback stopped. Pass NULL if you don't care.
0 | on success |
Non-zero | on failure |
Definition at line 1319 of file main/app.c.
References control_streamfile(), and NULL.
Referenced by controlplayback_exec(), handle_controlstreamfile(), and wait_file().
int ast_control_streamfile_lang | ( | struct ast_channel * | chan, |
const char * | file, | ||
const char * | fwd, | ||
const char * | rev, | ||
const char * | stop, | ||
const char * | suspend, | ||
const char * | restart, | ||
int | skipms, | ||
const char * | lang, | ||
long * | offsetms | ||
) |
Version of ast_control_streamfile() which allows the language of the media file to be specified.
0 | on success |
Non-zero | on failure |
Definition at line 1327 of file main/app.c.
References control_streamfile(), and NULL.
Referenced by play_on_channel().
int ast_control_streamfile_w_cb | ( | struct ast_channel * | chan, |
const char * | file, | ||
const char * | fwd, | ||
const char * | rev, | ||
const char * | stop, | ||
const char * | pause, | ||
const char * | restart, | ||
int | skipms, | ||
long * | offsetms, | ||
ast_waitstream_fr_cb | cb | ||
) |
Stream a file with fast forward, pause, reverse, restart.
chan | |
file | filename |
fwd,rev,stop,pause,restart,skipms,offsetms | |
cb | waitstream callback to invoke when fastforward or rewind occurrs. |
Before calling this function, set this to be the number of ms to start from the beginning of the file. When the function returns, it will be the number of ms from the beginning where the playback stopped. Pass NULL if you don't care.
Definition at line 1305 of file main/app.c.
References control_streamfile(), and NULL.
int ast_control_tone | ( | struct ast_channel * | chan, |
const char * | tone | ||
) |
Controls playback of a tone.
0 | on success |
Non-zero | on failure |
Definition at line 1399 of file main/app.c.
References ast_channel_zone(), AST_FRAME_CONTROL, ast_get_indication_tone(), ast_get_indication_zone(), ast_playtones_start(), ast_read_noaudio(), ast_strdupa, ast_strlen_zero, ast_tone_zone_sound_unref(), ast_tone_zone_unref(), ast_waitfor(), control_tone_frame_response(), CONTROL_TONE_RESPONSE_FAILED, CONTROL_TONE_RESPONSE_FINISHED, ast_tone_zone_sound::data, ast_frame::frametype, NULL, and parse_tone_uri().
Referenced by play_on_channel().
int ast_dtmf_stream | ( | struct ast_channel * | chan, |
struct ast_channel * | peer, | ||
const char * | digits, | ||
int | between, | ||
unsigned int | duration | ||
) |
Send a string of DTMF digits to a channel.
chan | The channel that will receive the DTMF frames |
peer | (optional) Peer channel that will be autoserviced while the primary channel is receiving DTMF |
digits | This is a string of characters representing the DTMF digits to be sent to the channel. Valid characters are "0123456789*#abcdABCD". Note: You can pass arguments 'f' or 'F', if you want to Flash the channel (if supported by the channel), or 'w' to add a 500 millisecond pause to the DTMF sequence. |
between | This is the number of milliseconds to wait in between each DTMF digit. If zero milliseconds is specified, then the default value of 100 will be used. |
duration | This is the duration that each DTMF digit should have. |
0 | on success. |
-1 | on failure or a channel hung up. |
Definition at line 981 of file main/app.c.
References ast_autoservice_start(), ast_autoservice_stop(), and dtmf_stream().
Referenced by ast_eivr_senddtmf(), bridge_channel_dtmf_stream(), dial_exec_full(), dtmf_no_bridge(), handle_cli_misdn_send_digit(), senddtmf_exec(), testclient_exec(), testserver_exec(), and wait_for_answer().
void ast_dtmf_stream_external | ( | struct ast_channel * | chan, |
const char * | digits, | ||
int | between, | ||
unsigned int | duration | ||
) |
Send a string of DTMF digits to a channel from an external thread.
chan | The channel that will receive the DTMF frames |
digits | This is a string of characters representing the DTMF digits to be sent to the channel. Valid characters are "0123456789*#abcdABCD". Note: You can pass arguments 'f' or 'F', if you want to Flash the channel (if supported by the channel), or 'w' to add a 500 millisecond pause to the DTMF sequence. |
between | This is the number of milliseconds to wait in between each DTMF digit. If zero milliseconds is specified, then the default value of 100 will be used. |
duration | This is the duration that each DTMF digit should have. |
Definition at line 996 of file main/app.c.
References dtmf_stream().
Referenced by dtmf_in_bridge().
int ast_get_encoded_char | ( | const char * | stream, |
char * | result, | ||
size_t * | consumed | ||
) |
Decode an encoded control or extended ASCII character.
[in] | stream | String to decode |
[out] | result | Decoded character |
[out] | consumed | Number of characters used in stream to encode the character |
-1 | Stream is of zero length |
0 | Success |
Definition at line 2927 of file main/app.c.
References ast_debug, ast_log, ast_strlen_zero, and LOG_ERROR.
Referenced by ast_get_encoded_str(), ast_str_get_encoded_str(), cut_internal(), filter(), function_fieldnum_helper(), function_fieldqty_helper(), replace(), shift_pop(), and unshift_push().
char* ast_get_encoded_str | ( | const char * | stream, |
char * | result, | ||
size_t | result_len | ||
) |
Decode a stream of encoded control or extended ASCII characters.
[in] | stream | Encoded string |
[out] | result | Decoded string |
[in] | result_len | Maximum size of the result buffer |
Definition at line 3002 of file main/app.c.
References ast_get_encoded_char(), and result.
Referenced by chan_pjsip_new(), listfilter(), mgcp_new(), replace(), sip_addheader(), and sip_new().
void ast_install_stack_functions | ( | const struct ast_app_stack_funcs * | funcs | ) |
Set stack application function callbacks.
funcs | Stack applications callback functions. |
Definition at line 346 of file main/app.c.
Referenced by load_module(), and unload_module().
void ast_install_vm_test_functions | ( | ast_vm_test_create_user_fn * | vm_test_create_user_func, |
ast_vm_test_destroy_user_fn * | vm_test_destroy_user_func | ||
) |
Definition at line 599 of file main/app.c.
References ast_vm_test_create_user_func, and ast_vm_test_destroy_user_func.
Referenced by load_module().
int ast_ivr_menu_run | ( | struct ast_channel * | c, |
struct ast_ivr_menu * | menu, | ||
void * | cbdata | ||
) |
Runs an IVR menu.
Definition at line 2785 of file main/app.c.
References ast_ivr_menu_run_internal().
Referenced by skel_exec().
|
static |
Definition at line 2700 of file main/app.c.
References ast_debug, AST_DIGIT_ANY, ast_log, AST_MAX_EXTENSION, exten, ivr_dispatch(), LOG_WARNING, maxretries, ast_ivr_option::option, option_exists(), ast_ivr_menu::options, read_newoption(), RES_EXIT, RES_REPEAT, RES_RESTART, RES_UPONE, and ast_ivr_menu::title.
Referenced by ast_ivr_menu_run(), and ivr_dispatch().
int ast_linear_stream | ( | struct ast_channel * | chan, |
const char * | filename, | ||
int | fd, | ||
int | allowoverride | ||
) |
Stream a filename (or file descriptor) as a generator.
Definition at line 1089 of file main/app.c.
References linear_state::allowoverride, ast_activate_generator(), ast_calloc, ast_config_AST_DATA_DIR, ast_copy_string(), ast_log, ast_strlen_zero, linear_state::autoclose, errno, linear_state::fd, and LOG_WARNING.
enum AST_LOCK_RESULT ast_lock_path | ( | const char * | path | ) |
Lock a filesystem path.
path | the path to be locked |
Definition at line 2457 of file main/app.c.
References AST_LOCK_FAILURE, ast_lock_path_flock(), ast_lock_path_lockfile(), AST_LOCK_TYPE_FLOCK, and AST_LOCK_TYPE_LOCKFILE.
Referenced by ast_module_reload(), test_vm_api_create_voicemail_files(), and vm_lock_path().
|
static |
Definition at line 2337 of file main/app.c.
References ast_alloca, ast_calloc, ast_debug, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_UNLOCK, AST_LOCK_FAILURE, AST_LOCK_PATH_NOT_FOUND, AST_LOCK_SUCCESS, AST_LOCK_TIMEOUT, ast_log, ast_strdup, errno, path_lock::fd, LOG_WARNING, NULL, path_lock::path, and path_lock_destroy().
Referenced by ast_lock_path().
|
static |
Definition at line 2263 of file main/app.c.
References ast_alloca, ast_debug, AST_FILE_MODE, AST_LOCK_PATH_NOT_FOUND, AST_LOCK_SUCCESS, AST_LOCK_TIMEOUT, ast_log, ast_random(), errno, LOG_ERROR, LOG_WARNING, and NULL.
Referenced by ast_lock_path().
int ast_mf_stream | ( | struct ast_channel * | chan, |
struct ast_channel * | peer, | ||
const char * | digits, | ||
int | between, | ||
unsigned int | duration, | ||
unsigned int | durationkp, | ||
unsigned int | durationst, | ||
int | is_external | ||
) |
Send a string of MF digits to a channel.
chan | The channel that will receive the MF frames |
peer | (optional) Peer channel that will be autoserviced while the primary channel is receiving MF |
digits | This is a string of characters representing the MF digits to be sent to the channel. Valid characters are "0123456789*#abcdABCD". Note: You can pass arguments 'f' or 'F', if you want to Flash the channel (if supported by the channel), or 'w' or 'W' to add a wink (if supported by the channel). |
between | This is the number of milliseconds to wait in between each MF digit. If zero milliseconds is specified, then the default value of 50 will be used. |
duration | This is the duration that each numeric MF digit should have. Default value is 55. |
durationkp | This is the duration that each KP digit should have. Default is 120. |
durationst | This is the duration that each ST, STP, ST2P, or ST3P digit should have. Default is 65. |
is_external | 1 if called by a thread that is not the channel's media handler thread, 0 if called by the channel's media handler thread. |
0 | on success. |
-1 | on failure or a channel hung up. |
Definition at line 967 of file main/app.c.
References ast_autoservice_start(), ast_autoservice_stop(), and mf_stream().
Referenced by dial_exec_full(), manager_play_mf(), sendmf_exec(), and wait_for_answer().
int ast_play_and_prepend | ( | struct ast_channel * | chan, |
char * | playfile, | ||
char * | recordfile, | ||
int | maxtime_sec, | ||
char * | fmt, | ||
int * | duration, | ||
int * | sound_duration, | ||
int | beep, | ||
int | silencethreshold, | ||
int | maxsilence_ms | ||
) |
Record a file based on input frm a channel. Recording is performed in 'prepend' mode which works a little differently from normal recordings This function will not play a success message due to post-recording control in the application this was added for.
chan | the channel being recorded |
playfile | Filename of sound to play before recording begins |
recordfile | Filename to save the recording |
maxtime_sec | Longest possible message length in seconds |
fmt | string containing all formats to be recorded delimited by '|' |
duration | pointer to integer for storing length of the recording |
sound_duration | pointer to integer for storing length of the recording minus all silence |
beep | whether to play a beep to prompt the recording |
silencethreshold | tolerance of noise levels that can be considered silence for the purpose of silence timeout, -1 for default |
maxsilence_ms | length of time in milliseconds which will trigger a timeout from silence, -1 for default. |
-1 | failure or hangup |
'S' | Recording ended from silence timeout |
't' | Recording either exceeded maximum duration or the call was ended via DTMF |
Definition at line 2002 of file main/app.c.
References __ast_play_and_record(), AST_RECORD_IF_EXISTS_OVERWRITE, default_acceptdtmf, default_canceldtmf, and NULL.
Referenced by vm_forwardoptions().
int ast_play_and_record | ( | struct ast_channel * | chan, |
const char * | playfile, | ||
const char * | recordfile, | ||
int | maxtime_sec, | ||
const char * | fmt, | ||
int * | duration, | ||
int * | sound_duration, | ||
int | silencethreshold, | ||
int | maxsilence_ms, | ||
const char * | path | ||
) |
Record a file based on input from a channel. Use default accept and cancel DTMF. This function will play "auth-thankyou" upon successful recording.
chan | the channel being recorded |
playfile | Filename of sound to play before recording begins |
recordfile | Filename to save the recording |
maxtime_sec | Longest possible message length in seconds |
fmt | string containing all formats to be recorded delimited by '|' |
duration | pointer to integer for storing length of the recording |
sound_duration | pointer to integer for storing length of the recording minus all silence |
silencethreshold | tolerance of noise levels that can be considered silence for the purpose of silence timeout, -1 for default |
maxsilence_ms | length of time in milliseconds which will trigger a timeout from silence, -1 for default |
path | Optional filesystem path to unlock |
-1 | failure or hangup |
'S' | Recording ended from silence timeout |
't' | Recording ended from the message exceeding the maximum duration |
dtmfchar | Recording ended via the return value's DTMF character for either cancel or accept. |
Definition at line 1997 of file main/app.c.
References __ast_play_and_record(), AST_RECORD_IF_EXISTS_OVERWRITE, default_acceptdtmf, and default_canceldtmf.
Referenced by app_exec(), ast_record_review(), conf_rec_name(), conf_run(), and setup_privacy_args().
int ast_play_and_record_full | ( | struct ast_channel * | chan, |
const char * | playfile, | ||
const char * | recordfile, | ||
int | maxtime_sec, | ||
const char * | fmt, | ||
int * | duration, | ||
int * | sound_duration, | ||
int | beep, | ||
int | silencethreshold, | ||
int | maxsilence_ms, | ||
const char * | path, | ||
const char * | acceptdtmf, | ||
const char * | canceldtmf, | ||
int | skip_confirmation_sound, | ||
enum ast_record_if_exists | if_exists | ||
) |
Record a file based on input from a channel This function will play "auth-thankyou" upon successful recording if skip_confirmation_sound is false.
chan | the channel being recorded |
playfile | Filename of sound to play before recording begins. A beep is also played when playfile completes, before the recording begins. |
recordfile | Filename to save the recording |
maxtime_sec | Longest possible message length in seconds |
fmt | string containing all formats to be recorded delimited by '|' |
duration | pointer to integer for storing length of the recording |
beep | If true, play a beep before recording begins (and doesn't play playfile) |
sound_duration | pointer to integer for storing length of the recording minus all silence |
silencethreshold | tolerance of noise levels that can be considered silence for the purpose of silence timeout, -1 for default |
maxsilence_ms | Length of time in milliseconds which will trigger a timeout from silence, -1 for default |
path | Optional filesystem path to unlock |
acceptdtmf | Character of DTMF to end and accept the recording |
canceldtmf | Character of DTMF to end and cancel the recording |
skip_confirmation_sound | If true, don't play auth-thankyou at end. Nice for custom recording prompts in apps. |
if_exists | Action to take if recording already exists. |
-1 | failure or hangup |
'S' | Recording ended from silence timeout |
't' | Recording ended from the message exceeding the maximum duration |
dtmfchar | Recording ended via the return value's DTMF character for either cancel or accept. |
Definition at line 1992 of file main/app.c.
References __ast_play_and_record(), default_canceldtmf, and S_OR.
Referenced by play_record_review(), and record_file().
int ast_play_and_wait | ( | struct ast_channel * | chan, |
const char * | fn | ||
) |
Play a stream and wait for a digit, returning the digit that was pressed.
Definition at line 1470 of file main/app.c.
References ast_channel_language(), AST_DIGIT_ANY, ast_stopstream(), ast_streamfile(), ast_waitstream(), and d.
Referenced by __ast_play_and_record(), advanced_options(), ast_record_review(), ast_say_counted_adjective(), ast_say_counted_noun(), dialout(), forward_message(), get_folder(), get_folder2(), get_folder_ja(), leave_voicemail(), minivm_greet_exec(), play_message_category(), play_message_duration(), play_record_review(), valid_priv_reply(), vm_allocate_dh(), vm_authenticate(), vm_browse_messages_en(), vm_browse_messages_es(), vm_browse_messages_gr(), vm_browse_messages_he(), vm_browse_messages_it(), vm_browse_messages_ja(), vm_browse_messages_pt(), vm_browse_messages_vi(), vm_browse_messages_zh(), vm_exec(), vm_execmain(), vm_forwardoptions(), vm_instructions_en(), vm_instructions_ja(), vm_instructions_zh(), vm_intro(), vm_intro_cs(), vm_intro_de(), vm_intro_en(), vm_intro_es(), vm_intro_fr(), vm_intro_gr(), vm_intro_he(), vm_intro_is(), vm_intro_it(), vm_intro_ja(), vm_intro_multilang(), vm_intro_nl(), vm_intro_no(), vm_intro_pl(), vm_intro_pt(), vm_intro_pt_BR(), vm_intro_se(), vm_intro_vi(), vm_intro_zh(), vm_newuser_setup(), vm_options(), vm_play_folder_name(), vm_play_folder_name_gr(), vm_play_folder_name_ja(), vm_play_folder_name_pl(), vm_play_folder_name_ua(), vm_tempgreeting(), and vmauthenticate().
struct stasis_topic* ast_queue_topic | ( | const char * | queuename | ) |
Get the Stasis Message Bus API topic for queue messages for a particular queue name.
queuename | The name for which to get the topic |
The | topic structure for queue messages for a given name |
NULL | if it failed to be found or allocated |
Definition at line 3189 of file main/app.c.
References stasis_topic_pool_get_topic().
Referenced by send_agent_complete().
struct stasis_topic* ast_queue_topic_all | ( | void | ) |
Get the Stasis Message Bus API topic for queue messages.
The | topic structure for queue messages |
NULL | if it has not been allocated |
Definition at line 3184 of file main/app.c.
References queue_topic_all.
Referenced by load_module().
char* ast_read_textfile | ( | const char * | filename | ) |
Read a file into asterisk.
Definition at line 2792 of file main/app.c.
References ast_free, ast_log, ast_malloc, errno, LOG_WARNING, and NULL.
Referenced by ast_tcptls_server_start().
int ast_record_review | ( | struct ast_channel * | chan, |
const char * | playfile, | ||
const char * | recordfile, | ||
int | maxtime, | ||
const char * | fmt, | ||
int * | duration, | ||
const char * | path | ||
) |
Allow to record message and have a review option.
Definition at line 2489 of file main/app.c.
References AST_DIGIT_ANY, ast_dsp_get_threshold_from_settings(), ast_log, ast_play_and_record(), ast_play_and_wait(), ast_stream_and_wait(), ast_verb, ast_waitfordigit(), LOG_WARNING, maxsilence, NULL, silencethreshold, and THRESHOLD_SILENCE.
Referenced by conf_rec_name(), and conf_run().
int ast_safe_fork | ( | int | stop_reaper | ) |
Common routine to safely fork without a chance of a signal handler firing badly in the child.
[in] | stop_reaper | flag to determine if sigchld handler is replaced or not |
Definition at line 3047 of file main/app.c.
References ast_calloc, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_UNLOCK, ast_log, ast_pthread_create_background, AST_PTHREADT_NULL, ast_replace_sigchld(), child_cap, errno, zombie::list, LOG_ERROR, LOG_WARNING, NULL, zombie::pid, shaun_of_the_dead(), and shaun_of_the_dead_thread.
Referenced by app_exec(), filestream_destructor(), icesencode(), launch_script(), mp3play(), NBScatplay(), send_waveform_to_fd(), spawn_mp3(), spawn_ras(), and vm_check_password_shell().
void ast_safe_fork_cleanup | ( | void | ) |
Common routine to cleanup after fork'ed process is complete (if reaping was stopped)
Definition at line 3108 of file main/app.c.
References ast_unreplace_sigchld().
Referenced by agi_exec_full(), and run_ras().
void ast_set_lock_type | ( | enum AST_LOCK_TYPE | type | ) |
Set the type of locks used by ast_lock_path()
type | the locking type to use |
Definition at line 2452 of file main/app.c.
References type.
Referenced by load_asterisk_conf().
int ast_str_get_encoded_str | ( | struct ast_str ** | str, |
int | maxlen, | ||
const char * | stream | ||
) |
Decode a stream of encoded control or extended ASCII characters.
Definition at line 3015 of file main/app.c.
References ast_get_encoded_char(), ast_str_buffer(), ast_str_make_space, ast_str_set(), ast_str_size(), ast_str_update(), buf, and zombie::next.
Referenced by sendtext_exec(), and system_exec_helper().
AST_THREADSTORAGE_PUBLIC | ( | ast_str_thread_global_buf | ) |
void ast_uninstall_vm_test_functions | ( | void | ) |
Definition at line 606 of file main/app.c.
References ast_vm_test_create_user_func, ast_vm_test_destroy_user_func, and NULL.
Referenced by unload_module().
int ast_unlock_path | ( | const char * | path | ) |
Unlock a path.
Definition at line 2473 of file main/app.c.
References AST_LOCK_TYPE_FLOCK, AST_LOCK_TYPE_LOCKFILE, ast_unlock_path_flock(), and ast_unlock_path_lockfile().
Referenced by __ast_play_and_record(), access_counter_file(), ast_module_reload(), close_mailbox(), copy_message(), count_messages(), leave_voicemail(), msg_create_from_file(), open_mailbox(), resequence_mailbox(), save_to_folder(), and test_vm_api_create_voicemail_files().
|
static |
Definition at line 2422 of file main/app.c.
References ast_alloca, ast_debug, AST_LIST_LOCK, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, path_lock::le, path_lock::path, and path_lock_destroy().
Referenced by ast_unlock_path().
|
static |
Definition at line 2300 of file main/app.c.
References ast_alloca, ast_debug, ast_log, errno, and LOG_ERROR.
Referenced by ast_unlock_path().
int ast_vm_greeter_is_registered | ( | void | ) |
Determine if a voicemail greeter provider is registered.
0 | if no provider registered. |
1 | if a provider is registered. |
Definition at line 541 of file main/app.c.
References ao2_cleanup, ao2_global_obj_ref, and table.
void ast_vm_greeter_unregister | ( | const char * | module_name | ) |
Unregister the specified voicemail greeter provider.
The | module name of the provider to unregister |
Definition at line 584 of file main/app.c.
References ao2_cleanup, ao2_global_obj_ref, ao2_global_obj_release, ast_vm_greeter_functions::module_name, and table.
Referenced by unload_module().
const char* ast_vm_index_to_foldername | ( | int | id | ) |
Return name of folder, given an id.
[in] | id | Folder id |
Definition at line 726 of file main/app.c.
References NULL, and VM_API_CALL.
int ast_vm_is_registered | ( | void | ) |
Determine if a voicemail provider is registered.
0 | if no provider registered. |
1 | if a provider is registered. |
Definition at line 430 of file main/app.c.
References ao2_cleanup, ao2_global_obj_ref, and table.
struct ast_vm_mailbox_snapshot* ast_vm_mailbox_snapshot_create | ( | const char * | mailbox, |
const char * | context, | ||
const char * | folder, | ||
int | descending, | ||
enum ast_vm_snapshot_sort_val | sort_val, | ||
int | combine_INBOX_and_OLD | ||
) |
Create a snapshot of a mailbox which contains information about every msg.
mailbox,the | mailbox to look for |
context,the | context to look for the mailbox in |
folder,OPTIONAL. | When not NULL only msgs from the specified folder will be included. |
descending,list | the msgs in descending order rather than ascending order. |
combine_INBOX_and_OLD,When | this argument is set, The OLD folder will be represented in the INBOX folder of the snapshot. This allows the snapshot to represent the OLD and INBOX messages in sorted order merged together. |
snapshot | on success |
NULL | on failure |
Definition at line 734 of file main/app.c.
References NULL, and VM_API_CALL.
Referenced by test_vm_api_remove_all_messages().
struct ast_vm_mailbox_snapshot* ast_vm_mailbox_snapshot_destroy | ( | struct ast_vm_mailbox_snapshot * | mailbox_snapshot | ) |
destroy a snapshot
mailbox_snapshot | The snapshot to destroy. |
NULL |
Definition at line 748 of file main/app.c.
References NULL, and VM_API_CALL.
Referenced by AST_TEST_DEFINE(), and test_vm_api_remove_all_messages().
int ast_vm_msg_forward | ( | const char * | from_mailbox, |
const char * | from_context, | ||
const char * | from_folder, | ||
const char * | to_mailbox, | ||
const char * | to_context, | ||
const char * | to_folder, | ||
size_t | num_msgs, | ||
const char * | msg_ids[], | ||
int | delete_old | ||
) |
forward a message from one mailbox to another.
from_mailbox The original mailbox the message is being forwarded from from_context The voicemail context of the from_mailbox from_folder The folder from which the message is being forwarded to_mailbox The mailbox to forward the message to to_context The voicemail context of the to_mailbox to_folder The folder to which the message is being forwarded num_msgs The number of messages being forwarded msg_ids The message IDs of the messages in from_mailbox to forward delete_old If non-zero, the forwarded messages are also deleted from from_mailbox. Otherwise, the messages will remain in the from_mailbox.
-1 | Failure |
0 | Success |
Definition at line 782 of file main/app.c.
References VM_API_CALL.
int ast_vm_msg_move | ( | const char * | mailbox, |
const char * | context, | ||
size_t | num_msgs, | ||
const char * | oldfolder, | ||
const char * | old_msg_ids[], | ||
const char * | newfolder | ||
) |
Move messages from one folder to another.
mailbox | The mailbox to which the folders belong |
context | The voicemail context for the mailbox |
num_msgs | The number of messages to move |
oldfolder | The folder from where messages should be moved |
old_msg_ids | The message IDs of the messages to move |
newfolder | The folder to which messages should be moved new folder. This array must be num_msgs sized. |
-1 | Failure |
0 | Success |
Definition at line 756 of file main/app.c.
References VM_API_CALL.
int ast_vm_msg_play | ( | struct ast_channel * | chan, |
const char * | mailbox, | ||
const char * | context, | ||
const char * | folder, | ||
const char * | msg_num, | ||
ast_vm_msg_play_cb * | cb | ||
) |
Play a voicemail msg back on a channel.
chan | |
mailbox | msg is in. |
context | of mailbox. |
folder | voicemail folder to look in. |
msg_num | message number in the voicemailbox to playback to the channel. |
cb |
0 | success |
-1 | failure |
Definition at line 799 of file main/app.c.
References VM_API_CALL.
int ast_vm_msg_remove | ( | const char * | mailbox, |
const char * | context, | ||
size_t | num_msgs, | ||
const char * | folder, | ||
const char * | msgs[] | ||
) |
Remove/delete messages from a mailbox folder.
mailbox | The mailbox from which to delete messages |
context | The voicemail context for the mailbox |
num_msgs | The number of messages to delete |
folder | The folder from which to remove messages |
msgs | The message IDs of the messages to delete |
-1 | Failure |
0 | Success |
Definition at line 770 of file main/app.c.
References VM_API_CALL.
int ast_vm_test_create_user | ( | const char * | context, |
const char * | mailbox | ||
) |
Definition at line 813 of file main/app.c.
References ast_vm_test_create_user_func.
Referenced by test_vm_api_test_setup().
int ast_vm_test_destroy_user | ( | const char * | context, |
const char * | mailbox | ||
) |
Definition at line 821 of file main/app.c.
References ast_vm_test_destroy_user_func.
Referenced by test_vm_api_test_teardown().
void ast_vm_test_swap_table_in | ( | const struct ast_vm_functions * | vm_table | ) |
Swap out existing voicemail functions with a temporary set of functions for use with unit tests.
vm_table | function table to use for testing |
Definition at line 489 of file main/app.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_global_obj_ref, ao2_global_obj_replace_unref, ast_log, LOG_ERROR, NULL, provider_is_swapped, RAII_VAR, and vm_table.
void ast_vm_test_swap_table_out | ( | void | ) |
Used after ast_vm_test_swap_table_in to restore the original set of voicemail functions.
Definition at line 515 of file main/app.c.
References ao2_cleanup, ao2_global_obj_ref, ao2_global_obj_release, ao2_global_obj_replace_unref, AO2_GLOBAL_OBJ_STATIC(), ast_log, LOG_ERROR, NULL, provider_is_swapped, and RAII_VAR.
void ast_vm_unregister | ( | const char * | module_name | ) |
Unregister the specified voicemail provider.
The | module name of the provider to unregister |
Definition at line 473 of file main/app.c.
References ao2_cleanup, ao2_global_obj_ref, ao2_global_obj_release, AO2_GLOBAL_OBJ_STATIC(), ast_vm_functions::module_name, and table.
Referenced by unload_module().
|
static |
Definition at line 1131 of file main/app.c.
References ast_alloca, ast_channel_language(), ast_channel_name(), ast_channel_start_silence_generator(), ast_channel_stop_silence_generator(), ast_channel_stream(), AST_CONTROL_STREAM_RESTART, AST_CONTROL_STREAM_STOP, AST_CONTROL_STREAM_SUSPEND, ast_debug, ast_opt_transmit_silence, ast_seekstream(), ast_stopstream(), ast_streamfile(), ast_tellstream(), ast_test_suite_event_notify, ast_verb, ast_waitfordigit(), ast_waitstream_fr(), ast_waitstream_fr_w_cb(), end, and NULL.
Referenced by ast_control_streamfile(), ast_control_streamfile_lang(), and ast_control_streamfile_w_cb().
|
static |
Definition at line 1340 of file main/app.c.
References AST_CONTROL_BUSY, AST_CONTROL_CONGESTION, AST_CONTROL_HANGUP, AST_CONTROL_STREAM_FORWARD, AST_CONTROL_STREAM_RESTART, AST_CONTROL_STREAM_REVERSE, AST_CONTROL_STREAM_STOP, AST_CONTROL_STREAM_SUSPEND, ast_log, ast_playtones_start(), ast_playtones_stop(), CONTROL_TONE_RESPONSE_FAILED, CONTROL_TONE_RESPONSE_FINISHED, CONTROL_TONE_RESPONSE_NORMAL, ast_tone_zone_sound::data, ast_frame_subclass::integer, LOG_NOTICE, and ast_frame::subclass.
Referenced by ast_control_tone().
|
static |
Definition at line 899 of file main/app.c.
References ast_channel_start_silence_generator(), ast_channel_stop_silence_generator(), AST_CONTROL_FLASH, ast_indicate(), ast_log, ast_opt_transmit_silence, ast_safe_sleep(), ast_senddigit(), ast_senddigit_external(), digit, external_sleep(), LOG_WARNING, and NULL.
Referenced by ast_dtmf_stream(), and ast_dtmf_stream_external().
|
static |
Definition at line 830 of file main/app.c.
Referenced by dtmf_stream(), and mf_stream().
|
static |
Definition at line 2590 of file main/app.c.
References ast_ivr_option::action, ast_ivr_option::adata, AST_ACTION_BACKGROUND, AST_ACTION_BACKLIST, AST_ACTION_CALLBACK, AST_ACTION_EXIT, AST_ACTION_MENU, AST_ACTION_NOOP, AST_ACTION_PLAYBACK, AST_ACTION_PLAYLIST, AST_ACTION_REPEAT, AST_ACTION_RESTART, AST_ACTION_TRANSFER, AST_ACTION_UPONE, AST_ACTION_WAITOPTION, ast_channel_pbx(), AST_DIGIT_ANY, ast_ivr_menu_run_internal(), ast_log, ast_parseable_goto(), ast_stopstream(), ast_strdupa, ast_stream_and_wait(), ast_waitfordigit(), c, LOG_NOTICE, RES_EXIT, RES_REPEAT, RES_RESTART, RES_UPONE, and strsep().
Referenced by ast_ivr_menu_run_internal().
|
static |
Definition at line 1055 of file main/app.c.
References linear_state::allowoverride, ao2_bump, ao2_cleanup, ast_channel_flags(), ast_channel_name(), ast_channel_writeformat(), ast_clear_flag, AST_FLAG_WRITE_INT, ast_format_slin, ast_free, ast_log, ast_set_flag, ast_set_write_format(), LOG_WARNING, NULL, and linear_state::origwfmt.
|
static |
Definition at line 1025 of file main/app.c.
References ast_format_slin, AST_FRAME_VOICE, AST_FRIENDLY_OFFSET, ast_log, ast_write(), buf, ast_frame::datalen, linear_state::fd, ast_frame_subclass::format, ast_frame::frametype, LOG_WARNING, ast_frame::samples, and ast_frame::subclass.
|
static |
Definition at line 1008 of file main/app.c.
References ao2_cleanup, ast_channel_name(), ast_format_get_name(), ast_free, ast_log, ast_set_write_format(), linear_state::autoclose, linear_state::fd, LOG_WARNING, and linear_state::origwfmt.
Construct a silence frame of the same duration as orig.
The orig frame must be AST_FORMAT_SLINEAR.
orig | Frame as basis for silence to generate. |
NULL
on error. Definition at line 1494 of file main/app.c.
References ao2_bump, ast_calloc, ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_slin, AST_FRAME_VOICE, AST_LIST_NEXT, ast_log, AST_MALLOCD_HDR, ast_verb, ast_frame::data, ast_frame::datalen, ast_frame_subclass::format, ast_frame::frametype, LOG_WARNING, ast_frame::mallocd, NULL, ast_frame::ptr, ast_frame::samples, and ast_frame::subclass.
Referenced by __ast_play_and_record().
|
static |
Definition at line 836 of file main/app.c.
References ast_channel_start_silence_generator(), ast_channel_stop_silence_generator(), AST_CONTROL_FLASH, AST_CONTROL_WINK, ast_indicate(), ast_log, ast_opt_transmit_silence, ast_playtones_start(), ast_safe_sleep(), ast_senddigit_mf(), ast_senddigit_mf_end(), external_sleep(), LOG_WARNING, and NULL.
Referenced by ast_mf_stream().
|
static |
Definition at line 2659 of file main/app.c.
References ast_ivr_option::option, ast_ivr_menu::options, and ast_channel::x.
Referenced by ast_ivr_menu_run_internal().
|
static |
Definition at line 2670 of file main/app.c.
References ast_ivr_option::option, ast_ivr_menu::options, and ast_channel::x.
Referenced by read_newoption().
|
static |
Definition at line 2826 of file main/app.c.
References ast_app_option::arg_index, ast_clear_flag, ast_copy_string(), AST_FLAGS_ALL, ast_log, ast_set_flag, ast_set_flag64, ast_flags::flags, ast_flags64::flags, LOG_WARNING, paren, and quote().
Referenced by ast_app_parse_options(), and ast_app_parse_options64().
|
static |
Definition at line 1378 of file main/app.c.
References ast_log, ast_strlen_zero, LOG_ERROR, and strsep().
Referenced by ast_control_tone().
|
static |
Definition at line 2326 of file main/app.c.
References ast_free, path_lock::fd, and path_lock::path.
Referenced by ast_lock_path_flock(), and ast_unlock_path_flock().
|
static |
Definition at line 2682 of file main/app.c.
References ast_channel_pbx(), ast_waitfordigit(), ast_pbx::dtimeoutms, and option_matchmore().
Referenced by ast_ivr_menu_run_internal().
|
static |
Sets a channel's read format to AST_FORMAT_SLINEAR, recording its original format.
chan | Channel to modify. | |
[out] | orig_format | Output variable to store channel's original read format. |
Definition at line 1546 of file main/app.c.
References ao2_bump, ast_channel_readformat(), ast_format_slin, and ast_set_read_format().
Referenced by __ast_play_and_record().
|
static |
Definition at line 94 of file main/app.c.
References ast_free, AST_LIST_EMPTY, AST_LIST_FIRST, AST_LIST_LOCK, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, ast_poll, zombie::list, NULL, zombie::pid, and status.
Referenced by ast_safe_fork().
|
static |
Definition at line 634 of file main/app.c.
References ast_verb, and vm_greeter_warnings.
|
static |
Definition at line 613 of file main/app.c.
References ast_verb, and vm_warnings.
|
static |
Definition at line 344 of file main/app.c.
Referenced by ast_app_exec_sub(), and ast_app_expand_sub_args().
|
static |
Definition at line 248 of file main/app.c.
|
static |
Definition at line 596 of file main/app.c.
Referenced by ast_install_vm_test_functions(), ast_uninstall_vm_test_functions(), and ast_vm_test_create_user().
|
static |
Definition at line 597 of file main/app.c.
Referenced by ast_install_vm_test_functions(), ast_uninstall_vm_test_functions(), and ast_vm_test_destroy_user().
|
static |
Definition at line 85 of file main/app.c.
Referenced by app_cleanup(), app_init(), and ast_safe_fork().
|
static |
Definition at line 1989 of file main/app.c.
Referenced by ast_play_and_prepend(), and ast_play_and_record().
|
static |
Definition at line 1990 of file main/app.c.
Referenced by ast_play_and_prepend(), ast_play_and_record(), and ast_play_and_record_full().
|
static |
Definition at line 1556 of file main/app.c.
Referenced by __ast_play_and_record().
|
static |
Definition at line 1555 of file main/app.c.
Referenced by __ast_play_and_record().
|
static |
Referenced by ast_ref_namedgroups().
|
static |
Definition at line 1082 of file main/app.c.
|
static |
|
static |
Definition at line 487 of file main/app.c.
Referenced by ast_vm_test_swap_table_in(), and ast_vm_test_swap_table_out().
|
static |
Definition at line 90 of file main/app.c.
Referenced by ast_queue_topic_all().
|
static |
Definition at line 91 of file main/app.c.
|
static |
Definition at line 75 of file main/app.c.
Referenced by ast_safe_fork().
|
static |
Voicemail greeter not registered warning
Definition at line 539 of file main/app.c.
Referenced by vm_greeter_warn_no_provider().
|
static |
Voicemail not registered warning
Definition at line 428 of file main/app.c.
Referenced by vm_warn_no_provider().