From 8377f1b192142189b02b7941ecaf4c86d59a0bee Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sun, 27 May 2007 04:42:10 +0000 Subject: [PATCH] update windows build. git-svn-id: http://svn.openzap.org/svn/openzap/trunk@161 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/msvc/openzap.vcproj | 467 ++++++++++++++++++ .../openzap/msvc/testanalog/testanalog.vcproj | 189 +++++++ libs/openzap/msvc/testisdn/testisdn.vcproj | 189 +++++++ libs/openzap/openzap.sln | 46 ++ libs/openzap/openzap.vcproj | 447 ----------------- libs/openzap/src/include/openzap.h | 1 + libs/openzap/src/testanalog.c | 5 +- libs/openzap/src/testisdn.c | 2 +- libs/openzap/src/zap_analog.c | 4 +- 9 files changed, 899 insertions(+), 451 deletions(-) create mode 100644 libs/openzap/msvc/openzap.vcproj create mode 100644 libs/openzap/msvc/testanalog/testanalog.vcproj create mode 100644 libs/openzap/msvc/testisdn/testisdn.vcproj create mode 100644 libs/openzap/openzap.sln delete mode 100644 libs/openzap/openzap.vcproj diff --git a/libs/openzap/msvc/openzap.vcproj b/libs/openzap/msvc/openzap.vcproj new file mode 100644 index 0000000000..f4917c18a3 --- /dev/null +++ b/libs/openzap/msvc/openzap.vcproj @@ -0,0 +1,467 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/openzap/msvc/testanalog/testanalog.vcproj b/libs/openzap/msvc/testanalog/testanalog.vcproj new file mode 100644 index 0000000000..df5ccd2fba --- /dev/null +++ b/libs/openzap/msvc/testanalog/testanalog.vcproj @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/openzap/msvc/testisdn/testisdn.vcproj b/libs/openzap/msvc/testisdn/testisdn.vcproj new file mode 100644 index 0000000000..dac179de1a --- /dev/null +++ b/libs/openzap/msvc/testisdn/testisdn.vcproj @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/openzap/openzap.sln b/libs/openzap/openzap.sln new file mode 100644 index 0000000000..873dd25d72 --- /dev/null +++ b/libs/openzap/openzap.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openzap", "msvc\openzap.vcproj", "{93B8812C-3EC4-4F78-8970-FFBFC99E167D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Unix Makefiles", "Unix Makefiles", "{214C60D6-6E30-4912-B919-DB76A20CC682}" + ProjectSection(SolutionItems) = preProject + general.makefile = general.makefile + Makefile = Makefile + wanpipe = wanpipe + zt = zt + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testanalog", "msvc\testanalog\testanalog.vcproj", "{BB833648-BAFF-4BE2-94DB-F8BB043C588C}" + ProjectSection(ProjectDependencies) = postProject + {93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testisdn", "msvc\testisdn\testisdn.vcproj", "{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}" + ProjectSection(ProjectDependencies) = postProject + {93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Debug|Win32.ActiveCfg = Debug|Win32 + {93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Debug|Win32.Build.0 = Debug|Win32 + {93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Release|Win32.ActiveCfg = Release|Win32 + {93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Release|Win32.Build.0 = Release|Win32 + {BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Debug|Win32.ActiveCfg = Debug|Win32 + {BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Debug|Win32.Build.0 = Debug|Win32 + {BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Release|Win32.ActiveCfg = Release|Win32 + {BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Release|Win32.Build.0 = Release|Win32 + {6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Debug|Win32.ActiveCfg = Debug|Win32 + {6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Debug|Win32.Build.0 = Debug|Win32 + {6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Release|Win32.ActiveCfg = Release|Win32 + {6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libs/openzap/openzap.vcproj b/libs/openzap/openzap.vcproj deleted file mode 100644 index aaacf7578b..0000000000 --- a/libs/openzap/openzap.vcproj +++ /dev/null @@ -1,447 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libs/openzap/src/include/openzap.h b/libs/openzap/src/include/openzap.h index db2c3ba5d4..3475997c50 100644 --- a/libs/openzap/src/include/openzap.h +++ b/libs/openzap/src/include/openzap.h @@ -74,6 +74,7 @@ /* disable warning for zero length array in a struct */ /* this will cause errors on c99 and ansi compliant compilers and will need to be fixed in the wanpipe header files */ #pragma warning(disable:4706) +#pragma comment(lib, "Winmm") #endif #define ZAP_ENUM_NAMES(_NAME, _STRINGS) static char * _NAME [] = { _STRINGS , NULL }; diff --git a/libs/openzap/src/testanalog.c b/libs/openzap/src/testanalog.c index 9670564348..82e9e8df89 100644 --- a/libs/openzap/src/testanalog.c +++ b/libs/openzap/src/testanalog.c @@ -9,7 +9,7 @@ static void *test_call(zap_thread_t *me, void *obj) zap_size_t len; - sleep(10); + zap_sleep(10 * 1000); zap_log(ZAP_LOG_DEBUG, "answer call and start echo test\n"); @@ -38,6 +38,7 @@ static void *test_call(zap_thread_t *me, void *obj) zap_log(ZAP_LOG_DEBUG, "call over\n"); + return 0; } static ZIO_SIGNAL_CB_FUNCTION(on_signal) @@ -78,7 +79,7 @@ int main(int argc, char *argv[]) zap_analog_start(span); while(zap_test_flag(span->analog_data, ZAP_ANALOG_RUNNING)) { - sleep(1); + zap_sleep(1 * 1000); } zap_global_destroy(); diff --git a/libs/openzap/src/testisdn.c b/libs/openzap/src/testisdn.c index 78f3e18a41..d268436eb5 100644 --- a/libs/openzap/src/testisdn.c +++ b/libs/openzap/src/testisdn.c @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) } while(zap_test_flag(span->isdn_data, ZAP_ISDN_RUNNING)) { - sleep(1); + zap_sleep(1 * 1000); } done: diff --git a/libs/openzap/src/zap_analog.c b/libs/openzap/src/zap_analog.c index 21702cafed..0377fc4ad9 100644 --- a/libs/openzap/src/zap_analog.c +++ b/libs/openzap/src/zap_analog.c @@ -88,7 +88,7 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj) zap_size_t len, rlen; zap_tone_type_t tt = ZAP_TONE_DTMF; char dtmf[128]; - int dtmf_offset = 0; + zap_size_t dtmf_offset = 0; zap_analog_data_t *data = chan->span->analog_data; zap_channel_t *closed_chan; uint32_t state_counter = 0, elapsed = 0, interval = 0, last_digit = 0, indicate = 0; @@ -97,6 +97,8 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj) zap_log(ZAP_LOG_DEBUG, "ANALOG CHANNEL thread starting.\n"); + ts.buffer = NULL; + if (zap_channel_open_chan(chan) != ZAP_SUCCESS) { goto done; }