diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-19 18:11:48 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-19 18:11:48 +0000 |
commit | 342c3142453597735d42698f513329f8bebfdb9a (patch) | |
tree | a92ea4e891dbd8cd3f9ce8021d9f44138c11e56c /apps/app_voicemail.c | |
parent | 529302e979079c75b3340e2fb6e76214459683a3 (diff) |
Merged revisions 55434 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r55434 | tilghman | 2007-02-19 12:09:09 -0600 (Mon, 19 Feb 2007) | 2 lines
forcename and forcegreetings options should check to see if the recording already exists
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@55435 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 4326dbc0f..fe231da4f 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -5767,21 +5767,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, NULL); - 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, NULL); + 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, NULL); - 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, NULL); + 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, NULL); - 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, NULL); + if (cmd < 0 || cmd == 't' || cmd == '#') + return cmd; + } } return cmd; |