# 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
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9.00"\r
+ Name="testboost"\r
+ ProjectGUID="{2B1BAF36-0241-43E7-B865-A8338AD48E2E}"\r
+ RootNamespace="testboost"\r
+ Keyword="Win32Proj"\r
+ TargetFrameworkVersion="131072"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ BuildLogFile="$(IntDir)\BuildLog-testboost.htm"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories="../../src/include"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="4"\r
+ DisableSpecificWarnings="4100"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="..\..\debug\openzap.lib"\r
+ LinkIncremental="2"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
+ BuildLogFile="$(IntDir)\BuildLog-testboost.htm"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ AdditionalIncludeDirectories="../../src/include"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+ RuntimeLibrary="2"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="4"\r
+ WarnAsError="true"\r
+ DebugInformationFormat="3"\r
+ DisableSpecificWarnings="4100"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ LinkIncremental="1"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath="..\..\src\testboost.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ozmod_sangoma_boost", "src\ozmod\ozmod_sangoma_boost\ozmod_sangoma_boost.2008.vcproj", "{D021EF2A-460D-4827-A0F7-41FDECF46F1B}"\r
EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testboost", "msvc\testboost\testboost.2008.vcproj", "{2B1BAF36-0241-43E7-B865-A8338AD48E2E}"\r
+EndProject\r
Global\r
GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
Debug|Win32 = Debug|Win32\r
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Debug|Win32.Build.0 = Debug|Win32\r
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Release|Win32.ActiveCfg = Release|Win32\r
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Release|Win32.Build.0 = Release|Win32\r
+ {2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Debug|Win32.Build.0 = Debug|Win32\r
+ {2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Release|Win32.ActiveCfg = Release|Win32\r
+ {2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Release|Win32.Build.0 = Release|Win32\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
* \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;
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;
}
/**
{
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;
/**
* \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,
#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
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:
* mode:c
<Tool\r
Name="VCCLCompilerTool"\r
Optimization="0"\r
- AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;C:\wanpipe\include"\r
+ AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;"C:\Program Files\Sangoma""\r
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"\r
MinimalRebuild="true"\r
BasicRuntimeChecks="3"\r
#endif
int main(int argc, char *argv[])
{
+ zap_conf_parameter_t parameters[20];
zap_span_t *span;
int local_port, remote_port;
local_port = remote_port = 53000;
zap_global_set_default_logger(ZAP_LOG_LEVEL_DEBUG);
-
+#if 0
if (argc < 2) {
- printf("umm no\n");
+ printf("invalid arguments\n");
exit(-1);
}
+#endif
if (zap_global_init() != ZAP_SUCCESS) {
fprintf(stderr, "Error loading OpenZAP\n");
exit(-1);
}
+ if (zap_global_configuration() != ZAP_SUCCESS) {
+ fprintf(stderr, "Error configuring OpenZAP\n");
+ exit(-1);
+ }
printf("OpenZAP loaded\n");
- if (zap_span_find(atoi(argv[1]), &span) != ZAP_SUCCESS) {
- fprintf(stderr, "Error finding OpenZAP span\n");
+ if (zap_span_find_by_name("wp1", &span) != ZAP_SUCCESS) {
+ fprintf(stderr, "Error finding OpenZAP span %s\n", argv[1]);
goto done;
}
-
- if (zap_configure_span("ss7_boost", span, on_signal,
- "local_ip", "127.0.0.65",
- "local_port", &local_port,
- "remote_ip", "127.0.0.66",
- "remote_port", &remote_port,
- TAG_END) == ZAP_SUCCESS) {
+ parameters[0].var = "sigmod";
+ parameters[0].val = "sangoma_prid";
+ parameters[1].var = "switchtype";
+ parameters[1].val = "euroisdn";
+ parameters[1].var = "signalling";
+ parameters[1].val = "pri_cpe";
+ parameters[2].var = NULL;
+ if (zap_configure_span_signaling("sangoma_boost", span, on_signal, parameters) == ZAP_SUCCESS) {
zap_span_start(span);
} else {
fprintf(stderr, "Error starting SS7_BOOST\n");
}
}
- if (mod && mod->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;