mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 22:45:39 +00:00
automerge commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@13784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2367,7 +2367,7 @@ struct leave_vm_options {
|
|||||||
|
|
||||||
static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *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];
|
char callerid[256];
|
||||||
FILE *txt;
|
FILE *txt;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
@@ -2564,7 +2564,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
|
|||||||
|
|
||||||
/* Store information */
|
/* Store information */
|
||||||
snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
|
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) {
|
if (txt) {
|
||||||
get_date(date, sizeof(date));
|
get_date(date, sizeof(date));
|
||||||
fprintf(txt,
|
fprintf(txt,
|
||||||
@@ -2604,6 +2605,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
|
|||||||
if (txt) {
|
if (txt) {
|
||||||
fprintf(txt, "duration=%d\n", duration);
|
fprintf(txt, "duration=%d\n", duration);
|
||||||
fclose(txt);
|
fclose(txt);
|
||||||
|
rename(tmptxtfile, txtfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (duration < vmminmessage) {
|
if (duration < vmminmessage) {
|
||||||
|
Reference in New Issue
Block a user