Asterisk - The Open Source Telephony Project
18.5.0
|
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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .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.
Referenced by __adsi_transmit_messages(), and adsi_transmit_message_full().
#define ADSI_MAX_INTRO 20 |
Definition at line 55 of file res_adsi.c.
Referenced by adsi_load(), and init_state().
#define ADSI_MAX_SPEED_DIAL 6 |
Definition at line 56 of file res_adsi.c.
Referenced by adsi_load().
#define ADSI_SPEED_DIAL 10 /* 10-15 are reserved for speed dial */ |
Definition at line 63 of file res_adsi.c.
Referenced by adsi_channel_restore().
#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.
Referenced by adsi_load().
|
static |
Definition at line 229 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_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 1216 of file res_adsi.c.
|
static |
Definition at line 1216 of file res_adsi.c.
|
static |
Definition at line 809 of file res_adsi.c.
References AST_ADSI_AVAILABLE, and AST_ADSI_UNKNOWN.
|
static |
Definition at line 352 of file res_adsi.c.
References adsi_download_connect(), ADSI_MSG_DOWNLOAD, adsi_transmit_message_full(), ast_debug, ast_readstring(), and buf.
|
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::datalen, ast_frame_subclass::format, ast_frame::frametype, len(), LOG_WARNING, ast_frame::samples, and ast_frame::subclass.
Referenced by __adsi_transmit_messages().
|
static |
Definition at line 971 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 |
|
static |
|
static |
Definition at line 521 of file res_adsi.c.
References ADSI_CONNECT_SESSION.
Referenced by adsi_load_session().
|
static |
Definition at line 747 of file res_adsi.c.
References ADSI_SWITCH_TO_DATA.
Referenced by adsi_get_cpeid(), adsi_get_cpeinfo(), and adsi_load_session().
|
static |
Definition at line 577 of file res_adsi.c.
References ADSI_DISC_SESSION.
Referenced by adsi_unload_session().
|
static |
Definition at line 834 of file res_adsi.c.
References ADSI_LOAD_VIRTUAL_DISP, and ccopy().
Referenced by adsi_print().
|
static |
Definition at line 545 of file res_adsi.c.
References ADSI_DOWNLOAD_CONNECT, and ccopy().
Referenced by adsi_begin_download().
|
static |
Definition at line 819 of file res_adsi.c.
References ADSI_DOWNLOAD_DISC.
Referenced by adsi_end_download().
|
static |
Definition at line 374 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 PUT_CLID, and PUT_CLID_MARKMS.
Referenced by __adsi_transmit_messages().
|
static |
Definition at line 649 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 680 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 |
|
static |
Definition at line 904 of file res_adsi.c.
References ADSI_INPUT_FORMAT, ast_strlen_zero, and ccopy().
|
static |
Definition at line 1101 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, speeddial, SPEEDDIAL_MAX_LEN, speeds, str2align(), strsep(), total, and ast_variable::value.
Referenced by load_module(), and reload().
|
static |
Definition at line 1013 of file res_adsi.c.
References adsi_connect_session(), adsi_data_mode(), ADSI_MSG_DISPLAY, adsi_transmit_message_full(), ast_debug, ast_log, ast_readstring(), and LOG_WARNING.
|
static |
Definition at line 480 of file res_adsi.c.
References ADSI_LOAD_SOFTKEY, ADSI_SWITCH_TO_DATA2, and ccopy().
|
static |
Definition at line 993 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 592 of file res_adsi.c.
References ADSI_QUERY_CPEID.
Referenced by adsi_get_cpeid().
|
static |
Definition at line 602 of file res_adsi.c.
References ADSI_QUERY_CONFIG.
Referenced by adsi_get_cpeinfo().
|
static |
Definition at line 612 of file res_adsi.c.
References ast_waitfordigit().
Referenced by adsi_get_cpeid().
|
static |
Definition at line 924 of file res_adsi.c.
References ADSI_INIT_SOFTKEY_LINE.
Referenced by adsi_channel_restore().
|
static |
Definition at line 940 of file res_adsi.c.
References ADSI_LINE_CONTROL.
Referenced by adsi_channel_restore(), and adsi_print().
|
static |
Definition at line 464 of file res_adsi.c.
References adsi_transmit_message_full().
|
static |
Definition at line 388 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 1052 of file res_adsi.c.
References adsi_disconnect_session(), ADSI_MSG_DISPLAY, adsi_transmit_message_full(), and adsi_voice_mode().
|
static |
Definition at line 792 of file res_adsi.c.
References ADSI_SWITCH_TO_VOICE.
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 1216 of file res_adsi.c.
|
inlinestatic |
Definition at line 469 of file res_adsi.c.
Referenced by adsi_display(), adsi_download_connect(), adsi_input_format(), and adsi_load_soft_key().
|
static |
Definition at line 1082 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 1196 of file res_adsi.c.
References adsi_load(), ast_adsi_install_funcs(), and AST_MODULE_LOAD_SUCCESS.
Referenced by unload_module().
|
static |
|
static |
Definition at line 1069 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 1203 of file res_adsi.c.
References ast_adsi_install_funcs(), AST_MODFLAG_LOAD_ORDER, AST_MODPRI_APP_DEPEND, AST_MODULE_INFO(), AST_MODULE_SUPPORT_DEPRECATED, ASTERISK_GPL_KEY, load_module(), NULL, and reload().
|
static |
Definition at line 1216 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 1216 of file res_adsi.c.
|
static |
Definition at line 65 of file res_adsi.c.
Referenced by adsi_load(), init_state(), and play_message().
|
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 1164 of file res_adsi.c.
|
static |
Definition at line 69 of file res_adsi.c.
Referenced by adsi_load(), and init_state().
|
static |
Definition at line 969 of file res_adsi.c.
Referenced by adsi_channel_restore(), adsi_load(), and init_state().
|
static |
Definition at line 968 of file res_adsi.c.
Referenced by __rec_search(), action_confbridgelist(), action_meetmelist(), adsi_load(), all_bits_set(), ast_cdr_serialize_variables(), ast_hashtab_hash_string(), ast_hashtab_hash_string_nocase(), ast_hashtab_hash_string_sax(), AST_TEST_DEFINE(), handle_show_threads(), 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(), manager_show_registry(), manager_sip_show_peers(), manager_skinny_show_devices(), manager_skinny_show_lines(), meetme_show_cmd(), pbx_builtin_serialize_variables(), and query_set_test().