Asterisk - The Open Source Telephony Project  21.4.1
Macros | Functions | Variables
res_adsi.c File Reference

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_moduleAST_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 = "da6642af068ee5e6490c5b1d2cc1d238" , .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_infoast_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
 

Detailed Description

ADSI support.

Author
Mark Spencer marks.nosp@m.ter@.nosp@m.digiu.nosp@m.m.co.nosp@m.m
Note
this module is required by app_voicemail and app_getcpeid
Todo:

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.