adsi.h File Reference

#include <asterisk/callerid.h>

Include dependency graph for adsi.h:

Go to the source code of this file.

Defines

#define ADSI_MSG_DISPLAY   132
#define ADSI_MSG_DOWNLOAD   133
#define ADSI_LOAD_SOFTKEY   128
#define ADSI_INIT_SOFTKEY_LINE   129
#define ADSI_LOAD_VIRTUAL_DISP   130
#define ADSI_LINE_CONTROL   131
#define ADSI_INFORMATION   132
#define ADSI_DISC_SESSION   133
#define ADSI_SWITCH_TO_DATA   134
#define ADSI_SWITCH_TO_VOICE   135
#define ADSI_CLEAR_SOFTKEY   136
#define ADSI_INPUT_CONTROL   137
#define ADSI_INPUT_FORMAT   138
#define ADSI_SWITCH_TO_PERIPH   139
#define ADSI_MOVE_DATA   140
#define ADSI_LOAD_DEFAULT   141
#define ADSI_CONNECT_SESSION   142
#define ADSI_CLEAR_TYPE_AHEAD   143
#define ADSI_DISPLAY_CALL_BUF   144
#define ADSI_CLEAR_CALL_BUF   145
#define ADSI_SWITCH_TO_ALT   146
#define ADSI_SWITCH_TO_GRAPHICS   147
#define ADSI_CLEAR_SCREEN   148
#define ADSI_QUERY_CONFIG   149
#define ADSI_QUERY_CPEID   150
#define ADSI_SWITCH_TO_APP   151
#define ADSI_LOAD_SOFTKEY_TABLE   128
#define ADSI_LOAD_PREDEF_DISP   129
#define ADSI_LOAD_SCRIPT   130
#define ADSI_DOWNLOAD_CONNECT   131
#define ADSI_DOWNLOAD_DISC   132
#define ADSI_ENCODED_DTMF   0x80
#define ADSI_ON_HOOK   0x81
#define ADSI_OFF_HOOK   0x82
#define ADSI_FLASH   0x83
#define ADSI_DIAL_TONE_DETECT   0x84
#define ADSI_LINE_NUMBER   0x85
#define ADSI_BLANK   0x86
#define ADSI_SEND_CHARS   0x87
#define ADSI_CLEAR_CHARS   0x88
#define ADSI_BACKSPACE   0x89
#define ADSI_TAB_COLUMN   0x8A
#define ADSI_GOTO_LINE   0x8B
#define ADSI_GOTO_LINE_REL   0x8C
#define ADSI_PAGE_UP   0x8D
#define ADSI_PAGE_DOWN   0x8E
#define ADSI_EXTENDED_DTMF   0x8F
#define ADSI_DELAY   0x90
#define ADSI_DIAL_PULSE_ONE   0x91
#define ADSI_SWITCH_TO_DATA2   0x92
#define ADSI_SWITCH_TO_VOICE2   0x93
#define ADSI_DISP_CALL_BUF   0x94
#define ADSI_CLEAR_CALL_B   0x95
#define ADSI_INFO_PAGE   0x0
#define ADSI_COMM_PAGE   0x1
#define ADSI_KEY_APPS   16
#define ADSI_JUST_LEFT   0x2
#define ADSI_JUST_RIGHT   0x1
#define ADSI_JUST_CENT   0x0
#define ADSI_JUST_IND   0x3
#define ADSI_KEY_SKT   0x80
#define ADSI_KEY_HILITE   0x40
#define ADSI_DIR_FROM_LEFT   (0)
#define ADSI_DIR_FROM_RIGHT   (1)

Functions

int adsi_channel_init (struct ast_channel *chan)
 Perform Asterisk ADSI initialization (for channel drivers that want.
int adsi_begin_download (struct ast_channel *chan, char *service, char *fdn, char *sec, int version)
int adsi_end_download (struct ast_channel *chan)
int adsi_channel_restore (struct ast_channel *chan)
 Restore ADSI initialization (for applications that play with ADSI.
int adsi_print (struct ast_channel *chan, char **lines, int *align, int voice)
 Display some stuff on the screen.
int adsi_load_session (struct ast_channel *chan, unsigned char *app, int ver, int data)
 Check if scripts for a given app are already loaded. Version may be -1.
int adsi_unload_session (struct ast_channel *chan)
int adsi_transmit_messages (struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype)
int adsi_transmit_message (struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
int adsi_transmit_message_full (struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
int adsi_read_encoded_dtmf (struct ast_channel *chan, unsigned char *buf, int maxlen)
 Read some encoded DTMF data.
int adsi_connect_session (unsigned char *buf, unsigned char *fdn, int ver)
 Connects an ADSI Display Session */.
int adsi_query_cpeid (unsigned char *buf)
 Build Query CPE ID of equipment */.
int adsi_query_cpeinfo (unsigned char *buf)
int adsi_get_cpeid (struct ast_channel *chan, unsigned char *cpeid, int voice)
 Get CPE ID from an attached ADSI compatible CPE.
int adsi_get_cpeinfo (struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
int adsi_download_connect (unsigned char *buf, unsigned char *service, unsigned char *fdn, unsigned char *sec, int ver)
 Begin an ADSI script download */.
int adsi_disconnect_session (unsigned char *buf)
 Disconnects a running session.
int adsi_download_disconnect (unsigned char *buf)
 Disconnects (and hopefully saves) a downloaded script.
int adsi_data_mode (unsigned char *buf)
 Puts CPE in data mode...
int adsi_clear_soft_keys (unsigned char *buf)
int adsi_clear_screen (unsigned char *buf)
int adsi_voice_mode (unsigned char *buf, int when)
 Puts CPE in voice mode...
int adsi_available (struct ast_channel *chan)
 Returns non-zero if Channel does or might support ADSI.
int adsi_display (unsigned char *buf, int page, int line, int just, int wrap, unsigned char *col1, unsigned char *col2)
 Loads a line of info into the display */.
int adsi_set_line (unsigned char *buf, int page, int line)
 Sets the current line and page */.
int adsi_load_soft_key (unsigned char *buf, int key, unsigned char *llabel, unsigned char *slabel, unsigned char *ret, int data)
 Creates "load soft key" parameters.
int adsi_set_keys (unsigned char *buf, unsigned char *keys)
 Set which soft keys should be displayed.
int adsi_input_control (unsigned char *buf, int page, int line, int display, int format, int just)
 Set input information.
int adsi_input_format (unsigned char *buf, int num, int dir, int wrap, unsigned char *format1, unsigned char *format2)
 Set input format.


Define Documentation

#define ADSI_BACKSPACE   0x89

Definition at line 68 of file adsi.h.

#define ADSI_BLANK   0x86

Definition at line 65 of file adsi.h.

#define ADSI_CLEAR_CALL_B   0x95

Definition at line 80 of file adsi.h.

#define ADSI_CLEAR_CALL_BUF   145

Definition at line 43 of file adsi.h.

#define ADSI_CLEAR_CHARS   0x88

Definition at line 67 of file adsi.h.

#define ADSI_CLEAR_SCREEN   148

Definition at line 46 of file adsi.h.

#define ADSI_CLEAR_SOFTKEY   136

Definition at line 34 of file adsi.h.

#define ADSI_CLEAR_TYPE_AHEAD   143

Definition at line 41 of file adsi.h.

#define ADSI_COMM_PAGE   0x1

Definition at line 97 of file adsi.h.

#define ADSI_CONNECT_SESSION   142

Definition at line 40 of file adsi.h.

#define ADSI_DELAY   0x90

Definition at line 75 of file adsi.h.

#define ADSI_DIAL_PULSE_ONE   0x91

Definition at line 76 of file adsi.h.

#define ADSI_DIAL_TONE_DETECT   0x84

Definition at line 63 of file adsi.h.

#define ADSI_DIR_FROM_LEFT   (0)

Definition at line 110 of file adsi.h.

#define ADSI_DIR_FROM_RIGHT   (1)

Definition at line 111 of file adsi.h.

#define ADSI_DISC_SESSION   133

Definition at line 31 of file adsi.h.

#define ADSI_DISP_CALL_BUF   0x94

Definition at line 79 of file adsi.h.

#define ADSI_DISPLAY_CALL_BUF   144

Definition at line 42 of file adsi.h.

#define ADSI_DOWNLOAD_CONNECT   131

Definition at line 55 of file adsi.h.

#define ADSI_DOWNLOAD_DISC   132

Definition at line 56 of file adsi.h.

#define ADSI_ENCODED_DTMF   0x80

Definition at line 59 of file adsi.h.

#define ADSI_EXTENDED_DTMF   0x8F

Definition at line 74 of file adsi.h.

#define ADSI_FLASH   0x83

Definition at line 62 of file adsi.h.

#define ADSI_GOTO_LINE   0x8B

Definition at line 70 of file adsi.h.

#define ADSI_GOTO_LINE_REL   0x8C

Definition at line 71 of file adsi.h.

#define ADSI_INFO_PAGE   0x0

Definition at line 96 of file adsi.h.

#define ADSI_INFORMATION   132

Definition at line 30 of file adsi.h.

#define ADSI_INIT_SOFTKEY_LINE   129

Definition at line 27 of file adsi.h.

#define ADSI_INPUT_CONTROL   137

Definition at line 35 of file adsi.h.

#define ADSI_INPUT_FORMAT   138

Definition at line 36 of file adsi.h.

#define ADSI_JUST_CENT   0x0

Definition at line 104 of file adsi.h.

#define ADSI_JUST_IND   0x3

Definition at line 105 of file adsi.h.

#define ADSI_JUST_LEFT   0x2

Definition at line 102 of file adsi.h.

#define ADSI_JUST_RIGHT   0x1

Definition at line 103 of file adsi.h.

#define ADSI_KEY_APPS   16

Definition at line 99 of file adsi.h.

#define ADSI_KEY_HILITE   0x40

Definition at line 108 of file adsi.h.

#define ADSI_KEY_SKT   0x80

Definition at line 107 of file adsi.h.

#define ADSI_LINE_CONTROL   131

Definition at line 29 of file adsi.h.

#define ADSI_LINE_NUMBER   0x85

Definition at line 64 of file adsi.h.

#define ADSI_LOAD_DEFAULT   141

Definition at line 39 of file adsi.h.

#define ADSI_LOAD_PREDEF_DISP   129

Definition at line 53 of file adsi.h.

#define ADSI_LOAD_SCRIPT   130

Definition at line 54 of file adsi.h.

#define ADSI_LOAD_SOFTKEY   128

Definition at line 26 of file adsi.h.

#define ADSI_LOAD_SOFTKEY_TABLE   128

Definition at line 52 of file adsi.h.

#define ADSI_LOAD_VIRTUAL_DISP   130

Definition at line 28 of file adsi.h.

#define ADSI_MOVE_DATA   140

Definition at line 38 of file adsi.h.

#define ADSI_MSG_DISPLAY   132

Definition at line 22 of file adsi.h.

#define ADSI_MSG_DOWNLOAD   133

Definition at line 23 of file adsi.h.

#define ADSI_OFF_HOOK   0x82

Definition at line 61 of file adsi.h.

#define ADSI_ON_HOOK   0x81

Definition at line 60 of file adsi.h.

#define ADSI_PAGE_DOWN   0x8E

Definition at line 73 of file adsi.h.

#define ADSI_PAGE_UP   0x8D

Definition at line 72 of file adsi.h.

#define ADSI_QUERY_CONFIG   149

Definition at line 47 of file adsi.h.

#define ADSI_QUERY_CPEID   150

Definition at line 48 of file adsi.h.

#define ADSI_SEND_CHARS   0x87

Definition at line 66 of file adsi.h.

#define ADSI_SWITCH_TO_ALT   146

Definition at line 44 of file adsi.h.

#define ADSI_SWITCH_TO_APP   151

Definition at line 49 of file adsi.h.

#define ADSI_SWITCH_TO_DATA   134

Definition at line 32 of file adsi.h.

#define ADSI_SWITCH_TO_DATA2   0x92

Definition at line 77 of file adsi.h.

#define ADSI_SWITCH_TO_GRAPHICS   147

Definition at line 45 of file adsi.h.

#define ADSI_SWITCH_TO_PERIPH   139

Definition at line 37 of file adsi.h.

#define ADSI_SWITCH_TO_VOICE   135

Definition at line 33 of file adsi.h.

#define ADSI_SWITCH_TO_VOICE2   0x93

Definition at line 78 of file adsi.h.

#define ADSI_TAB_COLUMN   0x8A

Definition at line 69 of file adsi.h.


Function Documentation

int adsi_available ( struct ast_channel chan  ) 

Returns non-zero if Channel does or might support ADSI.

Parameters:
chan Channel to check

int adsi_begin_download ( struct ast_channel chan,
char *  service,
char *  fdn,
char *  sec,
int  version 
)

int adsi_channel_init ( struct ast_channel chan  ) 

Perform Asterisk ADSI initialization (for channel drivers that want.

Parameters:
chan Channel to initialize for ADSI (if supported)
Returns 0 on success (or adsi unavailable) and -1 on hangup

int adsi_channel_restore ( struct ast_channel chan  ) 

Restore ADSI initialization (for applications that play with ADSI.

Parameters:
chan Channel to restore
Returns 0 on success (or adsi unavailable) and -1 on hangup

int adsi_clear_screen ( unsigned char *  buf  ) 

int adsi_clear_soft_keys ( unsigned char *  buf  ) 

int adsi_connect_session ( unsigned char *  buf,
unsigned char *  fdn,
int  ver 
)

Connects an ADSI Display Session */.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
fdn Optional 4 byte Feature Download Number (for loading soft keys)
ver Optional version number (0-255, or -1 to omit)
Returns number of bytes added to buffer or -1 on error.

int adsi_data_mode ( unsigned char *  buf  ) 

Puts CPE in data mode...

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
Returns number of bytes added to buffer or -1 on error.

int adsi_disconnect_session ( unsigned char *  buf  ) 

Disconnects a running session.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
Returns number of bytes added to buffer or -1 on error.

int adsi_display ( unsigned char *  buf,
int  page,
int  line,
int  just,
int  wrap,
unsigned char *  col1,
unsigned char *  col2 
)

Loads a line of info into the display */.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
page Page to load (ADSI_COMM_PAGE or ADSI_INFO_PAGE)
line Line number to load (1-4 for Comm page, 1-33 for info page)
just Line justification (ADSI_JUST_LEFT, ADSI_JUST_RIGHT, ADSI_JUST_CENT, ADSI_JUST_IND)
wrap Wrap (1 = yes, 0 = no)
col1 Text to place in first column
col2 Text to place in second column
Returns number of bytes added to buffer or -1 on error.

int adsi_download_connect ( unsigned char *  buf,
unsigned char *  service,
unsigned char *  fdn,
unsigned char *  sec,
int  ver 
)

Begin an ADSI script download */.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
service,a 1-18 byte name of the feature
fdn 4 byte Feature Download Number (for loading soft keys)
sec 4 byte vendor security code
ver version number (0-255, or -1 to omit)
Returns number of bytes added to buffer or -1 on error.

int adsi_download_disconnect ( unsigned char *  buf  ) 

Disconnects (and hopefully saves) a downloaded script.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
Returns number of bytes added to buffer or -1 on error.

int adsi_end_download ( struct ast_channel chan  ) 

int adsi_get_cpeid ( struct ast_channel chan,
unsigned char *  cpeid,
int  voice 
)

Get CPE ID from an attached ADSI compatible CPE.

Returns 1 on success, storing 4 bytes of CPE ID at buf or -1 on hangup, or 0 if there was no hangup but it failed to find the device ID. Returns to voice mode if "voice" is non-zero.

int adsi_get_cpeinfo ( struct ast_channel chan,
int *  width,
int *  height,
int *  buttons,
int  voice 
)

int adsi_input_control ( unsigned char *  buf,
int  page,
int  line,
int  display,
int  format,
int  just 
)

Set input information.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
page Which page to input on (ADSI_COMM_PAGE or ADSI_INFO_PAGE)
line Line number to input on
display Set to zero to obscure input, or 1 to leave visible
format Format number to use (0-7)
just Justification (left, right center, indent)
Returns number of bytes added to buffer or -1 on error.

int adsi_input_format ( unsigned char *  buf,
int  num,
int  dir,
int  wrap,
unsigned char *  format1,
unsigned char *  format2 
)

Set input format.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
num Which format we are setting
dir Which direction (ADSI_DIR_FROM_LEFT or ADSI_DIR_FROM_RIGHT)
wrap Set to 1 to permit line wrap, or 0 if not
format1 Format for column 1
format2 Format for column 2
Returns number of bytes added to buffer or -1 on error.

int adsi_load_session ( struct ast_channel chan,
unsigned char *  app,
int  ver,
int  data 
)

Check if scripts for a given app are already loaded. Version may be -1.

Parameters:
chan Channel to test for loaded app
app Four character app name (must be unique to your application)
ver optional version number
data Non-zero if you want to be put in data mode
Returns 0 if scripts is not loaded or not an ADSI CPE. Returns -1 on hangup. Returns 1 if script already loaded.

int adsi_load_soft_key ( unsigned char *  buf,
int  key,
unsigned char *  llabel,
unsigned char *  slabel,
unsigned char *  ret,
int  data 
)

Creates "load soft key" parameters.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
key Key code from 2 to 33, for which key we are loading
llabel Long label for key (1-18 bytes)
slabel Short label for key (1-7 bytes)
ret Optional return sequence (NULL for none)
data whether to put CPE in data mode before sending digits
Returns number of bytes added to buffer or -1 on error.

int adsi_print ( struct ast_channel chan,
char **  lines,
int *  align,
int  voice 
)

Display some stuff on the screen.

Parameters:
chan Channel to display on
lines NULL-terminated list of things to print (no more than 4 recommended)
align list of alignments to use (ADSI_JUST_LEFT, ADSI_JUST_RIGHT, ADSI_JUST_CEN, etc..)
voice whether to jump into voice mode when finished
Return 0 on success (or adsi unavailable) and -1 on hangup

int adsi_query_cpeid ( unsigned char *  buf  ) 

Build Query CPE ID of equipment */.

Returns number of bytes added to message

int adsi_query_cpeinfo ( unsigned char *  buf  ) 

int adsi_read_encoded_dtmf ( struct ast_channel chan,
unsigned char *  buf,
int  maxlen 
)

Read some encoded DTMF data.

Returns number of bytes received

int adsi_set_keys ( unsigned char *  buf,
unsigned char *  keys 
)

Set which soft keys should be displayed.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
keys Array of 8 unsigned chars with the key numbers, may be OR'd with ADSI_KEY_HILITE But remember, the last two keys aren't real keys, they're for scrolling
Returns number of bytes added to buffer or -1 on error.

int adsi_set_line ( unsigned char *  buf,
int  page,
int  line 
)

Sets the current line and page */.

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
page Which page (ADSI_COMM_PAGE or ADSI_INFO_PAGE)
line Line number (1-33 for info page, 1-4 for comm page)
Returns number of bytes added to buffer or -1 on error.

int adsi_transmit_message ( struct ast_channel chan,
unsigned char *  msg,
int  msglen,
int  msgtype 
)

int adsi_transmit_message_full ( struct ast_channel chan,
unsigned char *  msg,
int  msglen,
int  msgtype,
int  dowait 
)

int adsi_transmit_messages ( struct ast_channel chan,
unsigned char **  msg,
int *  msglen,
int *  msgtype 
)

int adsi_unload_session ( struct ast_channel chan  ) 

int adsi_voice_mode ( unsigned char *  buf,
int  when 
)

Puts CPE in voice mode...

Parameters:
buf Character buffer to create parameter in (must have at least 256 free)
when (a time in seconds) to make the switch
Returns number of bytes added to buffer or -1 on error.


Generated on Wed Oct 28 17:00:48 2009 for Asterisk by  doxygen 1.5.6