aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-09 07:39:39 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-09 07:39:39 +0000
commit4e28e6fb09b8cc4935089ca2fe38d52ed16530fa (patch)
tree5ff956a05ce4cace6fb1cd68329f6c2975b29086
parent6e6d9ea0299a8dcdb76b39d1399f2746a0c3292f (diff)
Add "skipaftercmd" option to voicemail to move to the next message automatically (bug #1984)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3407 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_voicemail.c31
-rwxr-xr-xconfigs/voicemail.conf.sample2
2 files changed, 31 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index d0717651e..22fedbf04 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -263,6 +263,7 @@ static int reviewvm;
static int calloper;
static int saycidinfo;
static int hearenv;
+static int skipaftercmd;
static char dialcontext[80];
static char callcontext[80];
static char exitcontext[80];
@@ -3771,7 +3772,16 @@ static int vm_execmain(struct ast_channel *chan, void *data)
cmd = play_and_wait(chan, "vm-deleted");
else
cmd = play_and_wait(chan, "vm-undeleted");
+ if (skipaftercmd) {
+ if (vms.curmsg < vms.lastmsg) {
+ vms.curmsg++;
+ cmd = play_message(chan, vmu, &vms);
+ } else {
+ cmd = play_and_wait(chan, "vm-nomore");
+ }
+ }
break;
+
case '8':
if(vms.lastmsg > -1)
cmd = forward_message(chan, context, vms.curdir, vms.curmsg, vmu, vmfmts);
@@ -3815,7 +3825,16 @@ static int vm_execmain(struct ast_channel *chan, void *data)
if (!cmd)
cmd = play_and_wait(chan, "vm-messages");
}
- break;
+ if (skipaftercmd) {
+ if (vms.curmsg < vms.lastmsg) {
+ vms.curmsg++;
+ cmd = play_message(chan, vmu, &vms);
+ } else {
+ cmd = play_and_wait(chan, "vm-nomore");
+ }
+ }
+ break;
+
case '*':
if (!vms.starting) {
cmd = play_and_wait(chan, "vm-onefor");
@@ -4131,6 +4150,7 @@ static int load_config(void)
char *astsaycid;
char *astcallop;
char *astreview;
+ char *astskipcmd;
char *asthearenv;
char *silencestr;
char *thresholdstr;
@@ -4291,7 +4311,14 @@ static int load_config(void)
asthearenv = "yes";
}
hearenv = ast_true(asthearenv);
-
+
+ skipaftercmd = 0;
+ if (!(astskipcmd = ast_variable_retrieve(cfg, "general", "nextaftercmd"))) {
+ ast_log(LOG_DEBUG,"We are not going to skip to the next msg after save/delete\n");
+ astskipcmd = "no";
+ }
+ skipaftercmd = ast_true(astskipcmd);
+
if ((dialoutcxt = ast_variable_retrieve(cfg, "general", "dialout"))) {
strncpy(dialcontext, dialoutcxt, sizeof(dialcontext) - 1);
ast_log(LOG_DEBUG, "found dialout context: %s\n", dialcontext);
diff --git a/configs/voicemail.conf.sample b/configs/voicemail.conf.sample
index b39f32ffb..5d6ba450f 100755
--- a/configs/voicemail.conf.sample
+++ b/configs/voicemail.conf.sample
@@ -104,6 +104,8 @@ maxlogins=3
; This does NOT affect option 3,3 from the advanced options menu
; delete=yes ; After notification, the voicemail is deleted from the server. [per-mailbox only]
; This is intended for use with users who wish to receive their voicemail ONLY by email.
+; nextaftercmd=yes ; Skips to the next message after hitting 7 or 9 to delete/save current message.
+ ; [global option only at this time]
[zonemessages]
eastern=America/New_York|'vm-received' Q 'digits/at' IMp