[Freeswitch-svn] [commit] r4309 - in freeswitch/trunk: . src src/include src/mod/xml_int/mod_xml_cdr
Freeswitch SVN
mikej at freeswitch.org
Sat Feb 17 01:55:43 EST 2007
Author: mikej
Date: Sat Feb 17 01:55:43 2007
New Revision: 4309
Modified:
freeswitch/trunk/Freeswitch.sln
freeswitch/trunk/src/include/switch_platform.h
freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
freeswitch/trunk/src/switch_xml.c
Log:
add windows build for mod_xml_cdr. This probably also fixes the build on several non-linux systems.
Modified: freeswitch/trunk/Freeswitch.sln
==============================================================================
--- freeswitch/trunk/Freeswitch.sln (original)
+++ freeswitch/trunk/Freeswitch.sln Sat Feb 17 01:55:43 2007
@@ -544,6 +544,13 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "libs\portaudio\build\msvc\portaudio.vcproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_cdr", "src\mod\xml_int\mod_xml_cdr\mod_xml_cdr.vcproj", "{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}"
+ ProjectSection(ProjectDependencies) = postProject
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+ {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
+ {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -1054,6 +1061,12 @@
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.Build.0 = Release|x64
+ {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.ActiveCfg = Debug|Win32
+ {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.Build.0 = Debug|Win32
+ {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.ActiveCfg = Debug|Win32
+ {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.ActiveCfg = Release|Win32
+ {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.Build.0 = Release|Win32
+ {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1137,6 +1150,7 @@
{1C453396-D912-4213-89FD-9B489162B7B5} = {A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}
{CBEC7225-0C21-4DA8-978E-1F158F8AD950} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
{AB91A099-7690-4ECF-8994-E458F4EA1ED4} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
+ {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
{5927104D-C14C-4AC8-925C-4AB681762E75} = {C120A020-773F-4EA3-923F-B67AF28B750D}
{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D}
{988CACF7-3FCB-4992-BE69-77872AE67DC8} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
Modified: freeswitch/trunk/src/include/switch_platform.h
==============================================================================
--- freeswitch/trunk/src/include/switch_platform.h (original)
+++ freeswitch/trunk/src/include/switch_platform.h Sat Feb 17 01:55:43 2007
@@ -146,6 +146,12 @@
#define SWITCH_MOD_DECLARE(type) __declspec(dllimport) type __cdecl
#endif
#define SIGHUP SIGTERM
+#ifndef S_IRUSR
+#define S_IRUSR _S_IREAD
+#endif
+#ifndef S_IWUSR
+#define S_IWUSR _S_IWRITE
+#endif
#else //not win32
#define SWITCH_DECLARE(type) type
#define SWITCH_DECLARE_NONSTD(type) type
Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c Sat Feb 17 01:55:43 2007
@@ -29,9 +29,9 @@
* mod_xml_cdr.c -- XML CDR Module
*
*/
+#include <sys/stat.h>
#include <switch.h>
-
static const char modname[] = "mod_xml_cdr";
static switch_status_t my_on_hangup(switch_core_session_t *session)
@@ -55,13 +55,17 @@
if ((path = switch_mprintf("%s/xml_cdr/%s.cdr.xml", logdir, uuid_str))) {
if ((xml_text = switch_xml_toxml(cdr))) {
if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) > -1) {
- write(fd, header, strlen(header));
- write(fd, xml_text, strlen(xml_text));
+ write(fd, header, (unsigned)strlen(header));
+ write(fd, xml_text, (unsigned)strlen(xml_text));
close(fd);
fd = -1;
} else {
char ebuf[512] = {0};
+#ifdef WIN32
+ strerror_s(ebuf, sizeof(ebuf), errno);
+#else
strerror_r(errno, ebuf, sizeof(ebuf));
+#endif
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error![%s]\n", ebuf);
}
free(xml_text);
Modified: freeswitch/trunk/src/switch_xml.c
==============================================================================
--- freeswitch/trunk/src/switch_xml.c (original)
+++ freeswitch/trunk/src/switch_xml.c Sat Feb 17 01:55:43 2007
@@ -59,14 +59,6 @@
#ifdef HAVE_MMAP
#include <sys/mman.h>
#endif
-#ifdef WIN32
-#ifndef S_IRUSR
-#define S_IRUSR _S_IREAD
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR _S_IWRITE
-#endif
-#endif
#define SWITCH_XML_WS "\t\r\n " // whitespace
#define SWITCH_XML_ERRL 128 // maximum error string length
More information about the Freeswitch-svn
mailing list