mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
move ADSI functionality into ast_ namespace
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1438,11 +1438,11 @@ static int adsi_prog(struct ast_channel *chan, char *script)
|
||||
return -1;
|
||||
|
||||
/* Start an empty ADSI Session */
|
||||
if (adsi_load_session(chan, NULL, 0, 1) < 1)
|
||||
if (ast_adsi_load_session(chan, NULL, 0, 1) < 1)
|
||||
return -1;
|
||||
|
||||
/* Now begin the download attempt */
|
||||
if (adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) {
|
||||
if (ast_adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) {
|
||||
/* User rejected us for some reason */
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "User rejected download attempt\n");
|
||||
@@ -1456,7 +1456,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
|
||||
for (x=0;x<scr->numkeys;x++) {
|
||||
if (bytes + scr->keys[x].retstrlen > 253) {
|
||||
/* Send what we've collected so far */
|
||||
if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
|
||||
return -1;
|
||||
}
|
||||
@@ -1469,7 +1469,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
|
||||
#endif
|
||||
}
|
||||
if (bytes) {
|
||||
if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
|
||||
return -1;
|
||||
}
|
||||
@@ -1480,7 +1480,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
|
||||
for (x=0;x<scr->numdisplays;x++) {
|
||||
if (bytes + scr->displays[x].datalen > 253) {
|
||||
/* Send what we've collected so far */
|
||||
if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
|
||||
return -1;
|
||||
}
|
||||
@@ -1493,7 +1493,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
|
||||
#endif
|
||||
}
|
||||
if (bytes) {
|
||||
if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
|
||||
return -1;
|
||||
}
|
||||
@@ -1504,7 +1504,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
|
||||
for (x=0;x<scr->numsubs;x++) {
|
||||
if (bytes + scr->subs[x].datalen > 253) {
|
||||
/* Send what we've collected so far */
|
||||
if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
|
||||
return -1;
|
||||
}
|
||||
@@ -1517,7 +1517,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
|
||||
#endif
|
||||
}
|
||||
if (bytes) {
|
||||
if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
|
||||
ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
|
||||
return -1;
|
||||
}
|
||||
@@ -1525,11 +1525,11 @@ static int adsi_prog(struct ast_channel *chan, char *script)
|
||||
|
||||
|
||||
bytes = 0;
|
||||
bytes += adsi_display(buf, ADSI_INFO_PAGE, 1, ADSI_JUST_LEFT, 0, "Download complete.", "");
|
||||
bytes += adsi_set_line(buf, ADSI_INFO_PAGE, 1);
|
||||
if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY) < 0)
|
||||
bytes += ast_adsi_display(buf, ADSI_INFO_PAGE, 1, ADSI_JUST_LEFT, 0, "Download complete.", "");
|
||||
bytes += ast_adsi_set_line(buf, ADSI_INFO_PAGE, 1);
|
||||
if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY) < 0)
|
||||
return -1;
|
||||
if (adsi_end_download(chan)) {
|
||||
if (ast_adsi_end_download(chan)) {
|
||||
/* Download failed for some reason */
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "Download attempt failed\n");
|
||||
@@ -1538,7 +1538,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
|
||||
return -1;
|
||||
}
|
||||
free(scr);
|
||||
adsi_unload_session(chan);
|
||||
ast_adsi_unload_session(chan);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1552,7 +1552,7 @@ static int adsi_exec(struct ast_channel *chan, void *data)
|
||||
if (ast_strlen_zero(data))
|
||||
data = "asterisk.adsi";
|
||||
|
||||
if (!adsi_available(chan)) {
|
||||
if (!ast_adsi_available(chan)) {
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "ADSI Unavailable on CPE. Not bothering to try.\n");
|
||||
} else {
|
||||
|
@@ -60,7 +60,7 @@ static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)
|
||||
for (x=0;x<4;x++)
|
||||
tmp[x] = stuff[x];
|
||||
tmp[4] = NULL;
|
||||
return adsi_print(chan, tmp, justify, voice);
|
||||
return ast_adsi_print(chan, tmp, justify, voice);
|
||||
}
|
||||
|
||||
static int cpeid_exec(struct ast_channel *chan, void *idata)
|
||||
@@ -83,10 +83,10 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
|
||||
strncpy(stuff[0], "** CPE Info **", sizeof(data[0]) - 1);
|
||||
strncpy(stuff[1], "Identifying CPE...", sizeof(data[1]) - 1);
|
||||
strncpy(stuff[2], "Please wait...", sizeof(data[2]) - 1);
|
||||
res = adsi_load_session(chan, NULL, 0, 1);
|
||||
res = ast_adsi_load_session(chan, NULL, 0, 1);
|
||||
if (res > 0) {
|
||||
cpeid_setstatus(chan, stuff, 0);
|
||||
res = adsi_get_cpeid(chan, cpeid, 0);
|
||||
res = ast_adsi_get_cpeid(chan, cpeid, 0);
|
||||
if (res > 0) {
|
||||
gotcpeid = 1;
|
||||
if (option_verbose > 2)
|
||||
@@ -96,7 +96,7 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
|
||||
strncpy(stuff[1], "Measuring CPE...", sizeof(data[1]) - 1);
|
||||
strncpy(stuff[2], "Please wait...", sizeof(data[2]) - 1);
|
||||
cpeid_setstatus(chan, stuff, 0);
|
||||
res = adsi_get_cpeinfo(chan, &width, &height, &buttons, 0);
|
||||
res = ast_adsi_get_cpeinfo(chan, &width, &height, &buttons, 0);
|
||||
if (res > -1) {
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->name);
|
||||
@@ -123,7 +123,7 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
|
||||
break;
|
||||
}
|
||||
}
|
||||
adsi_unload_session(chan);
|
||||
ast_adsi_unload_session(chan);
|
||||
}
|
||||
}
|
||||
ast_module_user_remove(u);
|
||||
|
@@ -3143,8 +3143,8 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -3156,133 +3156,133 @@ static int adsi_load_vmail(struct ast_channel *chan, int *useadsi)
|
||||
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) {
|
||||
@@ -3300,7 +3300,7 @@ static void adsi_login(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++)
|
||||
@@ -3309,15 +3309,15 @@ static void adsi_login(struct ast_channel *chan)
|
||||
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)
|
||||
@@ -3326,7 +3326,7 @@ 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++)
|
||||
@@ -3334,12 +3334,12 @@ static void adsi_password(struct ast_channel *chan)
|
||||
/* 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)
|
||||
@@ -3349,7 +3349,7 @@ 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++) {
|
||||
@@ -3362,13 +3362,13 @@ static void adsi_folders(struct ast_channel *chan, int start, char *label)
|
||||
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)
|
||||
@@ -3388,7 +3388,7 @@ 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 */
|
||||
@@ -3427,7 +3427,7 @@ static void adsi_message(struct ast_channel *chan, struct vm_state *vms)
|
||||
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 */
|
||||
@@ -3453,15 +3453,15 @@ static void adsi_message(struct ast_channel *chan, struct vm_state *vms)
|
||||
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)
|
||||
@@ -3472,7 +3472,7 @@ 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 */
|
||||
@@ -3503,10 +3503,10 @@ static void adsi_delete(struct ast_channel *chan, struct vm_state *vms)
|
||||
|
||||
/* 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)
|
||||
@@ -3519,7 +3519,7 @@ 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);
|
||||
@@ -3537,9 +3537,9 @@ static void adsi_status(struct ast_channel *chan, struct vm_state *vms)
|
||||
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);
|
||||
@@ -3549,11 +3549,11 @@ static void adsi_status(struct ast_channel *chan, struct vm_state *vms)
|
||||
/* 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)
|
||||
@@ -3566,7 +3566,7 @@ 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 */
|
||||
@@ -3586,15 +3586,15 @@ static void adsi_status2(struct ast_channel *chan, struct vm_state *vms)
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@@ -3603,12 +3603,12 @@ static void adsi_clear(struct ast_channel *chan)
|
||||
{
|
||||
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);
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -3617,15 +3617,15 @@ static void adsi_goodbye(struct ast_channel *chan)
|
||||
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 ---*/
|
||||
@@ -5506,13 +5506,13 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
|
||||
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
|
||||
@@ -5584,14 +5584,14 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
|
||||
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)
|
||||
@@ -5679,13 +5679,13 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
|
||||
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') {
|
||||
@@ -6448,7 +6448,7 @@ out:
|
||||
res = 0;
|
||||
}
|
||||
if (useadsi)
|
||||
adsi_unload_session(chan);
|
||||
ast_adsi_unload_session(chan);
|
||||
}
|
||||
if (vmu)
|
||||
close_mailbox(&vms, vmu);
|
||||
|
@@ -125,22 +125,22 @@
|
||||
* 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 */
|
||||
/*!
|
||||
@@ -152,7 +152,7 @@ int adsi_channel_restore(struct ast_channel *chan);
|
||||
* 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. */
|
||||
@@ -165,18 +165,18 @@ int adsi_print(struct ast_channel *chan, char **lines, int *align, int voice);
|
||||
* 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 */
|
||||
|
||||
@@ -190,14 +190,14 @@ int adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int max
|
||||
*
|
||||
*/
|
||||
|
||||
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. */
|
||||
/*!
|
||||
@@ -205,9 +205,9 @@ int adsi_query_cpeinfo(unsigned char *buf);
|
||||
* or -1 on hangup, or 0 if there was no hangup but it failed to find the
|
||||
* device ID. Returns to voice mode if "voice" is non-zero.
|
||||
*/
|
||||
int adsi_get_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 */
|
||||
/*!
|
||||
@@ -221,7 +221,7 @@ int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *but
|
||||
*
|
||||
*/
|
||||
|
||||
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 */
|
||||
/*!
|
||||
@@ -230,7 +230,7 @@ int adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn,
|
||||
* 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 */
|
||||
/*!
|
||||
@@ -239,7 +239,7 @@ int adsi_disconnect_session(unsigned char *buf);
|
||||
* 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... */
|
||||
/*!
|
||||
@@ -248,9 +248,9 @@ int adsi_download_disconnect(unsigned char *buf);
|
||||
* 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... */
|
||||
/*!
|
||||
@@ -260,14 +260,14 @@ int adsi_clear_screen(unsigned char *buf);
|
||||
* 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 */
|
||||
/*!
|
||||
@@ -283,7 +283,7 @@ int adsi_available(struct ast_channel *chan);
|
||||
*
|
||||
*/
|
||||
|
||||
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 */
|
||||
/*!
|
||||
@@ -295,7 +295,7 @@ int adsi_display(unsigned char *buf, int page, int line, int just, int wrap, cha
|
||||
*
|
||||
*/
|
||||
|
||||
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 */
|
||||
/*!
|
||||
@@ -309,7 +309,7 @@ int adsi_set_line(unsigned char *buf, int page, int line);
|
||||
* 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 */
|
||||
/*!
|
||||
@@ -320,7 +320,7 @@ int adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const ch
|
||||
* 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 */
|
||||
/*!
|
||||
@@ -334,7 +334,7 @@ int adsi_set_keys(unsigned char *buf, unsigned char *keys);
|
||||
* 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 */
|
||||
/*!
|
||||
@@ -348,6 +348,6 @@ int adsi_input_control(unsigned char *buf, int page, int line, int display, int
|
||||
* 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 */
|
||||
|
120
res/res_adsi.c
120
res/res_adsi.c
@@ -322,7 +322,7 @@ static int __adsi_transmit_messages(struct ast_channel *chan, unsigned char **ms
|
||||
|
||||
}
|
||||
|
||||
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];
|
||||
@@ -330,8 +330,8 @@ int adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *
|
||||
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;
|
||||
@@ -341,20 +341,20 @@ int adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *
|
||||
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];
|
||||
@@ -428,9 +428,9 @@ int adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int
|
||||
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)
|
||||
@@ -444,7 +444,7 @@ 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;
|
||||
|
||||
@@ -483,7 +483,7 @@ int adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const ch
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -506,7 +506,7 @@ int adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -536,7 +536,7 @@ int adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn
|
||||
|
||||
}
|
||||
|
||||
int adsi_disconnect_session(unsigned char *buf)
|
||||
int ast_adsi_disconnect_session(unsigned char *buf)
|
||||
{
|
||||
int bytes=0;
|
||||
|
||||
@@ -551,7 +551,7 @@ int adsi_disconnect_session(unsigned char *buf)
|
||||
|
||||
}
|
||||
|
||||
int adsi_query_cpeid(unsigned char *buf)
|
||||
int ast_adsi_query_cpeid(unsigned char *buf)
|
||||
{
|
||||
int bytes = 0;
|
||||
buf[bytes++] = ADSI_QUERY_CPEID;
|
||||
@@ -561,7 +561,7 @@ int adsi_query_cpeid(unsigned char *buf)
|
||||
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;
|
||||
@@ -571,7 +571,7 @@ int adsi_query_cpeinfo(unsigned char *buf)
|
||||
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;
|
||||
@@ -606,21 +606,21 @@ int adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int max
|
||||
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;
|
||||
@@ -630,25 +630,25 @@ int adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
|
||||
|
||||
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));
|
||||
@@ -695,15 +695,15 @@ int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *but
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -718,7 +718,7 @@ int adsi_data_mode(unsigned char *buf)
|
||||
|
||||
}
|
||||
|
||||
int adsi_clear_soft_keys(unsigned char *buf)
|
||||
int ast_adsi_clear_soft_keys(unsigned char *buf)
|
||||
{
|
||||
int bytes=0;
|
||||
|
||||
@@ -733,7 +733,7 @@ int adsi_clear_soft_keys(unsigned char *buf)
|
||||
|
||||
}
|
||||
|
||||
int adsi_clear_screen(unsigned char *buf)
|
||||
int ast_adsi_clear_screen(unsigned char *buf)
|
||||
{
|
||||
int bytes=0;
|
||||
|
||||
@@ -748,7 +748,7 @@ int adsi_clear_screen(unsigned char *buf)
|
||||
|
||||
}
|
||||
|
||||
int adsi_voice_mode(unsigned char *buf, int when)
|
||||
int ast_adsi_voice_mode(unsigned char *buf, int when)
|
||||
{
|
||||
int bytes=0;
|
||||
|
||||
@@ -765,7 +765,7 @@ int adsi_voice_mode(unsigned char *buf, int when)
|
||||
|
||||
}
|
||||
|
||||
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) ||
|
||||
@@ -774,7 +774,7 @@ int adsi_available(struct ast_channel *chan)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int adsi_download_disconnect(unsigned char *buf)
|
||||
int ast_adsi_download_disconnect(unsigned char *buf)
|
||||
{
|
||||
int bytes=0;
|
||||
|
||||
@@ -789,8 +789,8 @@ int adsi_download_disconnect(unsigned char *buf)
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -835,7 +835,7 @@ int adsi_display(unsigned char *buf, int page, int line, int just, int wrap,
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -858,7 +858,7 @@ int adsi_input_control(unsigned char *buf, int page, int line, int display, int
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -877,7 +877,7 @@ int adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *form
|
||||
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;
|
||||
@@ -892,7 +892,7 @@ int adsi_set_keys(unsigned char *buf, unsigned char *keys)
|
||||
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;
|
||||
|
||||
@@ -923,7 +923,7 @@ int adsi_set_line(unsigned char *buf, int page, int line)
|
||||
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;
|
||||
@@ -934,7 +934,7 @@ int adsi_channel_restore(struct ast_channel *chan)
|
||||
|
||||
/* 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 */
|
||||
|
||||
@@ -943,26 +943,26 @@ int adsi_channel_restore(struct ast_channel *chan)
|
||||
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);
|
||||
@@ -970,7 +970,7 @@ int adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
|
||||
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;
|
||||
@@ -981,13 +981,13 @@ int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int
|
||||
|
||||
/* 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, "");
|
||||
@@ -1011,7 +1011,7 @@ int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int
|
||||
|
||||
}
|
||||
|
||||
int adsi_unload_session(struct ast_channel *chan)
|
||||
int ast_adsi_unload_session(struct ast_channel *chan)
|
||||
{
|
||||
unsigned char dsp[256];
|
||||
int bytes;
|
||||
@@ -1020,11 +1020,11 @@ int adsi_unload_session(struct ast_channel *chan)
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
@@ -265,10 +265,10 @@ static int adsi_announce_park(struct ast_channel *chan, char *parkingexten)
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "Parked on %s", parkingexten);
|
||||
message[0] = tmp;
|
||||
res = adsi_load_session(chan, NULL, 0, 1);
|
||||
res = ast_adsi_load_session(chan, NULL, 0, 1);
|
||||
if (res == -1)
|
||||
return res;
|
||||
return adsi_print(chan, message, justify, 1);
|
||||
return ast_adsi_print(chan, message, justify, 1);
|
||||
}
|
||||
|
||||
/*! \brief Notify metermaids that we've changed an extension */
|
||||
@@ -407,9 +407,9 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
|
||||
S_OR(pu->chan->cid.cid_name, "<unknown>")
|
||||
);
|
||||
|
||||
if (peer && adsipark && adsi_available(peer)) {
|
||||
if (peer && adsipark && ast_adsi_available(peer)) {
|
||||
adsi_announce_park(peer, pu->parkingexten); /* Only supports parking numbers */
|
||||
adsi_unload_session(peer);
|
||||
ast_adsi_unload_session(peer);
|
||||
}
|
||||
|
||||
con = ast_context_find(parking_con);
|
||||
|
Reference in New Issue
Block a user