adsi.h File Reference

ADSI Support (built upon Caller*ID). More...

#include "asterisk/callerid.h"

Include dependency graph for adsi.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  adsi_funcs

Defines

ADSI parameters


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

Functions

int ast_adsi_available (struct ast_channel *chan)
 Returns non-zero if Channel does or might support ADSI.
int ast_adsi_begin_download (struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
int ast_adsi_channel_restore (struct ast_channel *chan)
int ast_adsi_clear_screen (unsigned char *buf)
int ast_adsi_clear_soft_keys (unsigned char *buf)
int ast_adsi_connect_session (unsigned char *buf, unsigned char *fdn, int ver)
 Connects an ADSI Display Session.
int ast_adsi_data_mode (unsigned char *buf)
 Puts CPE in data mode.
int ast_adsi_disconnect_session (unsigned char *buf)
 Disconnects a running session.
int ast_adsi_display (unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2)
 Loads a line of info into the display.
int ast_adsi_download_connect (unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver)
 Begin an ADSI script download.
int ast_adsi_download_disconnect (unsigned char *buf)
 Disconnects (and hopefully saves) a downloaded script.
int ast_adsi_end_download (struct ast_channel *chan)
int ast_adsi_get_cpeid (struct ast_channel *chan, unsigned char *cpeid, int voice)
int ast_adsi_get_cpeinfo (struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
int ast_adsi_input_control (unsigned char *buf, int page, int line, int display, int format, int just)
 Set input information.
int ast_adsi_input_format (unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
 Set input format.
void ast_adsi_install_funcs (const struct adsi_funcs *funcs)
int ast_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, if any version is okay, or 0-255 for a specific version.
int ast_adsi_load_soft_key (unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data)
 Creates "load soft key" parameters.
int ast_adsi_print (struct ast_channel *chan, char **lines, int *align, int voice)
 Display some stuff on the screen.
int ast_adsi_query_cpeid (unsigned char *buf)
int ast_adsi_query_cpeinfo (unsigned char *buf)
int ast_adsi_read_encoded_dtmf (struct ast_channel *chan, unsigned char *buf, int maxlen)
int ast_adsi_set_keys (unsigned char *buf, unsigned char *keys)
 Set which soft keys should be displayed.
int ast_adsi_set_line (unsigned char *buf, int page, int line)
 Sets the current line and page.
int ast_adsi_transmit_message (struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
int ast_adsi_transmit_message_full (struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
int ast_adsi_unload_session (struct ast_channel *chan)
int ast_adsi_voice_mode (unsigned char *buf, int when)
 Puts CPE in voice mode.


Detailed Description

ADSI Support (built upon Caller*ID).

Definition in file adsi.h.


Define Documentation

#define ADSI_BACKSPACE   0x89

Definition at line 78 of file adsi.h.

#define ADSI_BLANK   0x86

Definition at line 75 of file adsi.h.

#define ADSI_CLEAR_CALL_B   0x95

Definition at line 90 of file adsi.h.

#define ADSI_CLEAR_CALL_BUF   145

Definition at line 53 of file adsi.h.

#define ADSI_CLEAR_CHARS   0x88

Definition at line 77 of file adsi.h.

#define ADSI_CLEAR_SCREEN   148

Definition at line 56 of file adsi.h.

Referenced by adsi_clear_screen().

#define ADSI_CLEAR_SOFTKEY   136

Definition at line 44 of file adsi.h.

Referenced by adsi_clear_soft_keys().

#define ADSI_CLEAR_TYPE_AHEAD   143

Definition at line 51 of file adsi.h.

#define ADSI_COMM_PAGE   0x1

#define ADSI_CONNECT_SESSION   142

Definition at line 50 of file adsi.h.

Referenced by adsi_connect_session().

#define ADSI_DELAY   0x90

Definition at line 85 of file adsi.h.

#define ADSI_DIAL_PULSE_ONE   0x91

Definition at line 86 of file adsi.h.

#define ADSI_DIAL_TONE_DETECT   0x84

Definition at line 73 of file adsi.h.

#define ADSI_DIR_FROM_LEFT   (0)

Definition at line 120 of file adsi.h.

Referenced by adsi_login(), and adsi_password().

#define ADSI_DIR_FROM_RIGHT   (1)

Definition at line 121 of file adsi.h.

#define ADSI_DISC_SESSION   133

Definition at line 41 of file adsi.h.

Referenced by adsi_disconnect_session().

#define ADSI_DISP_CALL_BUF   0x94

Definition at line 89 of file adsi.h.

#define ADSI_DISPLAY_CALL_BUF   144

Definition at line 52 of file adsi.h.

#define ADSI_DOWNLOAD_CONNECT   131

Definition at line 65 of file adsi.h.

Referenced by adsi_download_connect().

#define ADSI_DOWNLOAD_DISC   132

Definition at line 66 of file adsi.h.

Referenced by adsi_download_disconnect().

#define ADSI_ENCODED_DTMF   0x80

Definition at line 69 of file adsi.h.

#define ADSI_EXTENDED_DTMF   0x8F

Definition at line 84 of file adsi.h.

#define ADSI_FLASH   0x83

Definition at line 72 of file adsi.h.

#define ADSI_GOTO_LINE   0x8B

Definition at line 80 of file adsi.h.

#define ADSI_GOTO_LINE_REL   0x8C

Definition at line 81 of file adsi.h.

#define ADSI_INFO_PAGE   0x0

Definition at line 106 of file adsi.h.

Referenced by adsi_channel_restore(), adsi_print(), and adsi_prog().

#define ADSI_INFORMATION   132

Definition at line 40 of file adsi.h.

#define ADSI_INIT_SOFTKEY_LINE   129

Definition at line 37 of file adsi.h.

Referenced by adsi_set_keys().

#define ADSI_INPUT_CONTROL   137

Definition at line 45 of file adsi.h.

Referenced by adsi_input_control().

#define ADSI_INPUT_FORMAT   138

Definition at line 46 of file adsi.h.

Referenced by adsi_input_format().

#define ADSI_JUST_CENT   0x0

#define ADSI_JUST_IND   0x3

Definition at line 115 of file adsi.h.

Referenced by str2align().

#define ADSI_JUST_LEFT   0x2

#define ADSI_JUST_RIGHT   0x1

Definition at line 113 of file adsi.h.

Referenced by str2align().

#define ADSI_KEY_APPS   16

#define ADSI_KEY_HILITE   0x40

Definition at line 118 of file adsi.h.

#define ADSI_KEY_SKT   0x80

Definition at line 117 of file adsi.h.

Referenced by adsi_delete(), adsi_folders(), adsi_message(), adsi_status(), and adsi_status2().

#define ADSI_LINE_CONTROL   131

Definition at line 39 of file adsi.h.

Referenced by adsi_set_line().

#define ADSI_LINE_NUMBER   0x85

Definition at line 74 of file adsi.h.

#define ADSI_LOAD_DEFAULT   141

Definition at line 49 of file adsi.h.

#define ADSI_LOAD_PREDEF_DISP   129

Definition at line 63 of file adsi.h.

#define ADSI_LOAD_SCRIPT   130

Definition at line 64 of file adsi.h.

#define ADSI_LOAD_SOFTKEY   128

Definition at line 36 of file adsi.h.

Referenced by adsi_load_soft_key().

#define ADSI_LOAD_SOFTKEY_TABLE   128

Definition at line 62 of file adsi.h.

#define ADSI_LOAD_VIRTUAL_DISP   130

Definition at line 38 of file adsi.h.

Referenced by adsi_display().

#define ADSI_MOVE_DATA   140

Definition at line 48 of file adsi.h.

#define ADSI_MSG_DISPLAY   132

#define ADSI_MSG_DOWNLOAD   133

Definition at line 33 of file adsi.h.

Referenced by adsi_begin_download(), adsi_end_download(), adsi_load_vmail(), and adsi_prog().

#define ADSI_OFF_HOOK   0x82

Definition at line 71 of file adsi.h.

#define ADSI_ON_HOOK   0x81

Definition at line 70 of file adsi.h.

#define ADSI_PAGE_DOWN   0x8E

Definition at line 83 of file adsi.h.

#define ADSI_PAGE_UP   0x8D

Definition at line 82 of file adsi.h.

#define ADSI_QUERY_CONFIG   149

Definition at line 57 of file adsi.h.

Referenced by adsi_query_cpeinfo().

#define ADSI_QUERY_CPEID   150

Definition at line 58 of file adsi.h.

Referenced by adsi_query_cpeid().

#define ADSI_SEND_CHARS   0x87

Definition at line 76 of file adsi.h.

#define ADSI_SWITCH_TO_ALT   146

Definition at line 54 of file adsi.h.

#define ADSI_SWITCH_TO_APP   151

Definition at line 59 of file adsi.h.

#define ADSI_SWITCH_TO_DATA   134

Definition at line 42 of file adsi.h.

Referenced by adsi_data_mode(), and adsi_transmit_message_full().

#define ADSI_SWITCH_TO_DATA2   0x92

Definition at line 87 of file adsi.h.

Referenced by adsi_load_soft_key().

#define ADSI_SWITCH_TO_GRAPHICS   147

Definition at line 55 of file adsi.h.

#define ADSI_SWITCH_TO_PERIPH   139

Definition at line 47 of file adsi.h.

#define ADSI_SWITCH_TO_VOICE   135

Definition at line 43 of file adsi.h.

Referenced by adsi_transmit_message_full(), and adsi_voice_mode().

#define ADSI_SWITCH_TO_VOICE2   0x93

Definition at line 88 of file adsi.h.

#define ADSI_TAB_COLUMN   0x8A

Definition at line 79 of file adsi.h.

#define AST_ADSI_VERSION   1

Definition at line 123 of file adsi.h.


Function Documentation

int ast_adsi_available ( struct ast_channel chan  ) 

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

Parameters:
chan Channel to check

Definition at line 263 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::available, and func_lock.

Referenced by adsi_begin(), adsi_delete(), adsi_exec(), adsi_folders(), adsi_goodbye(), adsi_login(), adsi_message(), adsi_password(), adsi_status(), adsi_status2(), AST_TEST_DEFINE(), vm_newuser(), vm_options(), and vm_tempgreeting().

00264 {
00265    int res = 0;
00266    ast_rwlock_rdlock(&func_lock);
00267    if (installed_funcs && installed_funcs->available) {
00268       res = installed_funcs->available(chan);
00269    }
00270    ast_rwlock_unlock(&func_lock);
00271    return res;
00272 }

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

Definition at line 32 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::begin_download, and func_lock.

Referenced by adsi_load_vmail(), and adsi_prog().

00033 {
00034    int res = 0;
00035    ast_rwlock_rdlock(&func_lock);
00036    if (installed_funcs && installed_funcs->begin_download) {
00037       res = installed_funcs->begin_download(chan, service, fdn, sec, version);
00038    }
00039    ast_rwlock_unlock(&func_lock);
00040    return res;
00041 }

int ast_adsi_channel_restore ( struct ast_channel chan  ) 

Restore ADSI initialization (for applications that play with ADSI and want to restore it to normal. If you touch "INFO" then you have to use the ast_adsi_channel_init again instead.

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

Definition at line 54 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::channel_restore, and func_lock.

00055 {
00056    int res = 0;
00057    ast_rwlock_rdlock(&func_lock);
00058    if (installed_funcs && installed_funcs->channel_restore) {
00059       res = installed_funcs->channel_restore(chan);
00060    }
00061    ast_rwlock_unlock(&func_lock);
00062    return res;
00063 }

int ast_adsi_clear_screen ( unsigned char *  buf  ) 

Definition at line 241 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::clear_screen, and func_lock.

00242 {
00243    int res = 0;
00244    ast_rwlock_rdlock(&func_lock);
00245    if (installed_funcs && installed_funcs->clear_screen) {
00246       res = installed_funcs->clear_screen(buf);
00247    }
00248    ast_rwlock_unlock(&func_lock);
00249    return res;
00250 }

int ast_adsi_clear_soft_keys ( unsigned char *  buf  ) 

Definition at line 230 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::clear_soft_keys, and func_lock.

00231 {
00232    int res = 0;
00233    ast_rwlock_rdlock(&func_lock);
00234    if (installed_funcs && installed_funcs->clear_soft_keys) {
00235       res = installed_funcs->clear_soft_keys(buf);
00236    }
00237    ast_rwlock_unlock(&func_lock);
00238    return res;
00239 }

int ast_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)
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 131 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::connect_session, and func_lock.

00132 {
00133    int res = 0;
00134    ast_rwlock_rdlock(&func_lock);
00135    if (installed_funcs && installed_funcs->connect_session) {
00136       res = installed_funcs->connect_session(buf, fdn, ver);
00137    }
00138    ast_rwlock_unlock(&func_lock);
00139    return res;
00140 }

int ast_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)
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 219 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::data_mode, and func_lock.

Referenced by adsi_load_vmail().

00220 {
00221    int res = 0;
00222    ast_rwlock_rdlock(&func_lock);
00223    if (installed_funcs && installed_funcs->data_mode) {
00224       res = installed_funcs->data_mode(buf);
00225    }
00226    ast_rwlock_unlock(&func_lock);
00227    return res;
00228 }

int ast_adsi_disconnect_session ( unsigned char *  buf  ) 

Disconnects a running session.

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

Definition at line 197 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::disconnect_session, and func_lock.

00198 {
00199    int res = 0;
00200    ast_rwlock_rdlock(&func_lock);
00201    if (installed_funcs && installed_funcs->disconnect_session) {
00202       res = installed_funcs->disconnect_session(buf);
00203    }
00204    ast_rwlock_unlock(&func_lock);
00205    return res;
00206 }

int ast_adsi_display ( unsigned char *  buf,
int  page,
int  line,
int  just,
int  wrap,
char *  col1,
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
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 274 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::display, and func_lock.

Referenced by adsi_folders(), adsi_goodbye(), adsi_load_vmail(), adsi_login(), adsi_logo(), adsi_message(), adsi_prog(), adsi_status(), adsi_status2(), vm_newuser(), vm_options(), and vm_tempgreeting().

00275 {
00276    int res = 0;
00277    ast_rwlock_rdlock(&func_lock);
00278    if (installed_funcs && installed_funcs->display) {
00279       res = installed_funcs->display(buf, page, line, just, wrap, col1, col2);
00280    }
00281    ast_rwlock_unlock(&func_lock);
00282    return res;
00283 }

int ast_adsi_download_connect ( unsigned char *  buf,
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)
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 186 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::download_connect, and func_lock.

00187 {
00188    int res = 0;
00189    ast_rwlock_rdlock(&func_lock);
00190    if (installed_funcs && installed_funcs->download_connect) {
00191       res = installed_funcs->download_connect(buf, service, fdn, sec, ver);
00192    }
00193    ast_rwlock_unlock(&func_lock);
00194    return res;
00195 }

int ast_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)
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 208 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::download_disconnect, and func_lock.

Referenced by adsi_load_vmail().

00209 {
00210    int res = 0;
00211    ast_rwlock_rdlock(&func_lock);
00212    if (installed_funcs && installed_funcs->download_disconnect) {
00213       res = installed_funcs->download_disconnect(buf);
00214    }
00215    ast_rwlock_unlock(&func_lock);
00216    return res;
00217 }

int ast_adsi_end_download ( struct ast_channel chan  ) 

Definition at line 43 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, adsi_funcs::end_download, and func_lock.

Referenced by adsi_load_vmail(), and adsi_prog().

00044 {
00045    int res = 0;
00046    ast_rwlock_rdlock(&func_lock);
00047    if (installed_funcs && installed_funcs->end_download) {
00048       res = installed_funcs->end_download(chan);
00049    }
00050    ast_rwlock_unlock(&func_lock);
00051    return res;
00052 }

int ast_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.

Definition at line 164 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::get_cpeid.

Referenced by cpeid_exec().

00165 {
00166    int res = 0;
00167    ast_rwlock_rdlock(&func_lock);
00168    if (installed_funcs && installed_funcs->get_cpeid) {
00169       res = installed_funcs->get_cpeid(chan, cpeid, voice);
00170    }
00171    ast_rwlock_unlock(&func_lock);
00172    return res;
00173 }

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

Definition at line 175 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::get_cpeinfo.

Referenced by cpeid_exec().

00176 {
00177    int res = 0;
00178    ast_rwlock_rdlock(&func_lock);
00179    if (installed_funcs && installed_funcs->get_cpeinfo) {
00180       res = installed_funcs->get_cpeinfo(chan, width, height, buttons, voice);
00181    }
00182    ast_rwlock_unlock(&func_lock);
00183    return res;
00184 }

int ast_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)
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 318 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::input_control.

Referenced by adsi_login(), and adsi_password().

00319 {
00320    int res = 0;
00321    ast_rwlock_rdlock(&func_lock);
00322    if (installed_funcs && installed_funcs->input_control) {
00323       res = installed_funcs->input_control(buf, page, line, display, format, just);
00324    }
00325    ast_rwlock_unlock(&func_lock);
00326    return res;
00327 }

int ast_adsi_input_format ( unsigned char *  buf,
int  num,
int  dir,
int  wrap,
char *  format1,
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
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 329 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::input_format.

Referenced by adsi_login(), and adsi_password().

00330 {
00331    int res = 0;
00332    ast_rwlock_rdlock(&func_lock);
00333    if (installed_funcs && installed_funcs->input_format) {
00334       res = installed_funcs->input_format(buf, num, dir, wrap, format1, format2);
00335    }
00336    ast_rwlock_unlock(&func_lock);
00337    return res;
00338 }

void ast_adsi_install_funcs ( const struct adsi_funcs funcs  ) 

Definition at line 340 of file adsi.c.

References ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, current_adsi_version, func_lock, LOG_WARNING, and adsi_funcs::version.

Referenced by load_module(), and unload_module().

00341 {
00342    if (funcs && funcs->version < current_adsi_version) {
00343       ast_log(LOG_WARNING, "Cannot install ADSI function pointers due to version mismatch."
00344             "Ours: %d, Theirs: %u\n", current_adsi_version, funcs->version);
00345       return;
00346    }
00347 
00348    ast_rwlock_wrlock(&func_lock);
00349    installed_funcs = funcs;
00350    ast_rwlock_unlock(&func_lock);
00351 }

int ast_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, if any version is okay, or 0-255 for a specific version.

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
Return values:
0 if scripts is not loaded or not an ADSI CPE
-1 on hangup
1 if script already loaded.

Definition at line 76 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::load_session.

Referenced by adsi_begin(), adsi_load_vmail(), adsi_prog(), and cpeid_exec().

00077 {
00078    int res = 0;
00079    ast_rwlock_rdlock(&func_lock);
00080    if (installed_funcs && installed_funcs->load_session) {
00081       res = installed_funcs->load_session(chan, app, ver, data);
00082    }
00083    ast_rwlock_unlock(&func_lock);
00084    return res;
00085 }

int ast_adsi_load_soft_key ( unsigned char *  buf,
int  key,
const char *  llabel,
const char *  slabel,
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
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 296 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::load_soft_key.

Referenced by adsi_load_vmail(), and adsi_login().

00297 {
00298    int res = 0;
00299    ast_rwlock_rdlock(&func_lock);
00300    if (installed_funcs && installed_funcs->load_soft_key) {
00301       res = installed_funcs->load_soft_key(buf, key, llabel, slabel, ret, data);
00302    }
00303    ast_rwlock_unlock(&func_lock);
00304    return res;
00305 }

int ast_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 values:
0 on success (or adsi unavailable)
-1 on hangup

Definition at line 65 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::print.

Referenced by cpeid_setstatus().

00066 {
00067    int res = 0;
00068    ast_rwlock_rdlock(&func_lock);
00069    if (installed_funcs && installed_funcs->print) {
00070       res = installed_funcs->print(chan, lines, align, voice);
00071    }
00072    ast_rwlock_unlock(&func_lock);
00073    return res;
00074 }

int ast_adsi_query_cpeid ( unsigned char *  buf  ) 

Build Query CPE ID of equipment. Returns number of bytes added to message

Definition at line 142 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::query_cpeid.

00143 {
00144    int res = 0;
00145    ast_rwlock_rdlock(&func_lock);
00146    if (installed_funcs && installed_funcs->query_cpeid) {
00147       res = installed_funcs->query_cpeid(buf);
00148    }
00149    ast_rwlock_unlock(&func_lock);
00150    return res;
00151 }

int ast_adsi_query_cpeinfo ( unsigned char *  buf  ) 

Definition at line 153 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::query_cpeinfo.

00154 {
00155    int res = 0;
00156    ast_rwlock_rdlock(&func_lock);
00157    if (installed_funcs && installed_funcs->query_cpeinfo) {
00158       res = installed_funcs->query_cpeinfo(buf);
00159    }
00160    ast_rwlock_unlock(&func_lock);
00161    return res;
00162 }

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

Read some encoded DTMF data. Returns number of bytes received

Definition at line 120 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::read_encoded_dtmf.

00121 {
00122    int res = 0;
00123    ast_rwlock_rdlock(&func_lock);
00124    if (installed_funcs && installed_funcs->read_encoded_dtmf) {
00125       res = installed_funcs->read_encoded_dtmf(chan, buf, maxlen);
00126    }
00127    ast_rwlock_unlock(&func_lock);
00128    return res;
00129 }

int ast_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
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 307 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::set_keys.

Referenced by adsi_delete(), adsi_folders(), adsi_login(), adsi_message(), adsi_password(), adsi_status(), and adsi_status2().

00308 {
00309    int res = 0;
00310    ast_rwlock_rdlock(&func_lock);
00311    if (installed_funcs && installed_funcs->set_keys) {
00312       res = installed_funcs->set_keys(buf, keys);
00313    }
00314    ast_rwlock_unlock(&func_lock);
00315    return res;
00316 }

int ast_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)
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 285 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::set_line.

Referenced by adsi_folders(), adsi_goodbye(), adsi_load_vmail(), adsi_login(), adsi_message(), adsi_password(), adsi_prog(), adsi_status(), adsi_status2(), vm_newuser(), vm_options(), and vm_tempgreeting().

00286 {
00287    int res = 0;
00288    ast_rwlock_rdlock(&func_lock);
00289    if (installed_funcs && installed_funcs->set_line) {
00290       res = installed_funcs->set_line(buf, page, line);
00291    }
00292    ast_rwlock_unlock(&func_lock);
00293    return res;
00294 }

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

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

Definition at line 109 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::transmit_message_full.

00110 {
00111    int res = 0;
00112    ast_rwlock_rdlock(&func_lock);
00113    if (installed_funcs && installed_funcs->transmit_message_full) {
00114       res = installed_funcs->transmit_message_full(chan, msg, msglen, msgtype, dowait);
00115    }
00116    ast_rwlock_unlock(&func_lock);
00117    return res;
00118 }

int ast_adsi_unload_session ( struct ast_channel chan  ) 

Definition at line 87 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::unload_session.

Referenced by adsi_prog(), cpeid_exec(), and vm_execmain().

00088 {
00089    int res = 0;
00090    ast_rwlock_rdlock(&func_lock);
00091    if (installed_funcs && installed_funcs->unload_session) {
00092       res = installed_funcs->unload_session(chan);
00093    }
00094    ast_rwlock_unlock(&func_lock);
00095    return res;
00096 }

int ast_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
Return values:
number of bytes added to buffer
-1 on error.

Definition at line 252 of file adsi.c.

References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::voice_mode.

Referenced by adsi_delete(), adsi_folders(), adsi_goodbye(), adsi_load_vmail(), adsi_login(), adsi_message(), adsi_password(), adsi_status(), adsi_status2(), vm_newuser(), vm_options(), and vm_tempgreeting().

00253 {
00254    int res = 0;
00255    ast_rwlock_rdlock(&func_lock);
00256    if (installed_funcs && installed_funcs->voice_mode) {
00257       res = installed_funcs->voice_mode(buf, when);
00258    }
00259    ast_rwlock_unlock(&func_lock);
00260    return res;
00261 }


Generated on Thu Apr 16 06:28:10 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6