diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-09-20 04:34:51 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2006-09-20 04:34:51 +0000 |
commit | 41d3e99e2843717440f9a65024ff949fc5aedebd (patch) | |
tree | 9b1ca6fdee332174efc875182d4fe89cb55b6e2f /apps | |
parent | e8606d9c577b60db46b3fac551e36bb2f6bb12cb (diff) |
move ADSI functionality into ast_ namespace
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_adsiprog.c | 28 | ||||
-rw-r--r-- | apps/app_getcpeid.c | 10 | ||||
-rw-r--r-- | apps/app_voicemail.c | 292 |
3 files changed, 165 insertions, 165 deletions
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c index 04b9000fd..c61f6bf3f 100644 --- a/apps/app_adsiprog.c +++ b/apps/app_adsiprog.c @@ -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 { diff --git a/apps/app_getcpeid.c b/apps/app_getcpeid.c index 7dbd5f6fd..f0e39e036 100644 --- a/apps/app_getcpeid.c +++ b/apps/app_getcpeid.c @@ -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); diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 99e51f23b..277f77e2f 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -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); |