Asterisk - The Open Source Telephony Project
18.5.0
|
ADSI Support (built upon Caller*ID) More...
Go to the source code of this file.
Functions | |
int | ast_adsi_available (struct ast_channel *chan) |
Returns non-zero if Channel does or might support ADSI. More... | |
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. More... | |
int | ast_adsi_data_mode (unsigned char *buf) |
Puts CPE in data mode. More... | |
int | ast_adsi_disconnect_session (unsigned char *buf) |
Disconnects a running session. More... | |
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. More... | |
int | ast_adsi_download_connect (unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver) |
Begin an ADSI script download. More... | |
int | ast_adsi_download_disconnect (unsigned char *buf) |
Disconnects (and hopefully saves) a downloaded script. More... | |
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. More... | |
int | ast_adsi_input_format (unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2) |
Set input format. More... | |
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. More... | |
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. More... | |
int | ast_adsi_print (struct ast_channel *chan, char **lines, int *align, int voice) |
Display some stuff on the screen. More... | |
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. More... | |
int | ast_adsi_set_line (unsigned char *buf, int page, int line) |
Sets the current line and page. More... | |
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. More... | |
Variables | |
static const int | current_adsi_version = AST_ADSI_VERSION |
static ast_rwlock_t | func_lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } |
static const struct adsi_funcs * | installed_funcs |
ADSI Support (built upon Caller*ID)
Definition in file adsi.c.
int ast_adsi_available | ( | struct ast_channel * | chan | ) |
Returns non-zero if Channel does or might support ADSI.
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_setup(), vm_options(), and vm_tempgreeting().
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().
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.
chan | Channel to restore |
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.
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.
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.
int ast_adsi_connect_session | ( | unsigned char * | buf, |
unsigned char * | fdn, | ||
int | ver | ||
) |
Connects an ADSI Display Session.
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) |
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.
int ast_adsi_data_mode | ( | unsigned char * | buf | ) |
Puts CPE in data mode.
buf | Character buffer to create parameter in (must have at least 256 free) |
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().
int ast_adsi_disconnect_session | ( | unsigned char * | buf | ) |
Disconnects a running session.
buf | Character buffer to create parameter in (must have at least 256 free) |
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.
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.
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 |
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_setup(), vm_options(), and vm_tempgreeting().
int ast_adsi_download_connect | ( | unsigned char * | buf, |
char * | service, | ||
unsigned char * | fdn, | ||
unsigned char * | sec, | ||
int | ver | ||
) |
Begin an ADSI script download.
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) |
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.
int ast_adsi_download_disconnect | ( | unsigned char * | buf | ) |
Disconnects (and hopefully saves) a downloaded script.
buf | Character buffer to create parameter in (must have at least 256 free) |
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().
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().
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().
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().
int ast_adsi_input_control | ( | unsigned char * | buf, |
int | page, | ||
int | line, | ||
int | display, | ||
int | format, | ||
int | just | ||
) |
Set input information.
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) |
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().
int ast_adsi_input_format | ( | unsigned char * | buf, |
int | num, | ||
int | dir, | ||
int | wrap, | ||
char * | format1, | ||
char * | format2 | ||
) |
Set input format.
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 |
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().
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().
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.
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 |
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().
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.
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 |
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().
int ast_adsi_print | ( | struct ast_channel * | chan, |
char ** | lines, | ||
int * | align, | ||
int | voice | ||
) |
Display some stuff on the screen.
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 |
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().
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.
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.
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.
int ast_adsi_set_keys | ( | unsigned char * | buf, |
unsigned char * | keys | ||
) |
Set which soft keys should be displayed.
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 |
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().
int ast_adsi_set_line | ( | unsigned char * | buf, |
int | page, | ||
int | line | ||
) |
Sets the current line and page.
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) |
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_setup(), vm_options(), and vm_tempgreeting().
int ast_adsi_transmit_message | ( | struct ast_channel * | chan, |
unsigned char * | msg, | ||
int | msglen, | ||
int | msgtype | ||
) |
Definition at line 98 of file adsi.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, func_lock, and adsi_funcs::transmit_message.
Referenced by adsi_delete(), adsi_folders(), adsi_goodbye(), adsi_load_vmail(), adsi_login(), adsi_message(), adsi_password(), adsi_prog(), adsi_status(), adsi_status2(), vm_newuser_setup(), vm_options(), and vm_tempgreeting().
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.
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().
int ast_adsi_voice_mode | ( | unsigned char * | buf, |
int | when | ||
) |
Puts CPE in voice mode.
buf | Character buffer to create parameter in (must have at least 256 free) |
when | (a time in seconds) to make the switch |
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_setup(), vm_options(), and vm_tempgreeting().
|
static |
Definition at line 29 of file adsi.c.
Referenced by ast_adsi_install_funcs().
|
static |
Definition at line 30 of file adsi.c.
Referenced by ast_adsi_available(), ast_adsi_begin_download(), ast_adsi_channel_restore(), ast_adsi_clear_screen(), ast_adsi_clear_soft_keys(), ast_adsi_connect_session(), ast_adsi_data_mode(), ast_adsi_disconnect_session(), ast_adsi_display(), ast_adsi_download_connect(), ast_adsi_download_disconnect(), ast_adsi_end_download(), ast_adsi_get_cpeid(), ast_adsi_get_cpeinfo(), ast_adsi_input_control(), ast_adsi_input_format(), ast_adsi_install_funcs(), ast_adsi_load_session(), ast_adsi_load_soft_key(), ast_adsi_print(), ast_adsi_query_cpeid(), ast_adsi_query_cpeinfo(), ast_adsi_read_encoded_dtmf(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_transmit_message_full(), ast_adsi_unload_session(), and ast_adsi_voice_mode().
|
static |