diff --git a/libs/freetdm/cyginstall.sh b/libs/freetdm/cyginstall.sh
index 1bd6510488..eac467d142 100644
--- a/libs/freetdm/cyginstall.sh
+++ b/libs/freetdm/cyginstall.sh
@@ -2,7 +2,8 @@
# this script must be run from openzap root dir and it is assuming
# FreeSWITCH is trunk is located at ../../
fsdir=../..
-
+set -x
cp Debug/*.dll $fsdir/Debug/
cp Debug/mod/*.dll $fsdir/Debug/mod/
+set +x
diff --git a/libs/freetdm/msvc/testboost/testboost.2008.vcproj b/libs/freetdm/msvc/testboost/testboost.2008.vcproj
new file mode 100644
index 0000000000..b41bf86051
--- /dev/null
+++ b/libs/freetdm/msvc/testboost/testboost.2008.vcproj
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/libs/freetdm/openzap.2008.sln b/libs/freetdm/openzap.2008.sln
index af52100966..a40ff30137 100644
--- a/libs/freetdm/openzap.2008.sln
+++ b/libs/freetdm/openzap.2008.sln
@@ -42,6 +42,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ozmod_wanpipe", "src\ozmod\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ozmod_sangoma_boost", "src\ozmod\ozmod_sangoma_boost\ozmod_sangoma_boost.2008.vcproj", "{D021EF2A-460D-4827-A0F7-41FDECF46F1B}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testboost", "msvc\testboost\testboost.2008.vcproj", "{2B1BAF36-0241-43E7-B865-A8338AD48E2E}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -84,6 +86,10 @@ Global
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Debug|Win32.Build.0 = Debug|Win32
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Release|Win32.ActiveCfg = Release|Win32
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Release|Win32.Build.0 = Release|Win32
+ {2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Debug|Win32.Build.0 = Debug|Win32
+ {2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Release|Win32.ActiveCfg = Release|Win32
+ {2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/libs/freetdm/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c b/libs/freetdm/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c
index f40669d928..99df5c27cb 100644
--- a/libs/freetdm/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c
+++ b/libs/freetdm/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c
@@ -1211,7 +1211,7 @@ static __inline__ void check_state(zap_span_t *span)
* \brief Checks for events on a span
* \param span Span to check for events
*/
-static __inline__ void check_events(zap_span_t *span, int ms_timeout)
+static __inline__ zap_status_t check_events(zap_span_t *span, int ms_timeout)
{
zap_status_t status;
zap_sigmsg_t sigmsg;
@@ -1252,14 +1252,18 @@ static __inline__ void check_events(zap_span_t *span, int ms_timeout)
break;
case ZAP_FAIL:
{
- zap_log(ZAP_LOG_DEBUG, "Boost Check Event Failure Failure! %d\n", zap_running());
+ if (!zap_running()) {
+ break;
+ }
+ zap_log(ZAP_LOG_ERROR, "Boost Check Event Failure Failure: %s\n", span->last_error);
+ return ZAP_FAIL;
}
break;
default:
break;
}
- return;
+ return ZAP_SUCCESS;
}
/**
@@ -1271,9 +1275,15 @@ static void *zap_sangoma_events_run(zap_thread_t *me, void *obj)
{
zap_span_t *span = (zap_span_t *) obj;
zap_sangoma_boost_data_t *sangoma_boost_data = span->signal_data;
+ unsigned errs = 0;
while (zap_test_flag(sangoma_boost_data, ZAP_SANGOMA_BOOST_RUNNING) && zap_running()) {
- check_events(span,100);
+ if (check_events(span,100) != ZAP_SUCCESS) {
+ if (errs++ > 50) {
+ zap_log(ZAP_LOG_ERROR, "Too many event errors, quitting sangoma events thread\n");
+ return NULL;
+ }
+ }
}
return NULL;
@@ -1844,7 +1854,7 @@ static ZIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(zap_sangoma_boost_configure_span)
/**
* \brief Openzap sangoma boost signaling module definition
*/
-zap_module_t zap_module = {
+EX_DECLARE_DATA zap_module_t zap_module = {
/*.name =*/ "sangoma_boost",
/*.io_load =*/ NULL,
/*.io_unload =*/ NULL,
diff --git a/libs/freetdm/src/ozmod/ozmod_sangoma_boost/sangoma_boost_interface.h b/libs/freetdm/src/ozmod/ozmod_sangoma_boost/sangoma_boost_interface.h
index c337995dca..8757adcab3 100644
--- a/libs/freetdm/src/ozmod/ozmod_sangoma_boost/sangoma_boost_interface.h
+++ b/libs/freetdm/src/ozmod/ozmod_sangoma_boost/sangoma_boost_interface.h
@@ -37,6 +37,11 @@
#include "openzap.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*!
\brief Callback used to notify signaling status changes on a channel
\param zchan The openzap channel where the signaling status just changed
@@ -188,11 +193,20 @@ typedef struct boost_sigmod_interface_s {
void *pvt;
} boost_sigmod_interface_t;
+#ifdef __cplusplus
+} // extern C
+#endif
+
#define BOOST_INTERFACE_NAME boost_sigmod_interface
#define BOOST_INTERFACE_NAME_STR "boost_sigmod_interface"
/* use this in your sig boost module to declare your interface */
+#ifndef WIN32
#define BOOST_INTERFACE boost_sigmod_interface_t BOOST_INTERFACE_NAME
+#else
+#define BOOST_INTERFACE __declspec(dllexport) boost_sigmod_interface_t BOOST_INTERFACE_NAME
#endif
+#endif
+
/* For Emacs:
* Local Variables:
diff --git a/libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.2008.vcproj b/libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.2008.vcproj
index eb4cecb32d..5802643fec 100644
--- a/libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.2008.vcproj
+++ b/libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.2008.vcproj
@@ -41,7 +41,7 @@
configure_span_signaling) {
+ if (!mod) {
+ zap_log(ZAP_LOG_ERROR, "Failed to load module type: %s\n", type);
+ return ZAP_FAIL;
+ }
+
+ if (mod->configure_span_signaling) {
status = mod->configure_span_signaling(span, sig_cb, parameters);
} else {
- zap_log(ZAP_LOG_ERROR, "can't find module '%s' or the module did not implement the signaling configuration method\n", type);
+ zap_log(ZAP_LOG_ERROR, "Module %s did not implement the signaling configuration method\n", type);
}
return status;