Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv20046/apps

Modified Files:
      Tag: v1-0
        app_voicemail.c 
Log Message:
fix recording of voicemail duration (bug #4288)


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.151.2.17
retrieving revision 1.151.2.18
diff -u -d -r1.151.2.17 -r1.151.2.18
--- app_voicemail.c     15 May 2005 15:55:30 -0000      1.151.2.17
+++ app_voicemail.c     31 May 2005 13:08:45 -0000      1.151.2.18
@@ -1301,7 +1301,6 @@
        FILE *txt;
        int res = 0;
        int msgnum;
-       int fd;
        int duration = 0;
        int ausemacro = 0;
        int ousemacro = 0;
@@ -1488,22 +1487,19 @@
        chan->name,
        chan->callerid ? chan->callerid : "Unknown",
        date, (long)time(NULL));
-                                       fclose(txt);
                                } else
                                        ast_log(LOG_WARNING, "Error opening 
text file for output\n");
                                res = play_record_review(chan, NULL, fn, 
vmmaxmessage, fmt, 1, vmu, &duration, dir);
-                               if (res == '0')
+                               if (res == '0') {
+                                       if (txt)
+                                               fclose(txt);
                                        goto transfer;
+                               }
                                if (res > 0)
                                        res = 0;
-                               fd = open(txtfile, O_APPEND | O_WRONLY);
-                               if (fd > -1) {
-                                       txt = fdopen(fd, "a");
-                                       if (txt) {
-                                               fprintf(txt, "duration=%d\n", 
duration);
-                                               fclose(txt);
-                                       } else
-                                               close(fd);
+                               if (txt) {
+                                       fprintf(txt, "duration=%d\n", duration);
+                                       fclose(txt);
                                }
                                if (duration < vmminmessage) {
                                        if (option_verbose > 2) 

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to