static int adsi_logo(unsigned char *buf)
{
int bytes = 0;
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_CENT, 0, "Comedian Mail", "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_CENT, 0, "(C)2002 LSS, Inc.", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_CENT, 0, "Comedian Mail", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_CENT, 0, "(C)2002 LSS, Inc.", "");
return bytes;
}
char num[5];
*useadsi = 0;
- bytes += adsi_data_mode(buf + bytes);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_data_mode(buf + bytes);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
bytes = 0;
bytes += adsi_logo(buf);
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Downloading Scripts", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Downloading Scripts", "");
#ifdef DISPLAY
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " .", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " .", "");
#endif
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_data_mode(buf + bytes);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_data_mode(buf + bytes);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
- if (adsi_begin_download(chan, addesc, adsifdn, adsisec, adsiver)) {
+ if (ast_adsi_begin_download(chan, addesc, adsifdn, adsisec, adsiver)) {
bytes = 0;
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Load Cancelled.", "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "ADSI Unavailable", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Load Cancelled.", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "ADSI Unavailable", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
return 0;
}
#ifdef DISPLAY
/* Add a dot */
bytes = 0;
- bytes += adsi_logo(buf);
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Downloading Scripts", "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " ..", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_logo(buf);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Downloading Scripts", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " ..", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
#endif
bytes = 0;
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 0, "Listen", "Listen", "1", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 1, "Folder", "Folder", "2", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 2, "Advanced", "Advnced", "3", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 3, "Options", "Options", "0", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 4, "Help", "Help", "*", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 5, "Exit", "Exit", "#", 1);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 0, "Listen", "Listen", "1", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 1, "Folder", "Folder", "2", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 2, "Advanced", "Advnced", "3", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 3, "Options", "Options", "0", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 4, "Help", "Help", "*", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 5, "Exit", "Exit", "#", 1);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD);
#ifdef DISPLAY
/* Add another dot */
bytes = 0;
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " ...", "");
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " ...", "");
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
#endif
bytes = 0;
/* These buttons we load but don't use yet */
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 6, "Previous", "Prev", "4", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 8, "Repeat", "Repeat", "5", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 7, "Delete", "Delete", "7", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 9, "Next", "Next", "6", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 10, "Save", "Save", "9", 1);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 11, "Undelete", "Restore", "7", 1);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 6, "Previous", "Prev", "4", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 8, "Repeat", "Repeat", "5", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 7, "Delete", "Delete", "7", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 9, "Next", "Next", "6", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 10, "Save", "Save", "9", 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 11, "Undelete", "Restore", "7", 1);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD);
#ifdef DISPLAY
/* Add another dot */
bytes = 0;
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " ....", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " ....", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
#endif
bytes = 0;
for (x=0;x<5;x++) {
snprintf(num, sizeof(num), "%d", x);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 12 + x, mbox(x), mbox(x), num, 1);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 12 + x, mbox(x), mbox(x), num, 1);
}
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 12 + 5, "Cancel", "Cancel", "#", 1);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 12 + 5, "Cancel", "Cancel", "#", 1);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD);
#ifdef DISPLAY
/* Add another dot */
bytes = 0;
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " .....", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, " .....", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
#endif
- if (adsi_end_download(chan)) {
+ if (ast_adsi_end_download(chan)) {
bytes = 0;
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Download Unsuccessful.", "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "ADSI Unavailable", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Download Unsuccessful.", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "ADSI Unavailable", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
return 0;
}
bytes = 0;
- bytes += adsi_download_disconnect(buf + bytes);
- bytes += adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD);
+ bytes += ast_adsi_download_disconnect(buf + bytes);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD);
ast_log(LOG_DEBUG, "Done downloading scripts...\n");
#ifdef DISPLAY
/* Add last dot */
bytes = 0;
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, " ......", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, " ......", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
#endif
ast_log(LOG_DEBUG, "Restarting session...\n");
bytes = 0;
/* Load the session now */
- if (adsi_load_session(chan, adsifdn, adsiver, 1) == 1) {
+ if (ast_adsi_load_session(chan, adsifdn, adsiver, 1) == 1) {
*useadsi = 1;
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Scripts Loaded!", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Scripts Loaded!", "");
} else
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Load Failed!", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Load Failed!", "");
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
return 0;
}
static void adsi_begin(struct ast_channel *chan, int *useadsi)
{
int x;
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
- x = adsi_load_session(chan, adsifdn, adsiver, 1);
+ x = ast_adsi_load_session(chan, adsifdn, adsiver, 1);
if (x < 0)
return;
if (!x) {
int bytes=0;
unsigned char keys[8];
int x;
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
for (x=0;x<8;x++)
keys[3] = ADSI_KEY_APPS + 3;
bytes += adsi_logo(buf + bytes);
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, " ", "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, " ", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_input_format(buf + bytes, 1, ADSI_DIR_FROM_LEFT, 0, "Mailbox: ******", "");
- bytes += adsi_input_control(buf + bytes, ADSI_COMM_PAGE, 4, 1, 1, ADSI_JUST_LEFT);
- bytes += adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 3, "Enter", "Enter", "#", 1);
- bytes += adsi_set_keys(buf + bytes, keys);
- bytes += adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, " ", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, " ", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_input_format(buf + bytes, 1, ADSI_DIR_FROM_LEFT, 0, "Mailbox: ******", "");
+ bytes += ast_adsi_input_control(buf + bytes, ADSI_COMM_PAGE, 4, 1, 1, ADSI_JUST_LEFT);
+ bytes += ast_adsi_load_soft_key(buf + bytes, ADSI_KEY_APPS + 3, "Enter", "Enter", "#", 1);
+ bytes += ast_adsi_set_keys(buf + bytes, keys);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
static void adsi_password(struct ast_channel *chan)
int bytes=0;
unsigned char keys[8];
int x;
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
for (x=0;x<8;x++)
/* Set one key for next */
keys[3] = ADSI_KEY_APPS + 3;
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_input_format(buf + bytes, 1, ADSI_DIR_FROM_LEFT, 0, "Password: ******", "");
- bytes += adsi_input_control(buf + bytes, ADSI_COMM_PAGE, 4, 0, 1, ADSI_JUST_LEFT);
- bytes += adsi_set_keys(buf + bytes, keys);
- bytes += adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_input_format(buf + bytes, 1, ADSI_DIR_FROM_LEFT, 0, "Password: ******", "");
+ bytes += ast_adsi_input_control(buf + bytes, ADSI_COMM_PAGE, 4, 0, 1, ADSI_JUST_LEFT);
+ bytes += ast_adsi_set_keys(buf + bytes, keys);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
static void adsi_folders(struct ast_channel *chan, int start, char *label)
unsigned char keys[8];
int x,y;
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
for (x=0;x<5;x++) {
keys[6] = 0;
keys[7] = 0;
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_CENT, 0, label, "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_CENT, 0, " ", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_set_keys(buf + bytes, keys);
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_CENT, 0, label, "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_CENT, 0, " ", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_set_keys(buf + bytes, keys);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
static void adsi_message(struct ast_channel *chan, struct vm_state *vms)
int x;
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
/* Retrieve important info */
if (vms->curmsg) {
/* but not only message, provide "Folder" instead */
keys[3] = ADSI_KEY_SKT | (ADSI_KEY_APPS + 1);
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
} else {
/* Otherwise if only message, leave blank */
strcasecmp(vms->curbox, "INBOX") ? " Messages" : "");
snprintf(buf2, sizeof(buf2), "Message %d of %d", vms->curmsg + 1, vms->lastmsg + 1);
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_LEFT, 0, buf1, "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_LEFT, 0, buf2, "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_LEFT, 0, name, "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, datetime, "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_set_keys(buf + bytes, keys);
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_LEFT, 0, buf1, "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_LEFT, 0, buf2, "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_LEFT, 0, name, "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_LEFT, 0, datetime, "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_set_keys(buf + bytes, keys);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
static void adsi_delete(struct ast_channel *chan, struct vm_state *vms)
int x;
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
/* New meaning for keys */
/* Except "Exit" */
keys[5] = ADSI_KEY_SKT | (ADSI_KEY_APPS + 5);
- bytes += adsi_set_keys(buf + bytes, keys);
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_set_keys(buf + bytes, keys);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
static void adsi_status(struct ast_channel *chan, struct vm_state *vms)
char *newm = (vms->newmessages == 1) ? "message" : "messages";
char *oldm = (vms->oldmessages == 1) ? "message" : "messages";
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
if (vms->newmessages) {
snprintf(buf1, sizeof(buf1), "You have %d new", vms->newmessages);
buf2[0] = ' ';
buf2[1] = '\0';
}
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_LEFT, 0, buf1, "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_LEFT, 0, buf2, "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_LEFT, 0, buf1, "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_LEFT, 0, buf2, "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
for (x=0;x<6;x++)
keys[x] = ADSI_KEY_SKT | (ADSI_KEY_APPS + x);
/* Don't let them listen if there are none */
if (vms->lastmsg < 0)
keys[0] = 1;
- bytes += adsi_set_keys(buf + bytes, keys);
+ bytes += ast_adsi_set_keys(buf + bytes, keys);
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
static void adsi_status2(struct ast_channel *chan, struct vm_state *vms)
char *mess = (vms->lastmsg == 0) ? "message" : "messages";
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
/* Original command keys */
snprintf(buf2, sizeof(buf2), "%d %s.", vms->lastmsg + 1, mess);
else
strcpy(buf2, "no messages.");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_LEFT, 0, buf1, "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_LEFT, 0, buf2, "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_LEFT, 0, "", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_set_keys(buf + bytes, keys);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 1, ADSI_JUST_LEFT, 0, buf1, "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 2, ADSI_JUST_LEFT, 0, buf2, "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_LEFT, 0, "", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_set_keys(buf + bytes, keys);
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
{
char buf[256];
int bytes=0;
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
*/
unsigned char buf[256];
int bytes=0;
- if (!adsi_available(chan))
+ if (!ast_adsi_available(chan))
return;
bytes += adsi_logo(buf + bytes);
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_LEFT, 0, " ", "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Goodbye", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_LEFT, 0, " ", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Goodbye", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
/*--- get_folder: Folder menu ---*/
unsigned char buf[256];
int bytes=0;
- if (adsi_available(chan)) {
+ if (ast_adsi_available(chan)) {
bytes += adsi_logo(buf + bytes);
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "New User Setup", "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Not Done", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "New User Setup", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Not Done", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
/* First, have the user change their password
unsigned char buf[256];
int bytes=0;
- if (adsi_available(chan))
+ if (ast_adsi_available(chan))
{
bytes += adsi_logo(buf + bytes);
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Options Menu", "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Not Done", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Options Menu", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Not Done", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
while ((cmd >= 0) && (cmd != 't')) {
if (cmd)
unsigned char buf[256];
int bytes=0;
- if (adsi_available(chan)) {
+ if (ast_adsi_available(chan)) {
bytes += adsi_logo(buf + bytes);
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Temp Greeting Menu", "");
- bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Not Done", "");
- bytes += adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
- bytes += adsi_voice_mode(buf + bytes, 0);
- adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Temp Greeting Menu", "");
+ bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Not Done", "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_COMM_PAGE, 1);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
+ ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
}
snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vms->username);
while (cmd >= 0 && cmd != 't') {
res = 0;
}
if (useadsi)
- adsi_unload_session(chan);
+ ast_adsi_unload_session(chan);
}
if (vmu)
close_mailbox(&vms, vmu);
* Returns 0 on success (or adsi unavailable) and -1 on hangup
*
*/
-int adsi_channel_init(struct ast_channel *chan);
+int ast_adsi_channel_init(struct ast_channel *chan);
-int adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version);
+int ast_adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version);
-int adsi_end_download(struct ast_channel *chan);
+int ast_adsi_end_download(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 adsi_channel_init again instead. */
+/* have to use the ast_adsi_channel_init again instead. */
/*!
* \param chan Channel to restore
*
* Returns 0 on success (or adsi unavailable) and -1 on hangup
*
*/
-int adsi_channel_restore(struct ast_channel *chan);
+int ast_adsi_channel_restore(struct ast_channel *chan);
/*! Display some stuff on the screen */
/*!
* Return 0 on success (or adsi unavailable) and -1 on hangup
*
*/
-int adsi_print(struct ast_channel *chan, char **lines, int *align, int voice);
+int ast_adsi_print(struct ast_channel *chan, char **lines, int *align, int voice);
/*! 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. */
* 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_session(struct ast_channel *chan, unsigned char *app, int ver, int data);
-int adsi_unload_session(struct ast_channel *chan);
+int ast_adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data);
+int ast_adsi_unload_session(struct ast_channel *chan);
/* ADSI Layer 2 transmission functions */
-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 ast_adsi_transmit_messages(struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype);
+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);
/*! Read some encoded DTMF data. */
/*!
* Returns number of bytes received
*/
-int adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen);
+int ast_adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen);
/* ADSI Layer 3 creation functions */
*
*/
-int adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver);
+int ast_adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver);
/*! Build Query CPE ID of equipment */
/*!
* Returns number of bytes added to message
*/
-int adsi_query_cpeid(unsigned char *buf);
-int adsi_query_cpeinfo(unsigned char *buf);
+int ast_adsi_query_cpeid(unsigned char *buf);
+int ast_adsi_query_cpeinfo(unsigned char *buf);
/*! Get CPE ID from an attached ADSI compatible CPE. */
/*!
* 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_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice);
+int ast_adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice);
-int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice);
+int ast_adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice);
/*! Begin an ADSI script download */
/*!
*
*/
-int adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
+int ast_adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
/*! Disconnects a running session */
/*!
* Returns number of bytes added to buffer or -1 on error.
*
*/
-int adsi_disconnect_session(unsigned char *buf);
+int ast_adsi_disconnect_session(unsigned char *buf);
/*! Disconnects (and hopefully saves) a downloaded script */
/*!
* Returns number of bytes added to buffer or -1 on error.
*
*/
-int adsi_download_disconnect(unsigned char *buf);
+int ast_adsi_download_disconnect(unsigned char *buf);
/*! Puts CPE in data mode... */
/*!
* Returns number of bytes added to buffer or -1 on error.
*
*/
-int adsi_data_mode(unsigned char *buf);
-int adsi_clear_soft_keys(unsigned char *buf);
-int adsi_clear_screen(unsigned char *buf);
+int ast_adsi_data_mode(unsigned char *buf);
+int ast_adsi_clear_soft_keys(unsigned char *buf);
+int ast_adsi_clear_screen(unsigned char *buf);
/*! Puts CPE in voice mode... */
/*!
* Returns number of bytes added to buffer or -1 on error.
*
*/
-int adsi_voice_mode(unsigned char *buf, int when);
+int ast_adsi_voice_mode(unsigned char *buf, int when);
/*! Returns non-zero if Channel does or might support ADSI */
/*!
* \param chan Channel to check
*
*/
-int adsi_available(struct ast_channel *chan);
+int ast_adsi_available(struct ast_channel *chan);
/*! Loads a line of info into the display */
/*!
*
*/
-int adsi_display(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
+int ast_adsi_display(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
/*! Sets the current line and page */
/*!
*
*/
-int adsi_set_line(unsigned char *buf, int page, int line);
+int ast_adsi_set_line(unsigned char *buf, int page, int line);
/*! Creates "load soft key" parameters */
/*!
* Returns number of bytes added to buffer or -1 on error.
*
*/
-int adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const char *slabel, const char *ret, int data);
+int ast_adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const char *slabel, const char *ret, int data);
/*! Set which soft keys should be displayed */
/*!
* Returns number of bytes added to buffer or -1 on error.
*
*/
-int adsi_set_keys(unsigned char *buf, unsigned char *keys);
+int ast_adsi_set_keys(unsigned char *buf, unsigned char *keys);
/*! Set input information */
/*!
* Returns number of bytes added to buffer or -1 on error.
*
*/
-int adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just);
+int ast_adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just);
/*! Set input format */
/*!
* Returns number of bytes added to buffer or -1 on error.
*
*/
-int adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2);
+int ast_adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2);
#endif /* _ASTERISK_ADSI_H */
}
-int adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
+int ast_adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
{
int bytes;
unsigned char buf[256];
bytes = 0;
/* Setup the resident soft key stuff, a piece at a time */
/* Upload what scripts we can for voicemail ahead of time */
- bytes += adsi_download_connect(buf + bytes, service, fdn, sec, version);
- if (adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
+ bytes += ast_adsi_download_connect(buf + bytes, service, fdn, sec, version);
+ if (ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
return -1;
if (ast_readstring(chan, ack, 1, 10000, 10000, ""))
return -1;
return -1;
}
-int adsi_end_download(struct ast_channel *chan)
+int ast_adsi_end_download(struct ast_channel *chan)
{
int bytes;
unsigned char buf[256];
bytes = 0;
/* Setup the resident soft key stuff, a piece at a time */
/* Upload what scripts we can for voicemail ahead of time */
- bytes += adsi_download_disconnect(buf + bytes);
- if (adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
+ bytes += ast_adsi_download_disconnect(buf + bytes);
+ if (ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
return -1;
return 0;
}
-int adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
+int ast_adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
{
unsigned char *msgs[5] = { NULL, NULL, NULL, NULL, NULL };
int msglens[5];
return res;
}
-int adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
+int ast_adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
{
- return adsi_transmit_message_full(chan, msg, msglen, msgtype, 1);
+ return ast_adsi_transmit_message_full(chan, msg, msglen, msgtype, 1);
}
static inline int ccopy(unsigned char *dst, const unsigned char *src, int max)
return x;
}
-int adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const char *slabel, const char *ret, 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 bytes=0;
}
-int adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
+int ast_adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
{
int bytes=0;
int x;
}
-int adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver)
+int ast_adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver)
{
int bytes=0;
int x;
}
-int adsi_disconnect_session(unsigned char *buf)
+int ast_adsi_disconnect_session(unsigned char *buf)
{
int bytes=0;
}
-int adsi_query_cpeid(unsigned char *buf)
+int ast_adsi_query_cpeid(unsigned char *buf)
{
int bytes = 0;
buf[bytes++] = ADSI_QUERY_CPEID;
return bytes;
}
-int adsi_query_cpeinfo(unsigned char *buf)
+int ast_adsi_query_cpeinfo(unsigned char *buf)
{
int bytes = 0;
buf[bytes++] = ADSI_QUERY_CONFIG;
return bytes;
}
-int adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen)
+int ast_adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen)
{
int bytes = 0;
int res;
return bytes;
}
-int adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
+int ast_adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
{
unsigned char buf[256];
int bytes = 0;
int res;
- bytes += adsi_data_mode(buf);
- adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += ast_adsi_data_mode(buf);
+ ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
bytes = 0;
- bytes += adsi_query_cpeid(buf);
- adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += ast_adsi_query_cpeid(buf);
+ ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
/* Get response */
memset(buf, 0, sizeof(buf));
- res = adsi_read_encoded_dtmf(chan, cpeid, 4);
+ res = ast_adsi_read_encoded_dtmf(chan, cpeid, 4);
if (res != 4) {
ast_log(LOG_WARNING, "Got %d bytes back of encoded DTMF, expecting 4\n", res);
res = 0;
if (voice) {
bytes = 0;
- bytes += adsi_voice_mode(buf, 0);
- adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += ast_adsi_voice_mode(buf, 0);
+ ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
/* Ignore the resulting DTMF B announcing it's in voice mode */
ast_waitfordigit(chan, 1000);
}
return res;
}
-int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
+int ast_adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
{
unsigned char buf[256];
int bytes = 0;
int res;
- bytes += adsi_data_mode(buf);
- adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += ast_adsi_data_mode(buf);
+ ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
bytes = 0;
- bytes += adsi_query_cpeinfo(buf);
- adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += ast_adsi_query_cpeinfo(buf);
+ ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
/* Get width */
memset(buf, 0, sizeof(buf));
}
if (voice) {
bytes = 0;
- bytes += adsi_voice_mode(buf, 0);
- adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += ast_adsi_voice_mode(buf, 0);
+ ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
/* Ignore the resulting DTMF B announcing it's in voice mode */
ast_waitfordigit(chan, 1000);
}
return res;
}
-int adsi_data_mode(unsigned char *buf)
+int ast_adsi_data_mode(unsigned char *buf)
{
int bytes=0;
}
-int adsi_clear_soft_keys(unsigned char *buf)
+int ast_adsi_clear_soft_keys(unsigned char *buf)
{
int bytes=0;
}
-int adsi_clear_screen(unsigned char *buf)
+int ast_adsi_clear_screen(unsigned char *buf)
{
int bytes=0;
}
-int adsi_voice_mode(unsigned char *buf, int when)
+int ast_adsi_voice_mode(unsigned char *buf, int when)
{
int bytes=0;
}
-int adsi_available(struct ast_channel *chan)
+int ast_adsi_available(struct ast_channel *chan)
{
int cpe = chan->adsicpe & 0xff;
if ((cpe == AST_ADSI_AVAILABLE) ||
return 0;
}
-int adsi_download_disconnect(unsigned char *buf)
+int ast_adsi_download_disconnect(unsigned char *buf)
{
int bytes=0;
}
-int adsi_display(unsigned char *buf, int page, int line, int just, int wrap,
- char *col1, char *col2)
+int ast_adsi_display(unsigned char *buf, int page, int line, int just, int wrap,
+ char *col1, char *col2)
{
int bytes=0;
}
-int adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just)
+int ast_adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just)
{
int bytes=0;
}
-int adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
+int ast_adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
{
int bytes = 0;
return bytes;
}
-int adsi_set_keys(unsigned char *buf, unsigned char *keys)
+int ast_adsi_set_keys(unsigned char *buf, unsigned char *keys)
{
int bytes=0;
int x;
return bytes;
}
-int adsi_set_line(unsigned char *buf, int page, int line)
+int ast_adsi_set_line(unsigned char *buf, int page, int line)
{
int bytes=0;
static int total = 0;
static int speeds = 0;
-int adsi_channel_restore(struct ast_channel *chan)
+int ast_adsi_channel_restore(struct ast_channel *chan)
{
unsigned char dsp[256];
int bytes;
/* Start with initial display setup */
bytes = 0;
- bytes += adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);
+ bytes += ast_adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);
/* Prepare key setup messages */
for (x=0;x<speeds;x++) {
keyd[x] = ADSI_SPEED_DIAL + x;
}
- bytes += adsi_set_keys(dsp + bytes, keyd);
+ bytes += ast_adsi_set_keys(dsp + bytes, keyd);
}
- adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0);
+ ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0);
return 0;
}
-int adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
+int ast_adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
{
unsigned char buf[4096];
int bytes=0;
int res;
int x;
for(x=0;lines[x];x++)
- bytes += adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, aligns[x], 0, lines[x], "");
- bytes += adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
+ bytes += ast_adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, aligns[x], 0, lines[x], "");
+ bytes += ast_adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
if (voice) {
- bytes += adsi_voice_mode(buf + bytes, 0);
+ bytes += ast_adsi_voice_mode(buf + bytes, 0);
}
- res = adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ res = ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
if (voice) {
/* Ignore the resulting DTMF B announcing it's in voice mode */
ast_waitfordigit(chan, 1000);
return res;
}
-int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
+int ast_adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
{
unsigned char dsp[256];
int bytes;
/* Connect to session */
bytes = 0;
- bytes += adsi_connect_session(dsp + bytes, app, ver);
+ bytes += ast_adsi_connect_session(dsp + bytes, app, ver);
if (data)
- bytes += adsi_data_mode(dsp + bytes);
+ bytes += ast_adsi_data_mode(dsp + bytes);
/* Prepare key setup messages */
- if (adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
+ if (ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
return -1;
if (app) {
res = ast_readstring(chan, resp, 1, 1200, 1200, "");
}
-int adsi_unload_session(struct ast_channel *chan)
+int ast_adsi_unload_session(struct ast_channel *chan)
{
unsigned char dsp[256];
int bytes;
/* Connect to session */
bytes = 0;
- bytes += adsi_disconnect_session(dsp + bytes);
- bytes += adsi_voice_mode(dsp + bytes, 0);
+ bytes += ast_adsi_disconnect_session(dsp + bytes);
+ bytes += ast_adsi_voice_mode(dsp + bytes, 0);
/* Prepare key setup messages */
- if (adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
+ if (ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
return -1;
return 0;
}