Asterisk - The Open Source Telephony Project GIT-master-8f1982c
|
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 = AST_BUILDOPT_SUM, .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 132 of file app_adsiprog.c.
#define ARG_STRING (1 << 0) |
Definition at line 131 of file app_adsiprog.c.
#define MAX_MAIN_LEN 1600 |
Definition at line 129 of file app_adsiprog.c.
#define MAX_RET_CODE 20 |
Definition at line 127 of file app_adsiprog.c.
#define MAX_SUB_LEN 255 |
Definition at line 128 of file app_adsiprog.c.
#define STATE_INIF 3 |
Definition at line 125 of file app_adsiprog.c.
#define STATE_INKEY 1 |
Definition at line 123 of file app_adsiprog.c.
#define STATE_INSUB 2 |
Definition at line 124 of file app_adsiprog.c.
#define STATE_NORMAL 0 |
Definition at line 122 of file app_adsiprog.c.
|
static |
Definition at line 1620 of file app_adsiprog.c.
|
static |
Definition at line 1620 of file app_adsiprog.c.
|
static |
Definition at line 1576 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 1024 of file app_adsiprog.c.
References ARG_NUMBER, ARG_STRING, args, ast_copy_string(), ast_log, buf, adsi_display::data, adsi_display::datalen, get_token(), getdisplaybyname(), geteventbyname(), getflagbyname(), getjustifybyname(), getkeybyname(), getstatebyname(), getsubbyname(), adsi_subscript::id, adsi_display::id, LOG_WARNING, NULL, process_opcode(), process_returncode(), process_token(), STATE_INIF, STATE_INKEY, STATE_INSUB, STATE_NORMAL, and adsi_subscript::vname.
Referenced by compile_script().
|
static |
Definition at line 1465 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 1620 of file app_adsiprog.c.
|
static |
Definition at line 777 of file app_adsiprog.c.
References args, ast_log, buf, get_token(), id, and LOG_WARNING.
|
static |
Definition at line 753 of file app_adsiprog.c.
References args, ast_log, buf, get_token(), id, and LOG_WARNING.
|
static |
Definition at line 490 of file app_adsiprog.c.
References ARG_STRING, args, ast_log, buf, get_token(), getflagbyname(), id, LOG_WARNING, and process_token().
|
static |
Definition at line 420 of file app_adsiprog.c.
References args, ast_log, buf, get_token(), id, and LOG_WARNING.
|
static |
Definition at line 1372 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, adsi_soft_key::vname, and adsi_subscript::vname.
Referenced by adsi_prog().
|
static |
Definition at line 789 of file app_adsiprog.c.
References args, ast_log, buf, get_token(), id, and LOG_WARNING.
|
static |
Definition at line 765 of file app_adsiprog.c.
References args, ast_log, buf, get_token(), id, and LOG_WARNING.
|
static |
Definition at line 246 of file app_adsiprog.c.
References ast_log, buf, LOG_WARNING, and NULL.
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 630 of file app_adsiprog.c.
References ast_copy_string(), ast_log, LOG_WARNING, name, and NULL.
Referenced by adsi_process(), and showdisplay().
|
static |
Definition at line 539 of file app_adsiprog.c.
References ARRAY_LEN, events, and name.
Referenced by adsi_process(), and onevent().
|
static |
Definition at line 438 of file app_adsiprog.c.
References ast_copy_string(), ast_log, LOG_WARNING, name, and NULL.
Referenced by adsi_process(), clearflag(), setflag(), and showkeys().
|
static |
Definition at line 551 of file app_adsiprog.c.
References ARRAY_LEN, justify, and name.
Referenced by adsi_process().
|
static |
Definition at line 563 of file app_adsiprog.c.
References ast_copy_string(), ast_log, LOG_WARNING, name, and NULL.
Referenced by adsi_process(), and showkeys().
|
static |
Definition at line 605 of file app_adsiprog.c.
References ast_copy_string(), ast_log, LOG_WARNING, name, and NULL.
Referenced by adsi_process(), and onevent().
|
static |
Definition at line 584 of file app_adsiprog.c.
References ast_copy_string(), ast_log, LOG_WARNING, name, NULL, and S_OR.
Referenced by adsi_process(), compile_script(), onevent(), and subscript().
|
static |
Definition at line 308 of file app_adsiprog.c.
References ARG_NUMBER, args, ast_log, buf, get_token(), LOG_WARNING, and process_token().
|
static |
Definition at line 341 of file app_adsiprog.c.
References ARG_NUMBER, args, ast_log, buf, 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 1608 of file app_adsiprog.c.
References adsi_exec(), app, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, and ast_register_application_xml.
|
static |
Definition at line 826 of file app_adsiprog.c.
References ARG_STRING, args, ast_log, buf, get_token(), geteventbyname(), getstatebyname(), getsubbyname(), LOG_WARNING, NULL, process_token(), and sub.
|
static |
Definition at line 987 of file app_adsiprog.c.
References adsi_key_cmd::add_args, args, ARRAY_LEN, ast_log, get_token(), adsi_key_cmd::id, LOG_WARNING, max, MAX_MAIN_LEN, MAX_SUB_LEN, name, opcmds, and sub.
Referenced by adsi_process().
|
static |
Definition at line 958 of file app_adsiprog.c.
References adsi_key_cmd::add_args, args, ARRAY_LEN, ast_log, get_token(), adsi_key_cmd::id, adsi_soft_key::initlen, kcmds, 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 199 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 374 of file app_adsiprog.c.
References ARG_NUMBER, args, ast_log, buf, get_token(), LOG_WARNING, and process_token().
|
static |
Definition at line 278 of file app_adsiprog.c.
References a, ARG_STRING, args, ast_log, buf, get_token(), LOG_WARNING, process_token(), and validdtmf.
|
static |
Definition at line 399 of file app_adsiprog.c.
References ARG_NUMBER, args, ast_log, buf, get_token(), id, LOG_WARNING, process_token(), and state.
|
static |
Definition at line 463 of file app_adsiprog.c.
References ARG_STRING, args, ast_log, buf, get_token(), getflagbyname(), id, LOG_WARNING, and process_token().
|
static |
Definition at line 702 of file app_adsiprog.c.
References ARG_NUMBER, ARG_STRING, args, ast_log, buf, get_token(), getdisplaybyname(), adsi_display::id, id, LOG_WARNING, and process_token().
|
static |
Definition at line 655 of file app_adsiprog.c.
References ARG_STRING, args, ast_log, buf, get_token(), getflagbyname(), getkeybyname(), adsi_soft_key::id, id, LOG_WARNING, and process_token().
|
static |
Definition at line 517 of file app_adsiprog.c.
References ARG_NUMBER, args, ast_log, buf, get_token(), id, LOG_WARNING, and process_token().
|
static |
Definition at line 801 of file app_adsiprog.c.
References ARG_STRING, args, ast_log, buf, get_token(), getsubbyname(), LOG_WARNING, process_token(), and sub.
|
static |
Definition at line 1593 of file app_adsiprog.c.
References app, and ast_unregister_application().
|
static |
Definition at line 1620 of file app_adsiprog.c.
|
static |
Definition at line 56 of file app_adsiprog.c.
Referenced by __stasis_app_register(), action_originate(), add_extension(), add_extensions(), adsi_load_session(), answer_exec_enable(), answer_exec_run(), app_create(), app_deactivate(), app_dtor(), app_event_filter_set(), app_event_sources_to_json(), app_events_allowed_set(), app_events_disallowed_set(), app_handle_subscriptions(), app_hash(), app_is_active(), app_is_finished(), app_is_subscribed_bridge_id(), app_is_subscribed_channel_id(), app_is_subscribed_endpoint_id(), app_match(), app_name(), app_send(), app_send_end_msg(), app_shutdown(), app_subscribe(), app_subscribe_bridge(), app_subscribe_channel(), app_subscribe_endpoint(), app_to_json(), app_unsubscribe(), app_unsubscribe_bridge(), app_unsubscribe_bridge_id(), app_unsubscribe_channel(), app_unsubscribe_channel_id(), app_unsubscribe_endpoint_id(), app_update(), append_json(), append_name(), applicationmap_handler(), applicationmap_item_alloc(), ari_originate_dial(), ari_set_debug(), ari_show_app(), ari_show_apps(), ari_ws_session_create(), ari_ws_session_reset(), ast_adsi_load_session(), ast_app_get_topic(), ast_ari_applications_filter(), ast_ari_callback(), ast_attended_transfer_message_add_app(), ast_bridge_transfer_attended(), ast_compile_ael2(), ast_complete_applications(), ast_pbx_exec_application(), ast_pbx_outgoing_app(), ast_pbx_outgoing_app_predial(), ast_register_application2(), AST_TEST_DEFINE(), ast_unregister_application(), attended_transfer_bridge(), bridge_app_subscribed(), bridge_app_subscribed_involved(), bridge_attended_transfer_handler(), bridge_blind_transfer_handler(), bridge_merge_handler(), bridge_subscription_change_handler(), call_forwarded_handler(), cel_track_app(), check_app_args(), check_pval_item(), cleanup_cb(), complete_ari_app(), control_create(), control_set_app(), device_state_subscription_create(), devices_to_json(), endpoint_state_cb(), exec_exec(), execif_exec(), extension_presence_state_helper(), find_device_state(), find_device_state_subscription(), forwards_create(), forwards_create_bridge(), forwards_create_channel(), forwards_create_endpoint(), handle_cli_dialplan_add_extension(), handle_cli_status(), handle_exec(), handle_show_application(), is_originate_app_permitted(), is_subscribed_device_state(), is_subscribed_device_state_lock(), load_module(), load_moh_classes(), lua_pbx_exec(), message_received_handler(), orig_app(), page_exec(), parse_line(), pbx_exec(), pbx_extension_helper(), pbx_findapp(), pbx_outgoing_attempt(), pbx_outgoing_exec(), queue_match(), realtime_exec(), send_start_msg(), send_start_msg_snapshots(), stasis_app_control_snoop(), stasis_app_event_allowed(), stasis_app_event_filter_set(), stasis_app_event_filter_to_json(), stasis_app_exec(), stasis_app_get_debug(), stasis_app_get_debug_by_name(), stasis_app_is_registered(), stasis_app_name(), stasis_app_object_to_json(), stasis_app_send(), stasis_app_set_debug(), stasis_app_set_debug_by_name(), stasis_app_set_global_debug(), stasis_app_subscribe_channel(), stasis_app_to_cli(), stasis_app_to_json(), stasis_app_unregister(), stasis_app_user_event(), sub_bridge_update_handler(), sub_channel_update_handler(), sub_endpoint_update_handler(), sub_subscription_change_handler(), subscribe_bridge(), subscribe_channel(), subscribe_device_state(), subscribe_endpoint(), tryexec_exec(), unload_module(), unreference_cached_app(), unsubscribe(), and unsubscribe_device_state().
|
static |
Definition at line 1620 of file app_adsiprog.c.
|
static |
Definition at line 88 of file app_adsiprog.c.
Referenced by add_event_to_list(), add_new_event_cb(), ast_io_add(), ast_io_change(), calendar_query_exec(), calendar_query_result_exec(), eventlist_destroy(), eventlist_destructor(), eventlist_duplicate(), events_handler(), find_event(), geteventbyname(), handle_manager_show_event(), handle_manager_show_events(), and parse_tag().
|
static |
Definition at line 115 of file app_adsiprog.c.
Referenced by cpeid_setstatus(), and getjustifybyname().
|
static |
Definition at line 896 of file app_adsiprog.c.
Referenced by process_returncode().
|
static |
Definition at line 938 of file app_adsiprog.c.
Referenced by process_opcode().
|
static |
Definition at line 276 of file app_adsiprog.c.
Referenced by send_dtmf().