Asterisk - The Open Source Telephony Project GIT-master-d856a3e
|
ADSI support. More...
#include "asterisk.h"
#include <time.h>
#include <math.h>
#include "asterisk/ulaw.h"
#include "asterisk/alaw.h"
#include "asterisk/callerid.h"
#include "asterisk/fskmodem.h"
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include "asterisk/config.h"
#include "asterisk/file.h"
#include "asterisk/adsi.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Macros | |
#define | ADSI_FLAG_DATAMODE (1 << 8) |
#define | ADSI_MAX_INTRO 20 |
#define | ADSI_MAX_SPEED_DIAL 6 |
#define | ADSI_SPEED_DIAL 10 /* 10-15 are reserved for speed dial */ |
#define | DEFAULT_ADSI_MAX_RETRIES 3 |
#define | SPEEDDIAL_MAX_LEN 20 |
Functions | |
static int | __adsi_transmit_messages (struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | adsi_available (struct ast_channel *chan) |
static int | adsi_begin_download (struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version) |
static int | adsi_careful_send (struct ast_channel *chan, unsigned char *buf, int len, int *remain) |
static int | adsi_channel_restore (struct ast_channel *chan) |
static int | adsi_clear_screen (unsigned char *buf) |
static int | adsi_clear_soft_keys (unsigned char *buf) |
static int | adsi_connect_session (unsigned char *buf, unsigned char *fdn, int ver) |
static int | adsi_data_mode (unsigned char *buf) |
static int | adsi_disconnect_session (unsigned char *buf) |
static int | adsi_display (unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2) |
static int | adsi_download_connect (unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver) |
static int | adsi_download_disconnect (unsigned char *buf) |
static int | adsi_end_download (struct ast_channel *chan) |
static int | adsi_generate (unsigned char *buf, int msgtype, unsigned char *msg, int msglen, int msgnum, int last, struct ast_format *codec) |
static int | adsi_get_cpeid (struct ast_channel *chan, unsigned char *cpeid, int voice) |
static int | adsi_get_cpeinfo (struct ast_channel *chan, int *width, int *height, int *buttons, int voice) |
static int | adsi_input_control (unsigned char *buf, int page, int line, int display, int format, int just) |
static int | adsi_input_format (unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2) |
static void | adsi_load (int reload) |
static int | adsi_load_session (struct ast_channel *chan, unsigned char *app, int ver, int data) |
static int | adsi_load_soft_key (unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data) |
static int | adsi_print (struct ast_channel *chan, char **lines, int *align, int voice) |
static int | adsi_query_cpeid (unsigned char *buf) |
static int | adsi_query_cpeinfo (unsigned char *buf) |
static int | adsi_read_encoded_dtmf (struct ast_channel *chan, unsigned char *buf, int maxlen) |
static int | adsi_set_keys (unsigned char *buf, unsigned char *keys) |
static int | adsi_set_line (unsigned char *buf, int page, int line) |
static int | adsi_transmit_message (struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype) |
static int | adsi_transmit_message_full (struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait) |
static int | adsi_unload_session (struct ast_channel *chan) |
static int | adsi_voice_mode (unsigned char *buf, int when) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | ccopy (unsigned char *dst, const unsigned char *src, int max) |
static void | init_state (void) |
static int | load_module (void) |
static int | reload (void) |
static int | str2align (const char *s) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "ADSI Resource" , .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, .reload = reload, .load_pri = AST_MODPRI_APP_DEPEND, } |
static int | alignment = 0 |
static int | aligns [ADSI_MAX_INTRO] |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static char | intro [ADSI_MAX_INTRO][20] |
static int | maxretries = DEFAULT_ADSI_MAX_RETRIES |
static struct adsi_funcs | res_adsi_funcs |
static char | speeddial [ADSI_MAX_SPEED_DIAL][3][SPEEDDIAL_MAX_LEN] |
static int | speeds = 0 |
static int | total = 0 |
ADSI support.
Move app_getcpeid into this module
Create a core layer so that app_voicemail does not require res_adsi to load
Definition in file res_adsi.c.
#define ADSI_FLAG_DATAMODE (1 << 8) |
Definition at line 58 of file res_adsi.c.
#define ADSI_MAX_INTRO 20 |
Definition at line 55 of file res_adsi.c.
#define ADSI_MAX_SPEED_DIAL 6 |
Definition at line 56 of file res_adsi.c.
#define ADSI_SPEED_DIAL 10 /* 10-15 are reserved for speed dial */ |
Definition at line 63 of file res_adsi.c.
#define DEFAULT_ADSI_MAX_RETRIES 3 |
Definition at line 53 of file res_adsi.c.
#define SPEEDDIAL_MAX_LEN 20 |
Definition at line 68 of file res_adsi.c.
|
static |
Definition at line 230 of file res_adsi.c.
References adsi_careful_send(), ADSI_FLAG_DATAMODE, adsi_generate(), AST_ADSI_AVAILABLE, AST_ADSI_UNAVAILABLE, ast_channel_adsicpe_set(), ast_channel_defer_dtmf(), ast_channel_name(), ast_channel_undefer_dtmf(), ast_debug, ast_format_ulaw, AST_FRAME_DTMF, ast_frfree, ast_gen_cas(), ast_log, ast_read(), ast_readstring(), ast_verb, ast_waitfor(), buf, errno, ast_frame::frametype, ast_frame_subclass::integer, LOG_WARNING, maxretries, NULL, and ast_frame::subclass.
Referenced by adsi_transmit_message_full().
|
static |
Definition at line 1218 of file res_adsi.c.
|
static |
Definition at line 1218 of file res_adsi.c.
|
static |
Definition at line 811 of file res_adsi.c.
References AST_ADSI_AVAILABLE, and AST_ADSI_UNKNOWN.
|
static |
Definition at line 354 of file res_adsi.c.
References adsi_download_connect(), ADSI_MSG_DOWNLOAD, adsi_transmit_message_full(), ast_debug, ast_readstring(), buf, service, and version.
|
static |
Definition at line 152 of file res_adsi.c.
References ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_ulaw, AST_FRAME_VOICE, ast_frfree, ast_log, ast_read(), ast_waitfor(), ast_write(), buf, ast_frame::data, ast_frame::datalen, ast_frame_subclass::format, ast_frame::frametype, len(), LOG_WARNING, ast_frame::ptr, ast_frame::samples, and ast_frame::subclass.
Referenced by __adsi_transmit_messages().
|
static |
Definition at line 973 of file res_adsi.c.
References ADSI_INFO_PAGE, ADSI_MSG_DISPLAY, adsi_set_keys(), adsi_set_line(), ADSI_SPEED_DIAL, adsi_transmit_message_full(), and speeds.
|
static |
Definition at line 779 of file res_adsi.c.
References ADSI_CLEAR_SCREEN, and buf.
|
static |
Definition at line 764 of file res_adsi.c.
References ADSI_CLEAR_SOFTKEY, and buf.
|
static |
Definition at line 523 of file res_adsi.c.
References ADSI_CONNECT_SESSION, and buf.
Referenced by adsi_load_session().
|
static |
Definition at line 749 of file res_adsi.c.
References ADSI_SWITCH_TO_DATA, and buf.
Referenced by adsi_get_cpeid(), adsi_get_cpeinfo(), and adsi_load_session().
|
static |
Definition at line 579 of file res_adsi.c.
References ADSI_DISC_SESSION, and buf.
Referenced by adsi_unload_session().
|
static |
Definition at line 836 of file res_adsi.c.
References ADSI_LOAD_VIRTUAL_DISP, buf, and ccopy().
Referenced by adsi_print().
|
static |
Definition at line 547 of file res_adsi.c.
References ADSI_DOWNLOAD_CONNECT, buf, ccopy(), and service.
Referenced by adsi_begin_download().
|
static |
Definition at line 821 of file res_adsi.c.
References ADSI_DOWNLOAD_DISC, and buf.
Referenced by adsi_end_download().
|
static |
Definition at line 376 of file res_adsi.c.
References adsi_download_disconnect(), ADSI_MSG_DOWNLOAD, adsi_transmit_message_full(), and buf.
|
static |
Definition at line 102 of file res_adsi.c.
References last, PUT_CLID, and PUT_CLID_MARKMS.
Referenced by __adsi_transmit_messages().
|
static |
Definition at line 651 of file res_adsi.c.
References adsi_data_mode(), ADSI_MSG_DISPLAY, adsi_query_cpeid(), adsi_read_encoded_dtmf(), adsi_transmit_message_full(), adsi_voice_mode(), ast_log, ast_waitfordigit(), buf, and LOG_WARNING.
|
static |
Definition at line 682 of file res_adsi.c.
References adsi_data_mode(), ADSI_MSG_DISPLAY, adsi_query_cpeinfo(), adsi_transmit_message_full(), adsi_voice_mode(), ast_log, ast_readstring(), ast_waitfordigit(), buf, and LOG_WARNING.
|
static |
Definition at line 883 of file res_adsi.c.
References ADSI_INPUT_CONTROL, and buf.
|
static |
Definition at line 906 of file res_adsi.c.
References ADSI_INPUT_FORMAT, ast_strlen_zero(), buf, and ccopy().
|
static |
Definition at line 1103 of file res_adsi.c.
References ADSI_MAX_INTRO, ADSI_MAX_SPEED_DIAL, alignment, aligns, ast_config_destroy(), ast_config_load, ast_copy_string(), ast_variable_browse(), buf, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, CONFIG_STATUS_FILEUNCHANGED, init_state(), intro, maxretries, name, ast_variable::name, ast_variable::next, NULL, reload(), speeddial, SPEEDDIAL_MAX_LEN, speeds, str2align(), strsep(), total, and ast_variable::value.
Referenced by load_module(), and reload().
|
static |
Definition at line 1015 of file res_adsi.c.
References adsi_connect_session(), adsi_data_mode(), ADSI_MSG_DISPLAY, adsi_transmit_message_full(), app, ast_debug, ast_log, ast_readstring(), ast_frame::data, and LOG_WARNING.
|
static |
Definition at line 482 of file res_adsi.c.
References ADSI_LOAD_SOFTKEY, ADSI_SWITCH_TO_DATA2, buf, ccopy(), and ast_frame::data.
|
static |
Definition at line 995 of file res_adsi.c.
References adsi_display(), ADSI_INFO_PAGE, ADSI_MSG_DISPLAY, adsi_set_line(), adsi_transmit_message_full(), adsi_voice_mode(), ast_waitfordigit(), and buf.
|
static |
Definition at line 594 of file res_adsi.c.
References ADSI_QUERY_CPEID, and buf.
Referenced by adsi_get_cpeid().
|
static |
Definition at line 604 of file res_adsi.c.
References ADSI_QUERY_CONFIG, and buf.
Referenced by adsi_get_cpeinfo().
|
static |
Definition at line 614 of file res_adsi.c.
References ast_waitfordigit(), buf, and current.
Referenced by adsi_get_cpeid().
|
static |
Definition at line 926 of file res_adsi.c.
References ADSI_INIT_SOFTKEY_LINE, and buf.
Referenced by adsi_channel_restore().
|
static |
Definition at line 942 of file res_adsi.c.
References ADSI_LINE_CONTROL, and buf.
Referenced by adsi_channel_restore(), and adsi_print().
|
static |
Definition at line 466 of file res_adsi.c.
References adsi_transmit_message_full().
|
static |
Definition at line 390 of file res_adsi.c.
References __adsi_transmit_messages(), ADSI_FLAG_DATAMODE, ADSI_SWITCH_TO_DATA, ADSI_SWITCH_TO_VOICE, ao2_bump, ao2_cleanup, ast_channel_adsicpe_set(), ast_channel_readformat(), ast_channel_writeformat(), ast_debug, ast_format_get_name(), ast_format_ulaw, ast_log, ast_safe_sleep(), ast_set_read_format(), ast_set_write_format(), ast_stopstream(), ast_waitfordigit(), LOG_WARNING, NULL, and RAII_VAR.
Referenced by adsi_begin_download(), adsi_channel_restore(), adsi_end_download(), adsi_get_cpeid(), adsi_get_cpeinfo(), adsi_load_session(), adsi_print(), adsi_transmit_message(), and adsi_unload_session().
|
static |
Definition at line 1054 of file res_adsi.c.
References adsi_disconnect_session(), ADSI_MSG_DISPLAY, adsi_transmit_message_full(), and adsi_voice_mode().
|
static |
Definition at line 794 of file res_adsi.c.
References ADSI_SWITCH_TO_VOICE, and buf.
Referenced by adsi_get_cpeid(), adsi_get_cpeinfo(), adsi_print(), and adsi_unload_session().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1218 of file res_adsi.c.
|
inlinestatic |
Definition at line 471 of file res_adsi.c.
References max, and ast_frame::src.
Referenced by adsi_display(), adsi_download_connect(), adsi_input_format(), and adsi_load_soft_key().
|
static |
Definition at line 1084 of file res_adsi.c.
References ADSI_JUST_CENT, ADSI_MAX_INTRO, alignment, aligns, ast_copy_string(), intro, speeddial, speeds, and total.
Referenced by adsi_load().
|
static |
Definition at line 1198 of file res_adsi.c.
References adsi_load(), ast_adsi_install_funcs(), AST_MODULE_LOAD_SUCCESS, and res_adsi_funcs.
|
static |
|
static |
Definition at line 1071 of file res_adsi.c.
References ADSI_JUST_CENT, ADSI_JUST_IND, ADSI_JUST_LEFT, and ADSI_JUST_RIGHT.
Referenced by adsi_load().
|
static |
Definition at line 1205 of file res_adsi.c.
References ast_adsi_install_funcs(), and NULL.
|
static |
Definition at line 1218 of file res_adsi.c.
|
static |
Definition at line 71 of file res_adsi.c.
Referenced by adsi_load(), and init_state().
|
static |
Definition at line 66 of file res_adsi.c.
Referenced by adsi_load(), and init_state().
|
static |
Definition at line 1218 of file res_adsi.c.
|
static |
Definition at line 65 of file res_adsi.c.
Referenced by adsi_load(), and init_state().
|
static |
Definition at line 60 of file res_adsi.c.
Referenced by __adsi_transmit_messages(), adsi_load(), ast_ivr_menu_run_internal(), and privacy_exec().
|
static |
Definition at line 1166 of file res_adsi.c.
Referenced by load_module().
|
static |
Definition at line 69 of file res_adsi.c.
Referenced by adsi_load(), and init_state().
|
static |
Definition at line 971 of file res_adsi.c.
Referenced by adsi_channel_restore(), adsi_load(), and init_state().
|
static |
Definition at line 970 of file res_adsi.c.
Referenced by __iax2_show_peers(), __rec_search(), acf_vmcount_exec(), action_confbridgelist(), action_coreshowchannelmap(), action_meetmelist(), adsi_confirm_match(), adsi_load(), ast_cdr_serialize_variables(), ast_dsp_silence_noise_with_energy(), ast_hashtab_hash_string(), ast_hashtab_hash_string_nocase(), ast_hashtab_hash_string_sax(), AST_TEST_DEFINE(), hash_string(), http_body_read_contents(), init_state(), manager_iax2_show_peers(), manager_iax2_show_registry(), manager_parking_status_all_lots(), manager_parking_status_single_lot(), meetme_show_cmd(), multi_autochan_free(), pbx_builtin_serialize_variables(), and query_set_test().