[Freeswitch-svn] [commit] r6406 - in freeswitch/trunk/src: . mod/applications/mod_voicemail

Freeswitch SVN anthm at freeswitch.org
Mon Nov 26 20:15:13 EST 2007


Author: anthm
Date: Mon Nov 26 20:15:13 2007
New Revision: 6406

Modified:
   freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
   freeswitch/trunk/src/switch_utils.c

Log:
tweak

Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	Mon Nov 26 20:15:13 2007
@@ -297,8 +297,8 @@
         char *storage_dir = "";
         char *callback_dialplan = "XML";
         char *callback_context = "default";
-        char *email_body = "";
-        char *email_headers = "";
+        char *email_body = NULL;
+        char *email_headers = NULL;
         char *email_from = "";
         char *date_fmt = "%A, %B %d %Y, %I %M %p";
         uint32_t record_threshold = 200;
@@ -311,12 +311,12 @@
         db = NULL;
 
         if ((x_email = switch_xml_child(x_profile, "email"))) {
-            if ((param = switch_xml_child(x_email,"body"))) {
-                email_body = switch_core_strdup(globals.pool,param->txt);
+            if ((param = switch_xml_child(x_email, "body"))) {
+                email_body = switch_core_strdup(globals.pool, param->txt);
             }
 
-            if ((param = switch_xml_child(x_email,"headers"))) {
-                email_headers = switch_core_strdup(globals.pool,param->txt);
+            if ((param = switch_xml_child(x_email, "headers"))) {
+                email_headers = switch_core_strdup(globals.pool, param->txt);
             }
 
 
@@ -1120,11 +1120,11 @@
                         switch_event_fire(&event);
                     }
 
-                    if(!switch_strlen_zero(profile->email_headers)) {
-                        body = switch_mprintf("Voicemail from %s %s", 
-                                              cbt->cid_name, cbt->cid_number);
+                    if (profile->email_body) {
+                        body = switch_channel_expand_variables(channel, profile->email_body);
                     } else {
-                        body = switch_channel_expand_variables(channel,profile->email_body);
+                        body = switch_mprintf("%u second Voicemail from %s %s", message_len, 
+                                              cbt->cid_name, cbt->cid_number);
                     }
 
                     switch_simple_email(cbt->email, from, header_string, body, cbt->file_path);
@@ -1913,11 +1913,12 @@
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Message-Type", "voicemail");
             switch_event_fire(&event);
         }
-        if (!switch_strlen_zero(profile->email_headers)) {
-            body = switch_mprintf("Voicemail from %s %s", 
-                                  caller_profile->caller_id_name, caller_profile->caller_id_number);
+
+        if (profile->email_body) {
+            body = switch_channel_expand_variables(channel, profile->email_body);
         } else {
-            body = switch_channel_expand_variables(channel,profile->email_body);
+            body = switch_mprintf("%u second Voicemail from %s %s", message_len,
+                                  caller_profile->caller_id_name, caller_profile->caller_id_number);
         }
 
         if (email_attach) {

Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c	(original)
+++ freeswitch/trunk/src/switch_utils.c	Mon Nov 26 20:15:13 2007
@@ -220,7 +220,7 @@
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to execute command: %s\n", buf);
     }
 
-    //unlink(filename);
+    unlink(filename);
 
 
     if (file) {



More information about the Freeswitch-svn mailing list