modify the handling of the new temporary greeting reminder feature so that
authorRussell Bryant <russell@russellbryant.com>
Fri, 5 May 2006 22:57:11 +0000 (22:57 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 5 May 2006 22:57:11 +0000 (22:57 +0000)
it works for any language

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@25096 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index ac652e1..fccc9e0 100644 (file)
@@ -4060,17 +4060,9 @@ static int vm_intro_gr(struct ast_channel *chan, struct vm_state *vms)
 }
        
 /* Default English syntax */
-static int vm_intro_en(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms)
- {
+static int vm_intro_en(struct ast_channel *chan, struct vm_state *vms)
+{
        int res;
-       char prefile[256]="";
-
-       /* Notify the user that the temp greeting is set and give them the option to remove it */
-       snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vms->username);
-       if (ast_test_flag(vmu, VM_TEMPGREETWARN)) {
-               if (ast_fileexists(prefile, NULL, NULL) > 0)
-                       res = ast_play_and_wait(chan, "vm-tempgreetactive");
-       }
 
        /* Introduce messages they have */
        res = ast_play_and_wait(chan, "vm-youhave");
@@ -4629,6 +4621,15 @@ static int vm_intro_ru(struct ast_channel *chan,struct vm_state *vms)
 
 static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms)
 {
+       char prefile[256];
+       
+       /* Notify the user that the temp greeting is set and give them the option to remove it */
+       snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vms->username);
+       if (ast_test_flag(vmu, VM_TEMPGREETWARN)) {
+               if (ast_fileexists(prefile, NULL, NULL) > 0)
+                       ast_play_and_wait(chan, "vm-tempgreetactive");
+       }
+
        /* Play voicemail intro - syntax is different for different languages */
        if (!strcasecmp(chan->language, "de")) {        /* GERMAN syntax */
                return vm_intro_de(chan, vms);
@@ -4653,7 +4654,7 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
        } else if (!strcasecmp(chan->language, "ru")) {   /* RUSSIAN syntax */
                return vm_intro_ru(chan, vms);
        } else {                                        /* Default to ENGLISH */
-               return vm_intro_en(chan, vmu, vms);
+               return vm_intro_en(chan, vms);
        }
 }