[Freeswitch-svn] [commit] r8985 - in freeswitch/trunk: conf/autoload_configs src

Freeswitch SVN mikej at freeswitch.org
Thu Jul 10 11:35:35 EDT 2008


Author: mikej
Date: Thu Jul 10 11:35:35 2008
New Revision: 8985

Modified:
   freeswitch/trunk/conf/autoload_configs/switch.conf.xml
   freeswitch/trunk/src/switch_utils.c

Log:
mailer implementation for windows (FSCORE-115)

Modified: freeswitch/trunk/conf/autoload_configs/switch.conf.xml
==============================================================================
--- freeswitch/trunk/conf/autoload_configs/switch.conf.xml	(original)
+++ freeswitch/trunk/conf/autoload_configs/switch.conf.xml	Thu Jul 10 11:35:35 2008
@@ -26,6 +26,32 @@
     <param name="crash-protection" value="false"/>
     <!--<param name="max_dtmf_duration" value="192000"/>-->
     <!--<param name="default_dtmf_duration" value="8000"/>-->
+    <!--
+         If you want to send out voicemail notifications via Windows you'll need to change the mailer-app
+         variable to the setting below:
+     
+       <param name="mailer-app" value="msmtp"/>
+ 
+         Donot change mailer-app-args.
+         You will also need to download a sendmail clone for Windows (msmtp). This version works without issue:
+         http://msmtp.sourceforge.net/index.html. Download and copy the .exe to %winddir%\system32.
+         You'll need to create a small config file for smtp credentials (host name, authentication, tls, etc.) in
+         %USERPROFILE%\Application Data\ called "msmtprc.txt". Below is a sample copy of this file:
+ 
+         ###################################
+         # The SMTP server of the provider.
+         account provider
+         host smtp.myisp.com
+         from john at myisp.com
+         auth login
+         user johndoe
+         password mypassword
+ 
+         # Set a default account
+         account default : provider
+       ###################################
+         
+ -->    
     <param name="mailer-app" value="sendmail"/>
     <param name="mailer-app-args" value="-t"/>
     <param name="dump-cores" value="yes"/>

Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c	(original)
+++ freeswitch/trunk/src/switch_utils.c	Thu Jul 10 11:35:35 2008
@@ -463,7 +463,11 @@
 	if (ifd) {
 		close(ifd);
 	}
+#ifdef WIN32
+	switch_snprintf(buf, B64BUFFLEN, "type %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to);
+#else
 	switch_snprintf(buf, B64BUFFLEN, "/bin/cat %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to);
+#endif
 	if (system(buf)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to execute command: %s\n", buf);
 	}



More information about the Freeswitch-svn mailing list