Codename Pineapple

Home page | Mailing list | Docs

Last updated: Sat Feb 3 05:00:59 2007

Asterisk developer's documentation :: Codename Pineapple


adsi.h File Reference


Detailed Description

ADSI Support (built upon Caller*ID).

Definition in file adsi.h.

#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.

Defines

#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

Functions

int ast_adsi_available (struct ast_channel *chan)
int ast_adsi_begin_download (struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
int ast_adsi_channel_init (struct ast_channel *chan)
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)
int ast_adsi_data_mode (unsigned char *buf)
int ast_adsi_disconnect_session (unsigned char *buf)
int ast_adsi_display (unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2)
int ast_adsi_download_connect (unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver)
int ast_adsi_download_disconnect (unsigned char *buf)
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)
int ast_adsi_input_format (unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
int ast_adsi_load_session (struct ast_channel *chan, unsigned char *app, int ver, int data)
int ast_adsi_load_soft_key (unsigned char *buf, int key, const char *llabel, const char *slabel, const char *ret, int data)
int ast_adsi_print (struct ast_channel *chan, char **lines, int *align, int voice)
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)
int ast_adsi_set_line (unsigned char *buf, int page, int line)
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_transmit_messages (struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype)
int ast_adsi_unload_session (struct ast_channel *chan)
int ast_adsi_voice_mode (unsigned char *buf, int when)


Define Documentation

#define ADSI_BACKSPACE   0x89
 

Definition at line 75 of file adsi.h.

#define ADSI_BLANK   0x86
 

Definition at line 72 of file adsi.h.

#define ADSI_CLEAR_CALL_B   0x95
 

Definition at line 87 of file adsi.h.

#define ADSI_CLEAR_CALL_BUF   145
 

Definition at line 50 of file adsi.h.

#define ADSI_CLEAR_CHARS   0x88
 

Definition at line 74 of file adsi.h.

#define ADSI_CLEAR_SCREEN   148
 

Definition at line 53 of file adsi.h.

Referenced by ast_adsi_clear_screen().

#define ADSI_CLEAR_SOFTKEY   136
 

Definition at line 41 of file adsi.h.

Referenced by ast_adsi_clear_soft_keys().

#define ADSI_CLEAR_TYPE_AHEAD   143
 

Definition at line 48 of file adsi.h.

#define ADSI_COMM_PAGE   0x1
 

Definition at line 104 of file adsi.h.

#define ADSI_CONNECT_SESSION   142
 

Definition at line 47 of file adsi.h.

Referenced by ast_adsi_connect_session().

#define ADSI_DELAY   0x90
 

Definition at line 82 of file adsi.h.

#define ADSI_DIAL_PULSE_ONE   0x91
 

Definition at line 83 of file adsi.h.

#define ADSI_DIAL_TONE_DETECT   0x84
 

Definition at line 70 of file adsi.h.

#define ADSI_DIR_FROM_LEFT   (0)
 

Definition at line 117 of file adsi.h.

#define ADSI_DIR_FROM_RIGHT   (1)
 

Definition at line 118 of file adsi.h.

#define ADSI_DISC_SESSION   133
 

Definition at line 38 of file adsi.h.

Referenced by ast_adsi_disconnect_session().

#define ADSI_DISP_CALL_BUF   0x94
 

Definition at line 86 of file adsi.h.

#define ADSI_DISPLAY_CALL_BUF   144
 

Definition at line 49 of file adsi.h.

#define ADSI_DOWNLOAD_CONNECT   131
 

Definition at line 62 of file adsi.h.

Referenced by ast_adsi_download_connect().

#define ADSI_DOWNLOAD_DISC   132
 

Definition at line 63 of file adsi.h.

Referenced by ast_adsi_download_disconnect().

#define ADSI_ENCODED_DTMF   0x80
 

Definition at line 66 of file adsi.h.

#define ADSI_EXTENDED_DTMF   0x8F
 

Definition at line 81 of file adsi.h.

#define ADSI_FLASH   0x83
 

Definition at line 69 of file adsi.h.

#define ADSI_GOTO_LINE   0x8B
 

Definition at line 77 of file adsi.h.

#define ADSI_GOTO_LINE_REL   0x8C
 

Definition at line 78 of file adsi.h.

#define ADSI_INFO_PAGE   0x0
 

Definition at line 103 of file adsi.h.

Referenced by ast_adsi_channel_restore(), and ast_adsi_print().

#define ADSI_INFORMATION   132
 

Definition at line 37 of file adsi.h.

#define ADSI_INIT_SOFTKEY_LINE   129
 

Definition at line 34 of file adsi.h.

Referenced by ast_adsi_set_keys().

#define ADSI_INPUT_CONTROL   137
 

Definition at line 42 of file adsi.h.

Referenced by ast_adsi_input_control().

#define ADSI_INPUT_FORMAT   138
 

Definition at line 43 of file adsi.h.

Referenced by ast_adsi_input_format().

#define ADSI_JUST_CENT   0x0
 

Definition at line 111 of file adsi.h.

Referenced by adsi_announce_park(), init_state(), and str2align().

#define ADSI_JUST_IND   0x3
 

Definition at line 112 of file adsi.h.

Referenced by str2align().

#define ADSI_JUST_LEFT   0x2
 

Definition at line 109 of file adsi.h.

Referenced by str2align().

#define ADSI_JUST_RIGHT   0x1
 

Definition at line 110 of file adsi.h.

Referenced by str2align().

#define ADSI_KEY_APPS   16
 

Definition at line 106 of file adsi.h.

#define ADSI_KEY_HILITE   0x40
 

Definition at line 115 of file adsi.h.

#define ADSI_KEY_SKT   0x80
 

Definition at line 114 of file adsi.h.

#define ADSI_LINE_CONTROL   131
 

Definition at line 36 of file adsi.h.

Referenced by ast_adsi_set_line().

#define ADSI_LINE_NUMBER   0x85
 

Definition at line 71 of file adsi.h.

#define ADSI_LOAD_DEFAULT   141
 

Definition at line 46 of file adsi.h.

#define ADSI_LOAD_PREDEF_DISP   129
 

Definition at line 60 of file adsi.h.

#define ADSI_LOAD_SCRIPT   130
 

Definition at line 61 of file adsi.h.

#define ADSI_LOAD_SOFTKEY   128
 

Definition at line 33 of file adsi.h.

Referenced by ast_adsi_load_soft_key().

#define ADSI_LOAD_SOFTKEY_TABLE   128
 

Definition at line 59 of file adsi.h.

#define ADSI_LOAD_VIRTUAL_DISP   130
 

Definition at line 35 of file adsi.h.

Referenced by ast_adsi_display().

#define ADSI_MOVE_DATA   140
 

Definition at line 45 of file adsi.h.

#define ADSI_MSG_DISPLAY   132
 

Definition at line 29 of file adsi.h.

Referenced by ast_adsi_get_cpeid(), ast_adsi_get_cpeinfo(), ast_adsi_load_session(), ast_adsi_print(), and ast_adsi_unload_session().

#define ADSI_MSG_DOWNLOAD   133
 

Definition at line 30 of file adsi.h.

Referenced by ast_adsi_begin_download(), and ast_adsi_end_download().

#define ADSI_OFF_HOOK   0x82
 

Definition at line 68 of file adsi.h.

#define ADSI_ON_HOOK   0x81
 

Definition at line 67 of file adsi.h.

#define ADSI_PAGE_DOWN   0x8E
 

Definition at line 80 of file adsi.h.

#define ADSI_PAGE_UP   0x8D
 

Definition at line 79 of file adsi.h.

#define ADSI_QUERY_CONFIG   149
 

Definition at line 54 of file adsi.h.

Referenced by ast_adsi_query_cpeinfo().

#define ADSI_QUERY_CPEID   150
 

Definition at line 55 of file adsi.h.

Referenced by ast_adsi_query_cpeid().

#define ADSI_SEND_CHARS   0x87
 

Definition at line 73 of file adsi.h.

#define ADSI_SWITCH_TO_ALT   146
 

Definition at line 51 of file adsi.h.

#define ADSI_SWITCH_TO_APP   151
 

Definition at line 56 of file adsi.h.

#define ADSI_SWITCH_TO_DATA   134
 

Definition at line 39 of file adsi.h.

Referenced by ast_adsi_data_mode(), and ast_adsi_transmit_message_full().

#define ADSI_SWITCH_TO_DATA2   0x92
 

Definition at line 84 of file adsi.h.

Referenced by ast_adsi_load_soft_key().

#define ADSI_SWITCH_TO_GRAPHICS   147
 

Definition at line 52 of file adsi.h.

#define ADSI_SWITCH_TO_PERIPH   139
 

Definition at line 44 of file adsi.h.

#define ADSI_SWITCH_TO_VOICE   135
 

Definition at line 40 of file adsi.h.

Referenced by ast_adsi_transmit_message_full(), and ast_adsi_voice_mode().

#define ADSI_SWITCH_TO_VOICE2   0x93
 

Definition at line 85 of file adsi.h.

#define ADSI_TAB_COLUMN   0x8A
 

Definition at line 76 of file adsi.h.


Function Documentation

int ast_adsi_available struct ast_channel chan  ) 
 

Parameters:
chan Channel to check

Definition at line 787 of file res_adsi.c.

References ast_channel::adsicpe, AST_ADSI_AVAILABLE, and AST_ADSI_UNKNOWN.

00788 {
00789    int cpe = chan->adsicpe & 0xff;
00790    if ((cpe == AST_ADSI_AVAILABLE) ||
00791        (cpe == AST_ADSI_UNKNOWN))
00792       return 1;
00793    return 0;
00794 }

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

Definition at line 336 of file res_adsi.c.

References ADSI_MSG_DOWNLOAD, ast_adsi_download_connect(), ast_adsi_transmit_message_full(), ast_log(), ast_readstring(), and option_debug.

00337 {
00338    int bytes;
00339    unsigned char buf[256];
00340    char ack[2];
00341    bytes = 0;
00342    /* Setup the resident soft key stuff, a piece at a time */
00343    /* Upload what scripts we can for voicemail ahead of time */
00344    bytes += ast_adsi_download_connect(buf + bytes, service, fdn, sec, version);
00345    if (ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
00346       return -1;
00347    if (ast_readstring(chan, ack, 1, 10000, 10000, ""))
00348       return -1;
00349    if (ack[0] == 'B')
00350       return 0;
00351    if (option_debug)
00352       ast_log(LOG_DEBUG, "Download was denied by CPE\n");
00353    return -1;
00354 }

int ast_adsi_channel_init struct ast_channel chan  ) 
 

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

int ast_adsi_channel_restore struct ast_channel chan  ) 
 

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

Definition at line 945 of file res_adsi.c.

References ADSI_INFO_PAGE, ADSI_SPEED_DIAL, ast_adsi_set_keys(), and ast_adsi_set_line().

00946 {
00947    unsigned char dsp[256];
00948    int bytes;
00949    int x;
00950    unsigned char keyd[6];
00951 
00952    memset(dsp, 0, sizeof(dsp));
00953 
00954    /* Start with initial display setup */
00955    bytes = 0;
00956    bytes += ast_adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);
00957 
00958    /* Prepare key setup messages */
00959 
00960    if (speeds) {
00961       memset(keyd, 0, sizeof(keyd));
00962       for (x=0;x<speeds;x++) {
00963          keyd[x] = ADSI_SPEED_DIAL + x;
00964       }
00965       bytes += ast_adsi_set_keys(dsp + bytes, keyd);
00966    }
00967    ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0);
00968    return 0;
00969 
00970 }

int ast_adsi_clear_screen unsigned char *  buf  ) 
 

Definition at line 755 of file res_adsi.c.

References ADSI_CLEAR_SCREEN.

00756 {
00757    int bytes=0;
00758 
00759    /* Message type */
00760    buf[bytes++] = ADSI_CLEAR_SCREEN;
00761 
00762    /* Reserve space for length */
00763    bytes++;
00764 
00765    buf[1] = bytes - 2;
00766    return bytes;
00767 
00768 }

int ast_adsi_clear_soft_keys unsigned char *  buf  ) 
 

Definition at line 740 of file res_adsi.c.

References ADSI_CLEAR_SOFTKEY.

00741 {
00742    int bytes=0;
00743 
00744    /* Message type */
00745    buf[bytes++] = ADSI_CLEAR_SOFTKEY;
00746 
00747    /* Reserve space for length */
00748    bytes++;
00749 
00750    buf[1] = bytes - 2;
00751    return bytes;
00752 
00753 }

int ast_adsi_connect_session unsigned char *  buf,
unsigned char *  fdn,
int  ver
 

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.

Definition at line 505 of file res_adsi.c.

References ADSI_CONNECT_SESSION.

Referenced by ast_adsi_load_session().

00506 {
00507    int bytes=0;
00508    int x;
00509 
00510    /* Message type */
00511    buf[bytes++] = ADSI_CONNECT_SESSION;
00512 
00513    /* Reserve space for length */
00514    bytes++;
00515 
00516    if (fdn) {
00517       for (x=0;x<4;x++)
00518          buf[bytes++] = fdn[x];
00519       if (ver > -1)
00520          buf[bytes++] = ver & 0xff;
00521    }
00522 
00523    buf[1] = bytes - 2;
00524    return bytes;
00525 
00526 }

int ast_adsi_data_mode unsigned char *  buf  ) 
 

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.

Definition at line 725 of file res_adsi.c.

References ADSI_SWITCH_TO_DATA.

Referenced by ast_adsi_get_cpeid(), ast_adsi_get_cpeinfo(), and ast_adsi_load_session().

00726 {
00727    int bytes=0;
00728 
00729    /* Message type */
00730    buf[bytes++] = ADSI_SWITCH_TO_DATA;
00731 
00732    /* Reserve space for length */
00733    bytes++;
00734 
00735    buf[1] = bytes - 2;
00736    return bytes;
00737 
00738 }

int ast_adsi_disconnect_session unsigned char *  buf  ) 
 

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.

Definition at line 558 of file res_adsi.c.

References ADSI_DISC_SESSION.

Referenced by ast_adsi_unload_session().

00559 {
00560    int bytes=0;
00561 
00562    /* Message type */
00563    buf[bytes++] = ADSI_DISC_SESSION;
00564 
00565    /* Reserve space for length */
00566    bytes++;
00567 
00568    buf[1] = bytes - 2;
00569    return bytes;
00570 
00571 }

int ast_adsi_display unsigned char *  buf,
int  page,
int  line,
int  just,
int  wrap,
char *  col1,
char *  col2
 

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.

Definition at line 811 of file res_adsi.c.

References ADSI_LOAD_VIRTUAL_DISP, and ccopy().

Referenced by ast_adsi_print().

00813 {
00814    int bytes=0;
00815 
00816    /* Sanity check line number */
00817 
00818    if (page) {
00819       if (line > 4) return -1;
00820    } else {
00821       if (line > 33) return -1;
00822    }
00823 
00824    if (line < 1)
00825       return -1;
00826    /* Parameter type */
00827    buf[bytes++] = ADSI_LOAD_VIRTUAL_DISP;
00828    
00829    /* Reserve space for size */
00830    bytes++;
00831 
00832    /* Page and wrap indicator */
00833    buf[bytes++] = ((page & 0x1) << 7) | ((wrap & 0x1) << 6) | (line & 0x3f);
00834 
00835    /* Justification */
00836    buf[bytes++] = (just & 0x3) << 5;
00837 
00838    /* Omit highlight mode definition */
00839    buf[bytes++] = 0xff;
00840 
00841    /* Primary column */
00842    bytes+= ccopy(buf + bytes, (unsigned char *)col1, 20);
00843 
00844    /* Delimiter */
00845    buf[bytes++] = 0xff;
00846    
00847    /* Secondary column */
00848    bytes += ccopy(buf + bytes, (unsigned char *)col2, 20);
00849 
00850    /* Update length */
00851    buf[1] = bytes - 2;
00852    
00853    return bytes;
00854 
00855 }

int ast_adsi_download_connect unsigned char *  buf,
char *  service,
unsigned char *  fdn,
unsigned char *  sec,
int  ver
 

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.

Definition at line 528 of file res_adsi.c.

References ADSI_DOWNLOAD_CONNECT, and ccopy().

Referenced by ast_adsi_begin_download().

00529 {
00530    int bytes=0;
00531    int x;
00532 
00533    /* Message type */
00534    buf[bytes++] = ADSI_DOWNLOAD_CONNECT;
00535 
00536    /* Reserve space for length */
00537    bytes++;
00538 
00539    /* Primary column */
00540    bytes+= ccopy(buf + bytes, (unsigned char *)service, 18);
00541 
00542    /* Delimiter */
00543    buf[bytes++] = 0xff;
00544    
00545    for (x=0;x<4;x++) {
00546       buf[bytes++] = fdn[x];
00547    }
00548    for (x=0;x<4;x++)
00549       buf[bytes++] = sec[x];
00550    buf[bytes++] = ver & 0xff;
00551 
00552    buf[1] = bytes - 2;
00553 
00554    return bytes;
00555 
00556 }

int ast_adsi_download_disconnect unsigned char *  buf  ) 
 

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.

Definition at line 796 of file res_adsi.c.

References ADSI_DOWNLOAD_DISC.

Referenced by ast_adsi_end_download().

00797 {
00798    int bytes=0;
00799 
00800    /* Message type */
00801    buf[bytes++] = ADSI_DOWNLOAD_DISC;
00802 
00803    /* Reserve space for length */
00804    bytes++;
00805 
00806    buf[1] = bytes - 2;
00807    return bytes;
00808 
00809 }

int ast_adsi_end_download struct ast_channel chan  ) 
 

Definition at line 356 of file res_adsi.c.

References ADSI_MSG_DOWNLOAD, ast_adsi_download_disconnect(), and ast_adsi_transmit_message_full().

00357 {
00358    int bytes;
00359    unsigned char buf[256];
00360         bytes = 0;
00361         /* Setup the resident soft key stuff, a piece at a time */
00362         /* Upload what scripts we can for voicemail ahead of time */
00363         bytes += ast_adsi_download_disconnect(buf + bytes);
00364    if (ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
00365       return -1;
00366    return 0;
00367 }

int ast_adsi_get_cpeid struct ast_channel chan,
unsigned char *  cpeid,
int  voice
 

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 628 of file res_adsi.c.

References ADSI_MSG_DISPLAY, ast_adsi_data_mode(), ast_adsi_query_cpeid(), ast_adsi_read_encoded_dtmf(), ast_adsi_transmit_message_full(), ast_adsi_voice_mode(), ast_log(), ast_waitfordigit(), and LOG_WARNING.

00629 {
00630    unsigned char buf[256];
00631    int bytes = 0;
00632    int res;
00633    bytes += ast_adsi_data_mode(buf);
00634    ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
00635 
00636    bytes = 0;
00637    bytes += ast_adsi_query_cpeid(buf);
00638    ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
00639 
00640    /* Get response */
00641    memset(buf, 0, sizeof(buf));
00642    res = ast_adsi_read_encoded_dtmf(chan, cpeid, 4);
00643    if (res != 4) {
00644       ast_log(LOG_WARNING, "Got %d bytes back of encoded DTMF, expecting 4\n", res);
00645       res = 0;
00646    } else {
00647       res = 1;
00648    }
00649 
00650    if (voice) {
00651       bytes = 0;
00652       bytes += ast_adsi_voice_mode(buf, 0);
00653       ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
00654       /* Ignore the resulting DTMF B announcing it's in voice mode */
00655       ast_waitfordigit(chan, 1000);
00656    }
00657    return res;
00658 }

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

Definition at line 660 of file res_adsi.c.

References ADSI_MSG_DISPLAY, ast_adsi_data_mode(), ast_adsi_query_cpeinfo(), ast_adsi_transmit_message_full(), ast_adsi_voice_mode(), ast_log(), ast_readstring(), ast_waitfordigit(), and LOG_WARNING.

00661 {
00662    unsigned char buf[256];
00663    int bytes = 0;
00664    int res;
00665    bytes += ast_adsi_data_mode(buf);
00666    ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
00667 
00668    bytes = 0;
00669    bytes +=