Asterisk - The Open Source Telephony Project
18.5.0
|
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) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
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) |
Load the module. More... | |
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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_DEPRECATED, .load = load_module, .unload = unload_module, .requires = "res_adsi", } |
static const char | app [] = "ADSIProg" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const struct adsi_event | events [] |
static const struct adsi_event | justify [] |
static const struct adsi_key_cmd | kcmds [] |
static const 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 129 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 128 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 126 of file app_adsiprog.c.
Referenced by process_opcode().
#define MAX_RET_CODE 20 |
Definition at line 124 of file app_adsiprog.c.
Referenced by process_returncode().
#define MAX_SUB_LEN 255 |
Definition at line 125 of file app_adsiprog.c.
Referenced by process_opcode().
#define STATE_INIF 3 |
Definition at line 122 of file app_adsiprog.c.
Referenced by adsi_process().
#define STATE_INKEY 1 |
Definition at line 120 of file app_adsiprog.c.
Referenced by adsi_process(), and compile_script().
#define STATE_INSUB 2 |
Definition at line 121 of file app_adsiprog.c.
Referenced by adsi_process(), and compile_script().
#define STATE_NORMAL 0 |
Definition at line 119 of file app_adsiprog.c.
Referenced by adsi_process(), and compile_script().
|
static |
Definition at line 1617 of file app_adsiprog.c.
|
static |
Definition at line 1617 of file app_adsiprog.c.
|
static |
Definition at line 1573 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 1021 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, NULL, 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, tmp(), and adsi_script::ver.
Referenced by compile_script().
|
static |
Definition at line 1462 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_channel_name(), ast_free, ast_log, ast_verb, buf, 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, NULL, 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().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1617 of file app_adsiprog.c.
|
static |
Definition at line 774 of file app_adsiprog.c.
References ast_log, get_token(), adsi_event::id, and LOG_WARNING.
|
static |
Definition at line 750 of file app_adsiprog.c.
References ast_log, get_token(), adsi_event::id, and LOG_WARNING.
|
static |
Definition at line 487 of file app_adsiprog.c.
References ARG_STRING, ast_log, get_token(), getflagbyname(), adsi_event::id, adsi_flag::id, LOG_WARNING, and process_token().
|
static |
Definition at line 417 of file app_adsiprog.c.
References ast_log, get_token(), adsi_event::id, and LOG_WARNING.
|
static |
Definition at line 1369 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, buf, c, adsi_subscript::data, adsi_soft_key::defined, adsi_subscript::defined, getsubbyname(), adsi_script::keys, LOG_WARNING, NULL, adsi_script::numkeys, adsi_script::numsubs, adsi_script::state, STATE_INKEY, STATE_INSUB, STATE_NORMAL, adsi_script::subs, type, adsi_soft_key::vname, and adsi_subscript::vname.
Referenced by adsi_prog().
|
static |
Definition at line 786 of file app_adsiprog.c.
References ast_log, get_token(), adsi_event::id, and LOG_WARNING.
|
static |
Definition at line 762 of file app_adsiprog.c.
References ast_log, get_token(), adsi_event::id, and LOG_WARNING.
|
static |
Definition at line 243 of file app_adsiprog.c.
References ast_log, buf, LOG_WARNING, NULL, and tmp().
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 627 of file app_adsiprog.c.
References ast_copy_string(), ast_log, adsi_script::displays, adsi_display::id, LOG_WARNING, NULL, adsi_script::numdisplays, and adsi_display::vname.
Referenced by adsi_process(), and showdisplay().
|
static |
Definition at line 536 of file app_adsiprog.c.
References ARRAY_LEN.
Referenced by adsi_process(), and onevent().
|
static |
Definition at line 435 of file app_adsiprog.c.
References ast_copy_string(), ast_log, adsi_script::flags, adsi_flag::id, LOG_WARNING, NULL, adsi_script::numflags, and adsi_flag::vname.
Referenced by adsi_process(), clearflag(), setflag(), and showkeys().
|
static |
|
static |
Definition at line 560 of file app_adsiprog.c.
References ast_copy_string(), ast_log, adsi_soft_key::id, adsi_script::keys, LOG_WARNING, NULL, adsi_script::numkeys, and adsi_soft_key::vname.
Referenced by adsi_process(), and showkeys().
|
static |
Definition at line 602 of file app_adsiprog.c.
References ast_copy_string(), ast_log, adsi_state::id, LOG_WARNING, NULL, adsi_script::numstates, adsi_script::states, and adsi_state::vname.
Referenced by adsi_process(), and onevent().
|
static |
Definition at line 581 of file app_adsiprog.c.
References ast_copy_string(), ast_log, adsi_subscript::id, LOG_WARNING, NULL, adsi_script::numsubs, S_OR, adsi_script::subs, and adsi_subscript::vname.
Referenced by adsi_process(), compile_script(), onevent(), and subscript().
|
static |
Definition at line 305 of file app_adsiprog.c.
References ARG_NUMBER, ast_log, get_token(), LOG_WARNING, and process_token().
|
static |
Definition at line 338 of file app_adsiprog.c.
References ARG_NUMBER, ast_log, get_token(), LOG_WARNING, and process_token().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 1605 of file app_adsiprog.c.
References adsi_exec(), app, AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_DEPRECATED, ast_register_application_xml, ASTERISK_GPL_KEY, and unload_module().
|
static |
Definition at line 823 of file app_adsiprog.c.
References ARG_STRING, ast_log, get_token(), geteventbyname(), getstatebyname(), getsubbyname(), adsi_subscript::id, LOG_WARNING, NULL, process_token(), and sub.
|
static |
Definition at line 984 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, MAX_MAIN_LEN, MAX_SUB_LEN, adsi_event::name, and adsi_subscript::vname.
Referenced by adsi_process().
|
static |
Definition at line 955 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, adsi_event::name, adsi_soft_key::retstr, adsi_soft_key::retstrlen, and adsi_soft_key::vname.
Referenced by adsi_process().
|
static |
Definition at line 196 of file app_adsiprog.c.
References ARG_NUMBER, ARG_STRING, ast_strlen_zero, and out.
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 371 of file app_adsiprog.c.
References ARG_NUMBER, ast_log, get_token(), LOG_WARNING, and process_token().
|
static |
Definition at line 275 of file app_adsiprog.c.
References a, ARG_STRING, ast_log, dtmfstr, get_token(), LOG_WARNING, process_token(), and validdtmf.
|
static |
Definition at line 396 of file app_adsiprog.c.
References ARG_NUMBER, ast_log, get_token(), adsi_event::id, LOG_WARNING, process_token(), and state.
|
static |
Definition at line 460 of file app_adsiprog.c.
References ARG_STRING, ast_log, get_token(), getflagbyname(), adsi_event::id, adsi_flag::id, LOG_WARNING, and process_token().
|
static |
Definition at line 699 of file app_adsiprog.c.
References ARG_NUMBER, ARG_STRING, ast_log, get_token(), getdisplaybyname(), adsi_event::id, adsi_display::id, LOG_WARNING, and process_token().
|
static |
Definition at line 652 of file app_adsiprog.c.
References ARG_STRING, ast_log, get_token(), getflagbyname(), getkeybyname(), adsi_event::id, adsi_soft_key::id, adsi_flag::id, LOG_WARNING, and process_token().
|
static |
Definition at line 514 of file app_adsiprog.c.
References ARG_NUMBER, ast_log, get_token(), adsi_event::id, LOG_WARNING, and process_token().
|
static |
Definition at line 798 of file app_adsiprog.c.
References ARG_STRING, ast_log, get_token(), getsubbyname(), adsi_subscript::id, LOG_WARNING, process_token(), and sub.
|
static |
Definition at line 1590 of file app_adsiprog.c.
References app, and ast_unregister_application().
Referenced by load_module().
|
static |
Definition at line 1617 of file app_adsiprog.c.
|
static |
Definition at line 56 of file app_adsiprog.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1617 of file app_adsiprog.c.
|
static |
Definition at line 85 of file app_adsiprog.c.
Referenced by add_new_event_cb(), ast_custom_function_find(), ast_io_add(), ast_io_change(), calendar_query_exec(), calendar_query_result_exec(), eventlist_destroy(), eventlist_destructor(), eventlist_duplicate(), events_handler(), handle_manager_show_event(), and handle_manager_show_events().
|
static |
Definition at line 112 of file app_adsiprog.c.
Referenced by cpeid_setstatus().
|
static |
Definition at line 893 of file app_adsiprog.c.
|
static |
Definition at line 935 of file app_adsiprog.c.
|
static |
Definition at line 273 of file app_adsiprog.c.
Referenced by send_dtmf().