]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add windows build for mod_xml_cdr. This probably also fixes the build on several...
authorMichael Jerris <mike@jerris.com>
Sat, 17 Feb 2007 06:55:43 +0000 (06:55 +0000)
committerMichael Jerris <mike@jerris.com>
Sat, 17 Feb 2007 06:55:43 +0000 (06:55 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4309 d0543943-73ff-0310-b7d9-9358b9ac24b2

Freeswitch.sln
src/include/switch_platform.h
src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
src/switch_xml.c

index 3c34031a967caed894415e078b7dceb8663a67a2..00b82569901f1d013ecff4bbd53c381d685755ad 100644 (file)
@@ -544,6 +544,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_en", "src\mod\say\m
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "libs\portaudio\build\msvc\portaudio.vcproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}"\r
 EndProject\r
+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}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
+               {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}\r
+               {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
@@ -1054,6 +1061,12 @@ Global
                {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32\r
                {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|x64\r
                {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.Build.0 = Release|x64\r
+               {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.Build.0 = Debug|Win32\r
+               {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.ActiveCfg = Debug|Win32\r
+               {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.ActiveCfg = Release|Win32\r
+               {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.Build.0 = Release|Win32\r
+               {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.ActiveCfg = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
@@ -1137,6 +1150,7 @@ Global
                {1C453396-D912-4213-89FD-9B489162B7B5} = {A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}\r
                {CBEC7225-0C21-4DA8-978E-1F158F8AD950} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}\r
                {AB91A099-7690-4ECF-8994-E458F4EA1ED4} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}\r
+               {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}\r
                {5927104D-C14C-4AC8-925C-4AB681762E75} = {C120A020-773F-4EA3-923F-B67AF28B750D}\r
                {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D}\r
                {988CACF7-3FCB-4992-BE69-77872AE67DC8} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}\r
index 1339677b020a371ee31baf3537506ab2324d50bd..f8d1e63f81f5533859bcbaa932a385810ef55a99 100644 (file)
@@ -146,6 +146,12 @@ typedef unsigned long      in_addr_t;
 #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
index 072f41cfa8003d4d9ae8c02a60d0accdef311e31..760be404257074dfe7c2988b828c494adb20b598 100644 (file)
@@ -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 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
                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);
index 516937902841f592f7a47008269cc9775038b37c..a5a70c373db5ec1624631370f59e5789a33e88bf 100644 (file)
 #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