diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-21 06:28:19 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-21 06:28:19 +0000 |
commit | 6fa1f8e69dad7af2fb50e8b47fe4f0f332738130 (patch) | |
tree | 17f4e68ba3dd1fb8d9061295b274fd30b5c890fe /apps | |
parent | 40b6d5846455051c73d676f8265b2c45b0882c06 (diff) |
Merged revisions 13748 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r13748 | tilghman | 2006-03-21 00:24:56 -0600 (Tue, 21 Mar 2006) | 2 lines
Bug 6714 - Workaround to avoid retrieving incomplete voicemail message
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@13749 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_voicemail.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 188349b45..52e5c5387 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2364,7 +2364,7 @@ struct leave_vm_options { static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options) { - char txtfile[256]; + char tmptxtfile[256], txtfile[256]; char callerid[256]; FILE *txt; int res = 0; @@ -2561,7 +2561,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ /* Store information */ snprintf(txtfile, sizeof(txtfile), "%s.txt", fn); - txt = fopen(txtfile, "w+"); + snprintf(tmptxtfile, sizeof(tmptxtfile), "%s.txt.tmp", fn); + txt = fopen(tmptxtfile, "w+"); if (txt) { get_date(date, sizeof(date)); fprintf(txt, @@ -2601,6 +2602,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ if (txt) { fprintf(txt, "duration=%d\n", duration); fclose(txt); + rename(tmptxtfile, txtfile); } if (duration < vmminmessage) { |