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"
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, format_t 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) |
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 = "ac1f6a56484a8820659555499174e588" , .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 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 59 of file res_adsi.c.
Referenced by __adsi_transmit_messages(), and adsi_transmit_message_full().
#define ADSI_MAX_INTRO 20 |
Definition at line 56 of file res_adsi.c.
Referenced by adsi_load(), and init_state().
#define ADSI_MAX_SPEED_DIAL 6 |
Definition at line 57 of file res_adsi.c.
Referenced by adsi_load().
#define ADSI_SPEED_DIAL 10 /* 10-15 are reserved for speed dial */ |
Definition at line 64 of file res_adsi.c.
Referenced by adsi_channel_restore().
#define DEFAULT_ADSI_MAX_RETRIES 3 |
Definition at line 54 of file res_adsi.c.
#define SPEEDDIAL_MAX_LEN 20 |
Definition at line 69 of file res_adsi.c.
Referenced by adsi_load().
|
static |
Definition at line 233 of file res_adsi.c.
References adsi_careful_send(), ADSI_FLAG_DATAMODE, adsi_generate(), ast_channel::adsicpe, AST_ADSI_AVAILABLE, AST_ADSI_UNAVAILABLE, ast_channel_defer_dtmf(), 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(), errno, f, ast_frame::frametype, ast_frame_subclass::integer, LOG_WARNING, ast_channel::name, and ast_frame::subclass.
Referenced by adsi_transmit_message_full().
|
static |
Definition at line 1214 of file res_adsi.c.
|
static |
Definition at line 1214 of file res_adsi.c.
|
static |
Definition at line 808 of file res_adsi.c.
References ast_channel::adsicpe, AST_ADSI_AVAILABLE, and AST_ADSI_UNKNOWN.
|
static |
Definition at line 356 of file res_adsi.c.
References adsi_download_connect(), ADSI_MSG_DOWNLOAD, adsi_transmit_message_full(), ast_debug, and ast_readstring().
|
static |
Definition at line 153 of file res_adsi.c.
References AST_FORMAT_ULAW, AST_FRAME_VOICE, ast_frfree, ast_log(), ast_read(), ast_waitfor(), ast_write(), ast_frame_subclass::codec, ast_frame::data, ast_frame::datalen, 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 970 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 520 of file res_adsi.c.
References ADSI_CONNECT_SESSION.
Referenced by adsi_load_session().
|
static |
Definition at line 746 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 576 of file res_adsi.c.
References ADSI_DISC_SESSION.
Referenced by adsi_unload_session().
|
static |
Definition at line 833 of file res_adsi.c.
References ADSI_LOAD_VIRTUAL_DISP, and ccopy().
Referenced by adsi_print().
|
static |
Definition at line 544 of file res_adsi.c.
References ADSI_DOWNLOAD_CONNECT, and ccopy().
Referenced by adsi_begin_download().
|
static |
Definition at line 818 of file res_adsi.c.
References ADSI_DOWNLOAD_DISC.
Referenced by adsi_end_download().
|
static |
Definition at line 378 of file res_adsi.c.
References adsi_download_disconnect(), ADSI_MSG_DOWNLOAD, and adsi_transmit_message_full().
|
static |
Definition at line 103 of file res_adsi.c.
References PUT_CLID, and PUT_CLID_MARKMS.
Referenced by __adsi_transmit_messages().
|
static |
Definition at line 648 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(), and LOG_WARNING.
|
static |
Definition at line 679 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(), and LOG_WARNING.
|
static |
|
static |
Definition at line 903 of file res_adsi.c.
References ADSI_INPUT_FORMAT, ast_strlen_zero(), and ccopy().
|
static |
Definition at line 1100 of file res_adsi.c.
References ADSI_MAX_INTRO, ADSI_MAX_SPEED_DIAL, alignment, ast_config_destroy(), ast_config_load, ast_copy_string(), ast_variable_browse(), CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, CONFIG_STATUS_FILEUNCHANGED, init_state(), name, ast_variable::name, ast_variable::next, SPEEDDIAL_MAX_LEN, str2align(), strsep(), and ast_variable::value.
Referenced by load_module(), and reload().
|
static |
Definition at line 1012 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 479 of file res_adsi.c.
References ADSI_LOAD_SOFTKEY, ADSI_SWITCH_TO_DATA2, and ccopy().
|
static |
Definition at line 992 of file res_adsi.c.
References adsi_display(), ADSI_INFO_PAGE, ADSI_MSG_DISPLAY, adsi_set_line(), adsi_transmit_message_full(), adsi_voice_mode(), and ast_waitfordigit().
|
static |
Definition at line 591 of file res_adsi.c.
References ADSI_QUERY_CPEID.
Referenced by adsi_get_cpeid().
|
static |
Definition at line 601 of file res_adsi.c.
References ADSI_QUERY_CONFIG.
Referenced by adsi_get_cpeinfo().
|
static |
Definition at line 611 of file res_adsi.c.
References ast_waitfordigit().
Referenced by adsi_get_cpeid().
|
static |
Definition at line 923 of file res_adsi.c.
References ADSI_INIT_SOFTKEY_LINE.
Referenced by adsi_channel_restore().
|
static |
Definition at line 939 of file res_adsi.c.
References ADSI_LINE_CONTROL.
Referenced by adsi_channel_restore(), and adsi_print().
|
static |
Definition at line 463 of file res_adsi.c.
References adsi_transmit_message_full().
|
static |
Definition at line 392 of file res_adsi.c.
References __adsi_transmit_messages(), ADSI_FLAG_DATAMODE, ADSI_SWITCH_TO_DATA, ADSI_SWITCH_TO_VOICE, ast_channel::adsicpe, ast_debug, AST_FORMAT_ULAW, ast_log(), ast_safe_sleep(), ast_set_read_format(), ast_set_write_format(), ast_stopstream(), ast_waitfordigit(), for(), LOG_WARNING, ast_channel::readformat, and ast_channel::writeformat.
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 1051 of file res_adsi.c.
References adsi_disconnect_session(), ADSI_MSG_DISPLAY, adsi_transmit_message_full(), and adsi_voice_mode().
|
static |
Definition at line 791 of file res_adsi.c.
References ADSI_SWITCH_TO_VOICE.
Referenced by adsi_get_cpeid(), adsi_get_cpeinfo(), adsi_print(), and adsi_unload_session().
|
inlinestatic |
Definition at line 468 of file res_adsi.c.
Referenced by adsi_display(), adsi_download_connect(), adsi_input_format(), and adsi_load_soft_key().
|
static |
Definition at line 1081 of file res_adsi.c.
References ADSI_JUST_CENT, ADSI_MAX_INTRO, and ast_copy_string().
Referenced by adsi_load().
|
static |
Definition at line 1195 of file res_adsi.c.
References adsi_load(), ast_adsi_install_funcs(), and AST_MODULE_LOAD_SUCCESS.
|
static |
|
static |
Definition at line 1068 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 1202 of file res_adsi.c.
References ast_adsi_install_funcs().
|
static |
Definition at line 1214 of file res_adsi.c.
|
static |
Definition at line 72 of file res_adsi.c.
Referenced by adsi_load().
|
static |
Definition at line 67 of file res_adsi.c.
|
static |
Definition at line 1214 of file res_adsi.c.
|
static |
Definition at line 66 of file res_adsi.c.
|
static |
Definition at line 61 of file res_adsi.c.
Referenced by ast_ivr_menu_run_internal(), and privacy_exec().
|
static |
Definition at line 1163 of file res_adsi.c.
|
static |
Definition at line 70 of file res_adsi.c.
|
static |
Definition at line 968 of file res_adsi.c.
Referenced by adsi_channel_restore().
|
static |
Definition at line 967 of file res_adsi.c.
Referenced by action_meetmelist(), ast_cdr_serialize_variables(), ast_hashtab_hash_string(), ast_hashtab_hash_string_nocase(), ast_hashtab_hash_string_sax(), hash_string(), manager_iax2_show_peers(), manager_iax2_show_registry(), manager_show_registry(), manager_sip_show_peers(), manager_skinny_show_devices(), manager_skinny_show_lines(), meetme_show_cmd(), and pbx_builtin_serialize_variables().