]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Mon, 19 Feb 2007 19:22:08 +0000 (19:22 +0000)
committerAutomerge Script <automerge@asterisk.org>
Mon, 19 Feb 2007 19:22:08 +0000 (19:22 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@55478 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index c857096ee7daadd3c609e8e897b90e4087d280d5..993e4df1371e0ffdcd58a30481841831e50e6954 100644 (file)
@@ -4711,21 +4711,28 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
        /* If forcename is set, have the user record their name */      
        if (ast_test_flag(vmu, VM_FORCENAME)) {
                snprintf(prefile,sizeof(prefile), "%s%s/%s/greet", VM_SPOOL_DIR, vmu->context, vms->username);
-               cmd = play_record_review(chan,"vm-rec-name",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
-               if (cmd < 0 || cmd == 't' || cmd == '#')
-                       return cmd;
+               if (ast_fileexists(prefile, NULL, NULL) < 1) {
+                       cmd = play_record_review(chan, "vm-rec-name", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
+                       if (cmd < 0 || cmd == 't' || cmd == '#')
+                               return cmd;
+               }
        }
 
        /* If forcegreetings is set, have the user record their greetings */
        if (ast_test_flag(vmu, VM_FORCEGREET)) {
                snprintf(prefile,sizeof(prefile), "%s%s/%s/unavail", VM_SPOOL_DIR, vmu->context, vms->username);
-               cmd = play_record_review(chan,"vm-rec-unv",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
-               if (cmd < 0 || cmd == 't' || cmd == '#')
-                       return cmd;
+               if (ast_fileexists(prefile, NULL, NULL) < 1) {
+                       cmd = play_record_review(chan, "vm-rec-unv", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
+                       if (cmd < 0 || cmd == 't' || cmd == '#')
+                               return cmd;
+               }
+
                snprintf(prefile,sizeof(prefile), "%s%s/%s/busy", VM_SPOOL_DIR, vmu->context, vms->username);
-               cmd = play_record_review(chan,"vm-rec-busy",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
-               if (cmd < 0 || cmd == 't' || cmd == '#')
-                       return cmd;
+               if (ast_fileexists(prefile, NULL, NULL) < 1) {
+                       cmd = play_record_review(chan, "vm-rec-busy", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
+                       if (cmd < 0 || cmd == 't' || cmd == '#')
+                               return cmd;
+               }
        }
 
        return cmd;