Asterisk - The Open Source Telephony Project
18.5.0
|
External IVR application interface. More...
#include "asterisk.h"
#include <signal.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/linkedlists.h"
#include "asterisk/app.h"
#include "asterisk/utils.h"
#include "asterisk/tcptls.h"
#include "asterisk/astobj2.h"
Go to the source code of this file.
Data Structures | |
struct | ivr_localuser::finishlist |
struct | gen_state |
struct | ivr_localuser |
struct | ivr_localuser::playlist |
struct | playlist_entry |
Macros | |
#define | ast_chan_log(level, channel, format, ...) ast_log(level, "%s: " format, ast_channel_name(channel) , ## __VA_ARGS__) |
#define | EIVR_CMD_ANS 'T' /* answer channel */ |
#define | EIVR_CMD_APND 'A' /* append to prompt queue */ |
#define | EIVR_CMD_DTMF 'D' /* send DTMF */ |
#define | EIVR_CMD_EXIT 'E' /* exit */ |
#define | EIVR_CMD_GET 'G' /* get channel varable(s) */ |
#define | EIVR_CMD_HGUP 'H' /* hangup */ |
#define | EIVR_CMD_IRPT 'I' /* interrupt */ |
#define | EIVR_CMD_LOG 'L' /* log message */ |
#define | EIVR_CMD_OPT 'O' /* option */ |
#define | EIVR_CMD_PARM 'P' /* return supplied params */ |
#define | EIVR_CMD_SQUE 'S' /* (re)set prompt queue */ |
#define | EIVR_CMD_SVAR 'V' /* set channel varable(s) */ |
#define | EIVR_CMD_XIT 'X' /* exit **depricated** */ |
#define | EXTERNALIVR_PORT 2949 |
Enumerations | |
enum | options_flags { noanswer = (1 << 0), ignore_hangup = (1 << 1), run_dead = (1 << 2) } |
Functions | |
static int | app_exec (struct ast_channel *chan, const char *data) |
static void | ast_eivr_getvariable (struct ast_channel *chan, char *data, char *outbuf, int outbuflen) |
static void | ast_eivr_senddtmf (struct ast_channel *chan, char *vdata) |
static void | ast_eivr_setvariable (struct ast_channel *chan, char *data) |
AST_MODULE_INFO_STANDARD_EXTENDED (ASTERISK_GPL_KEY, "External IVR Interface Application") | |
static int | eivr_comm (struct ast_channel *chan, struct ivr_localuser *u, struct ast_iostream *eivr_events, struct ast_iostream *eivr_commands, struct ast_iostream *eivr_errors, const struct ast_str *args, const struct ast_flags flags) |
static void * | gen_alloc (struct ast_channel *chan, void *params) |
static void | gen_closestream (struct gen_state *state) |
static int | gen_generate (struct ast_channel *chan, void *data, int len, int samples) |
static int | gen_nextfile (struct gen_state *state) |
static struct ast_frame * | gen_readframe (struct gen_state *state) |
static void | gen_release (struct ast_channel *chan, void *data) |
static int | load_module (void) |
static struct playlist_entry * | make_entry (const char *filename) |
static void | send_eivr_event (struct ast_iostream *stream, const char event, const char *data, const struct ast_channel *chan) |
static int | unload_module (void) |
Variables | |
static const char | app [] = "ExternalIVR" |
static const struct ast_app_option | app_opts [128] = { [ 'n' ] = { .flag = noanswer }, [ 'i' ] = { .flag = ignore_hangup }, [ 'd' ] = { .flag = run_dead }, } |
static struct ast_generator | gen |
External IVR application interface.
Definition in file app_externalivr.c.
#define ast_chan_log | ( | level, | |
channel, | |||
format, | |||
... | |||
) | ast_log(level, "%s: " format, ast_channel_name(channel) , ## __VA_ARGS__) |
Definition at line 98 of file app_externalivr.c.
Referenced by app_exec(), eivr_comm(), gen_generate(), and gen_nextfile().
Definition at line 111 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_APND 'A' /* append to prompt queue */ |
Definition at line 101 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_DTMF 'D' /* send DTMF */ |
Definition at line 102 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_EXIT 'E' /* exit */ |
Definition at line 103 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_GET 'G' /* get channel varable(s) */ |
Definition at line 104 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_HGUP 'H' /* hangup */ |
Definition at line 105 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_IRPT 'I' /* interrupt */ |
Definition at line 106 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_LOG 'L' /* log message */ |
Definition at line 107 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_OPT 'O' /* option */ |
Definition at line 108 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_PARM 'P' /* return supplied params */ |
Definition at line 109 of file app_externalivr.c.
Referenced by eivr_comm().
Definition at line 110 of file app_externalivr.c.
Referenced by eivr_comm().
Definition at line 112 of file app_externalivr.c.
Referenced by eivr_comm().
#define EIVR_CMD_XIT 'X' /* exit **depricated** */ |
Definition at line 113 of file app_externalivr.c.
Referenced by eivr_comm().
#define EXTERNALIVR_PORT 2949 |
Definition at line 115 of file app_externalivr.c.
Referenced by app_exec().
enum options_flags |
Enumerator | |
---|---|
noanswer | |
ignore_hangup | |
run_dead |
Definition at line 117 of file app_externalivr.c.
|
static |
Definition at line 392 of file app_externalivr.c.
References ivr_localuser::abort_current_sound, ast_tcptls_session_args::accept_fd, ao2_ref, app_opts, ast_activate_generator(), AST_AF_UNSPEC, ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_chan_log, ast_close_fds_above_n(), ast_deactivate_generator(), ast_debug, AST_DECLARE_APP_ARGS, ast_free, ast_iostream_close(), ast_iostream_from_fd(), AST_LIST_HEAD_INIT_VALUE, AST_LIST_REMOVE_HEAD, ast_log, ast_opt_high_priority, ast_safe_fork(), ast_set_priority(), ast_sockaddr_copy(), ast_sockaddr_port, ast_sockaddr_resolve(), ast_sockaddr_set_port, AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_str_alloca, ast_str_append(), ast_str_reset(), ast_strdupa, ast_strlen_zero, ast_tcptls_client_create(), ast_tcptls_client_start(), ast_test_flag, ast_verb, buf, ivr_localuser::chan, eivr_comm(), errno, EXTERNALIVR_PORT, ivr_localuser::gen_active, host, ignore_hangup, playlist_entry::list, LOG_ERROR, noanswer, NULL, options, ivr_localuser::playlist, ast_tcptls_session_args::remote_address, run_dead, and ast_tcptls_session_instance::stream.
Referenced by load_module().
|
static |
Definition at line 304 of file app_externalivr.c.
References ast_channel_lock, ast_channel_unlock, ast_copy_string(), ast_str_alloca, ast_str_append(), ast_str_buffer(), inbuf(), NULL, pbx_builtin_getvar_helper(), strsep(), and value.
Referenced by eivr_comm().
|
static |
Definition at line 356 of file app_externalivr.c.
References args, AST_APP_ARG, ast_app_parse_timelen(), AST_DECLARE_APP_ARGS, ast_dtmf_stream(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero, ast_verb, NULL, and TIMELEN_MILLISECONDS.
Referenced by eivr_comm().
|
static |
Definition at line 337 of file app_externalivr.c.
References ast_debug, ast_strdupa, inbuf(), pbx_builtin_setvar_helper(), strsep(), and value.
Referenced by eivr_comm().
AST_MODULE_INFO_STANDARD_EXTENDED | ( | ASTERISK_GPL_KEY | , |
"External IVR Interface Application" | |||
) |
Referenced by load_module().
|
static |
Definition at line 624 of file app_externalivr.c.
References ivr_localuser::abort_current_sound, ast_activate_generator(), ast_answer(), ast_chan_log, ast_channel_flags(), ast_channel_hangupcause_set(), ast_channel_language(), ast_check_hangup(), AST_CONTROL_HANGUP, ast_eivr_getvariable(), ast_eivr_senddtmf(), ast_eivr_setvariable(), ast_fileexists(), AST_FLAG_ZOMBIE, AST_FRAME_CONTROL, AST_FRAME_DTMF, ast_free, ast_frfree, ast_iostream_get_fd(), ast_iostream_gets(), AST_LIST_EMPTY, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_read(), AST_STATE_UP, ast_str_buffer(), ast_strip(), ast_test_flag, ast_verb, ast_waitfor_nandfds(), ivr_localuser::chan, ast_frame::data, EIVR_CMD_ANS, EIVR_CMD_APND, EIVR_CMD_DTMF, EIVR_CMD_EXIT, EIVR_CMD_GET, EIVR_CMD_HGUP, EIVR_CMD_IRPT, EIVR_CMD_LOG, EIVR_CMD_OPT, EIVR_CMD_PARM, EIVR_CMD_SQUE, EIVR_CMD_SVAR, EIVR_CMD_XIT, errno, playlist_entry::filename, ivr_localuser::finishlist, ast_frame::frametype, ivr_localuser::gen_active, ignore_hangup, input(), ast_frame_subclass::integer, playlist_entry::list, LOG_ERROR, LOG_NOTICE, LOG_WARNING, make_entry(), NULL, ivr_localuser::option_autoclear, ivr_localuser::playing_silence, ivr_localuser::playlist, run_dead, send_eivr_event(), ast_frame::subclass, tmp(), and ast_frame::uint32.
Referenced by app_exec().
|
static |
Definition at line 175 of file app_externalivr.c.
References ast_calloc, NULL, state, and gen_state::u.
|
static |
Definition at line 188 of file app_externalivr.c.
References ast_channel_stream_set(), ast_closestream(), ivr_localuser::chan, NULL, gen_state::stream, and gen_state::u.
Referenced by gen_nextfile(), gen_readframe(), and gen_release().
|
static |
Definition at line 273 of file app_externalivr.c.
References ast_chan_log, ast_frfree, ast_write(), errno, gen_readframe(), LOG_WARNING, NULL, gen_state::sample_queue, and ast_frame::samples.
|
static |
Definition at line 207 of file app_externalivr.c.
References ivr_localuser::abort_current_sound, ast_chan_log, ast_channel_language(), AST_LIST_FIRST, AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_openstream_full(), ivr_localuser::chan, gen_state::current, errno, playlist_entry::filename, gen_closestream(), playlist_entry::list, LOG_WARNING, ivr_localuser::playing_silence, ivr_localuser::playlist, gen_state::stream, and gen_state::u.
Referenced by gen_readframe().
Definition at line 241 of file app_externalivr.c.
References ivr_localuser::abort_current_sound, AST_LIST_FIRST, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_readframe(), gen_state::current, ivr_localuser::finishlist, gen_closestream(), gen_nextfile(), playlist_entry::list, NULL, ivr_localuser::playing_silence, ivr_localuser::playlist, gen_state::stream, and gen_state::u.
Referenced by gen_generate().
|
static |
Definition at line 198 of file app_externalivr.c.
References ast_free, and gen_closestream().
|
static |
Definition at line 902 of file app_externalivr.c.
References app, app_exec(), AST_MODULE_INFO_STANDARD_EXTENDED(), ast_register_application_xml, and ASTERISK_GPL_KEY.
|
static |
Definition at line 380 of file app_externalivr.c.
References ast_calloc, playlist_entry::filename, and NULL.
Referenced by eivr_comm().
|
static |
Definition at line 158 of file app_externalivr.c.
References ast_debug, ast_free, ast_iostream_write(), ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_truncate(), NULL, and tmp().
Referenced by eivr_comm().
|
static |
Definition at line 897 of file app_externalivr.c.
References app, and ast_unregister_application().
|
static |
Definition at line 95 of file app_externalivr.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 127 of file app_externalivr.c.
Referenced by app_exec().
|
static |
Definition at line 297 of file app_externalivr.c.
Referenced by find_body_generator_type_subtype(), find_body_generator_type_subtype_nolock(), reload_config(), and set_config().