Program Asterisk ADSI Scripts into phone. More...
#include "asterisk.h"
#include <netinet/in.h>
#include <ctype.h>
#include "asterisk/paths.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/adsi.h"
#include "asterisk/utils.h"
#include "asterisk/lock.h"
Go to the source code of this file.
Data Structures | |
struct | adsi_display |
struct | adsi_event |
struct | adsi_flag |
struct | adsi_key_cmd |
struct | adsi_script |
struct | adsi_soft_key |
struct | adsi_state |
struct | adsi_subscript |
Macros | |
#define | ARG_NUMBER (1 << 1) |
#define | ARG_STRING (1 << 0) |
#define | MAX_MAIN_LEN 1600 |
#define | MAX_RET_CODE 20 |
#define | MAX_SUB_LEN 255 |
#define | STATE_INIF 3 |
#define | STATE_INKEY 1 |
#define | STATE_INSUB 2 |
#define | STATE_NORMAL 0 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | adsi_exec (struct ast_channel *chan, const char *data) |
static int | adsi_process (struct adsi_script *state, char *buf, const char *script, int lineno) |
static int | adsi_prog (struct ast_channel *chan, const char *script) |
static int | clearcbone (char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno) |
static int | cleardisplay (char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno) |
static int | clearflag (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | cleartimer (char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno) |
static struct adsi_script * | compile_script (const char *script) |
static int | digitcollect (char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno) |
static int | digitdirect (char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno) |
static char * | get_token (char **buf, const char *script, int lineno) |
static struct adsi_display * | getdisplaybyname (struct adsi_script *state, char *name, const char *script, int lineno, int create) |
static int | geteventbyname (char *name) |
static struct adsi_flag * | getflagbyname (struct adsi_script *state, char *name, const char *script, int lineno, int create) |
static int | getjustifybyname (char *name) |
static struct adsi_soft_key * | getkeybyname (struct adsi_script *state, char *name, const char *script, int lineno) |
static struct adsi_state * | getstatebyname (struct adsi_script *state, char *name, const char *script, int lineno, int create) |
static struct adsi_subscript * | getsubbyname (struct adsi_script *state, char *name, const char *script, int lineno) |
static int | goto_line (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | goto_line_rel (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | load_module (void) |
static int | onevent (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | process_opcode (struct adsi_subscript *sub, char *code, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | process_returncode (struct adsi_soft_key *key, char *code, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | process_token (void *out, char *src, int maxlen, int argtype) |
static int | send_delay (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | send_dtmf (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | set_state (char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno) |
static int | setflag (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | showdisplay (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | showkeys (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | starttimer (char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno) |
static int | subscript (char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Asterisk ADSI Programming Application" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .nonoptreq = "res_adsi", } |
static const char | app [] = "ADSIProg" |
static struct ast_module_info * | ast_module_info = &__mod_info |
static struct adsi_event | events [] |
static struct adsi_event | justify [] |
static struct adsi_key_cmd | kcmds [] |
static struct adsi_key_cmd | opcmds [] |
static char * | validdtmf = "123456789*0#ABCD" |
Program Asterisk ADSI Scripts into phone.
Definition in file app_adsiprog.c.
#define ARG_NUMBER (1 << 1) |
Definition at line 122 of file app_adsiprog.c.
Referenced by adsi_process(), goto_line(), goto_line_rel(), process_token(), send_delay(), set_state(), showdisplay(), and starttimer().
#define ARG_STRING (1 << 0) |
Definition at line 121 of file app_adsiprog.c.
Referenced by adsi_process(), clearflag(), onevent(), process_token(), send_dtmf(), setflag(), showdisplay(), showkeys(), and subscript().
#define MAX_MAIN_LEN 1600 |
Definition at line 119 of file app_adsiprog.c.
Referenced by process_opcode().
#define MAX_RET_CODE 20 |
Definition at line 117 of file app_adsiprog.c.
Referenced by process_returncode().
#define MAX_SUB_LEN 255 |
Definition at line 118 of file app_adsiprog.c.
Referenced by process_opcode().
#define STATE_INIF 3 |
Definition at line 115 of file app_adsiprog.c.
Referenced by adsi_process().
#define STATE_INKEY 1 |
Definition at line 113 of file app_adsiprog.c.
Referenced by adsi_process(), and compile_script().
#define STATE_INSUB 2 |
Definition at line 114 of file app_adsiprog.c.
Referenced by adsi_process(), and compile_script().
#define STATE_NORMAL 0 |
Definition at line 112 of file app_adsiprog.c.
Referenced by adsi_process(), and compile_script().
|
static |
Definition at line 1599 of file app_adsiprog.c.
|
static |
Definition at line 1599 of file app_adsiprog.c.
|
static |
Definition at line 1566 of file app_adsiprog.c.
References adsi_prog(), ast_adsi_available(), ast_strlen_zero(), and ast_verb.
Referenced by load_module().
|
static |
Definition at line 1014 of file app_adsiprog.c.
References ARG_NUMBER, ARG_STRING, args, ast_copy_string(), ast_log(), adsi_subscript::data, adsi_display::data, adsi_subscript::datalen, adsi_display::datalen, adsi_soft_key::defined, adsi_subscript::defined, adsi_script::desc, adsi_script::fdn, get_token(), getdisplaybyname(), geteventbyname(), getflagbyname(), getjustifybyname(), getkeybyname(), getstatebyname(), getsubbyname(), adsi_soft_key::id, adsi_subscript::id, adsi_display::id, adsi_subscript::ifdata, adsi_subscript::ifinscount, adsi_soft_key::initlen, adsi_subscript::inscount, adsi_script::key, LOG_WARNING, process_opcode(), process_returncode(), process_token(), adsi_soft_key::retstr, adsi_soft_key::retstrlen, adsi_script::sec, adsi_script::state, STATE_INIF, STATE_INKEY, STATE_INSUB, STATE_NORMAL, adsi_script::sub, and adsi_script::ver.
Referenced by compile_script().
|
static |
Definition at line 1455 of file app_adsiprog.c.
References ADSI_INFO_PAGE, ADSI_JUST_LEFT, ADSI_MSG_DISPLAY, ADSI_MSG_DOWNLOAD, ast_adsi_begin_download(), ast_adsi_display(), ast_adsi_end_download(), ast_adsi_load_session(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_unload_session(), ast_free, ast_log(), ast_verb, compile_script(), adsi_subscript::data, adsi_display::data, adsi_subscript::datalen, adsi_display::datalen, adsi_script::desc, adsi_script::displays, adsi_script::fdn, adsi_script::keys, LOG_NOTICE, LOG_WARNING, ast_channel::name, adsi_script::numdisplays, adsi_script::numkeys, adsi_script::numsubs, adsi_soft_key::retstr, adsi_soft_key::retstrlen, adsi_script::sec, adsi_script::subs, adsi_script::ver, adsi_soft_key::vname, adsi_subscript::vname, and adsi_display::vname.
Referenced by adsi_exec().
|
static |
Definition at line 767 of file app_adsiprog.c.
References ast_log(), get_token(), id, and LOG_WARNING.
|
static |
Definition at line 743 of file app_adsiprog.c.
References ast_log(), get_token(), id, and LOG_WARNING.
|
static |
Definition at line 480 of file app_adsiprog.c.
References ARG_STRING, ast_log(), get_token(), getflagbyname(), adsi_flag::id, id, LOG_WARNING, and process_token().
|
static |
Definition at line 410 of file app_adsiprog.c.
References ast_log(), get_token(), id, and LOG_WARNING.
|
static |
Definition at line 1362 of file app_adsiprog.c.
References adsi_process(), ast_calloc, ast_config_AST_CONFIG_DIR, ast_copy_string(), ast_free, ast_log(), ast_strlen_zero(), adsi_subscript::data, adsi_soft_key::defined, adsi_subscript::defined, f, getsubbyname(), adsi_script::keys, LOG_WARNING, adsi_script::numkeys, adsi_script::numsubs, adsi_script::state, STATE_INKEY, STATE_INSUB, STATE_NORMAL, adsi_script::subs, adsi_soft_key::vname, and adsi_subscript::vname.
Referenced by adsi_prog().
|
static |
Definition at line 779 of file app_adsiprog.c.
References ast_log(), get_token(), id, and LOG_WARNING.
|
static |
Definition at line 755 of file app_adsiprog.c.
References ast_log(), get_token(), id, and LOG_WARNING.
|
static |
Definition at line 236 of file app_adsiprog.c.
References ast_log(), and LOG_WARNING.
Referenced by adsi_process(), clearcbone(), cleardisplay(), clearflag(), cleartimer(), digitcollect(), digitdirect(), goto_line(), goto_line_rel(), onevent(), process_opcode(), process_returncode(), send_delay(), send_dtmf(), set_state(), setflag(), showdisplay(), showkeys(), starttimer(), and subscript().
|
static |
Definition at line 620 of file app_adsiprog.c.
References ast_copy_string(), ast_log(), adsi_script::displays, adsi_display::id, LOG_WARNING, adsi_script::numdisplays, and adsi_display::vname.
Referenced by adsi_process(), and showdisplay().
|
static |
Definition at line 529 of file app_adsiprog.c.
References ARRAY_LEN.
Referenced by adsi_process(), and onevent().
|
static |
Definition at line 428 of file app_adsiprog.c.
References ast_copy_string(), ast_log(), adsi_script::flags, adsi_flag::id, LOG_WARNING, adsi_script::numflags, and adsi_flag::vname.
Referenced by adsi_process(), clearflag(), setflag(), and showkeys().
|
static |
|
static |
Definition at line 553 of file app_adsiprog.c.
References ast_copy_string(), ast_log(), adsi_soft_key::id, adsi_script::keys, LOG_WARNING, adsi_script::numkeys, and adsi_soft_key::vname.
Referenced by adsi_process(), and showkeys().
|
static |
Definition at line 595 of file app_adsiprog.c.
References ast_copy_string(), ast_log(), adsi_state::id, LOG_WARNING, adsi_script::numstates, adsi_script::states, and adsi_state::vname.
Referenced by adsi_process(), and onevent().
|
static |
Definition at line 574 of file app_adsiprog.c.
References ast_copy_string(), ast_log(), adsi_subscript::id, LOG_WARNING, adsi_script::numsubs, adsi_script::subs, and adsi_subscript::vname.
Referenced by adsi_process(), compile_script(), onevent(), and subscript().
|
static |
Definition at line 298 of file app_adsiprog.c.
References ARG_NUMBER, ast_log(), get_token(), LOG_WARNING, and process_token().
|
static |
Definition at line 331 of file app_adsiprog.c.
References ARG_NUMBER, ast_log(), get_token(), LOG_WARNING, and process_token().
|
static |
Definition at line 1588 of file app_adsiprog.c.
References adsi_exec(), AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_SUCCESS, and ast_register_application_xml.
|
static |
Definition at line 816 of file app_adsiprog.c.
References ARG_STRING, ast_log(), get_token(), geteventbyname(), getstatebyname(), getsubbyname(), adsi_subscript::id, LOG_WARNING, and process_token().
|
static |
Definition at line 977 of file app_adsiprog.c.
References adsi_key_cmd::add_args, ARRAY_LEN, ast_log(), adsi_subscript::data, adsi_subscript::datalen, get_token(), adsi_subscript::id, adsi_key_cmd::id, adsi_subscript::inscount, LOG_WARNING, MAX_MAIN_LEN, MAX_SUB_LEN, name, and adsi_subscript::vname.
Referenced by adsi_process().
|
static |
Definition at line 948 of file app_adsiprog.c.
References adsi_key_cmd::add_args, ARRAY_LEN, ast_log(), get_token(), adsi_key_cmd::id, adsi_soft_key::initlen, LOG_WARNING, MAX_RET_CODE, name, adsi_soft_key::retstr, adsi_soft_key::retstrlen, and adsi_soft_key::vname.
Referenced by adsi_process().
|
static |
Definition at line 189 of file app_adsiprog.c.
References ARG_NUMBER, ARG_STRING, and ast_strlen_zero().
Referenced by adsi_process(), clearflag(), goto_line(), goto_line_rel(), onevent(), send_delay(), send_dtmf(), set_state(), setflag(), showdisplay(), showkeys(), starttimer(), and subscript().
|
static |
Definition at line 364 of file app_adsiprog.c.
References ARG_NUMBER, ast_log(), get_token(), LOG_WARNING, and process_token().
|
static |
Definition at line 268 of file app_adsiprog.c.
References ARG_STRING, ast_log(), dtmfstr, get_token(), LOG_WARNING, and process_token().
|
static |
Definition at line 389 of file app_adsiprog.c.
References ARG_NUMBER, ast_log(), get_token(), id, LOG_WARNING, process_token(), and state.
|
static |
Definition at line 453 of file app_adsiprog.c.
References ARG_STRING, ast_log(), get_token(), getflagbyname(), adsi_flag::id, id, LOG_WARNING, and process_token().
|
static |
Definition at line 692 of file app_adsiprog.c.
References ARG_NUMBER, ARG_STRING, ast_log(), get_token(), getdisplaybyname(), adsi_display::id, id, LOG_WARNING, and process_token().
|
static |
Definition at line 645 of file app_adsiprog.c.
References ARG_STRING, ast_log(), get_token(), getflagbyname(), getkeybyname(), adsi_soft_key::id, adsi_flag::id, id, LOG_WARNING, and process_token().
|
static |
Definition at line 507 of file app_adsiprog.c.
References ARG_NUMBER, ast_log(), get_token(), id, LOG_WARNING, and process_token().
|
static |
Definition at line 791 of file app_adsiprog.c.
References ARG_STRING, ast_log(), get_token(), getsubbyname(), adsi_subscript::id, LOG_WARNING, and process_token().
|
static |
Definition at line 1583 of file app_adsiprog.c.
References ast_unregister_application().
|
static |
Definition at line 1599 of file app_adsiprog.c.
|
static |
Definition at line 49 of file app_adsiprog.c.
Referenced by action_originate(), answer_exec_enable(), apply_outgoing(), ast_cel_report_event(), ast_pbx_run_app(), async_wait(), check_pval_item(), exec_exec(), execif_exec(), feature_exec_app(), handle_cli_dialplan_add_extension(), handle_cli_status(), handle_show_application(), lua_pbx_exec(), page_exec(), parse_apps(), pbx_builtin_execiftime(), pbx_extension_helper(), process_applicationmap_line(), realtime_exec(), and tryexec_exec().
|
static |
Definition at line 1599 of file app_adsiprog.c.
|
static |
Definition at line 78 of file app_adsiprog.c.
Referenced by add_new_event_cb(), ast_io_add(), ast_io_change(), calendar_query_exec(), calendar_query_result_exec(), eventlist_destroy(), eventlist_destructor(), eventlist_duplicate(), parse_events(), and parse_tag().
|
static |
Definition at line 105 of file app_adsiprog.c.
Referenced by adsi_announce_park(), and cpeid_setstatus().
|
static |
Definition at line 886 of file app_adsiprog.c.
|
static |
Definition at line 928 of file app_adsiprog.c.
|
static |
Definition at line 266 of file app_adsiprog.c.