fix Windows projects and cyginstall

git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@920 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Moises Silva 2009-12-01 21:49:51 +00:00
parent 0ee0ff5123
commit 665aa967cd
8 changed files with 254 additions and 20 deletions

View File

@ -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

View File

@ -0,0 +1,191 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="testboost"
ProjectGUID="{2B1BAF36-0241-43E7-B865-A8338AD48E2E}"
RootNamespace="testboost"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
BuildLogFile="$(IntDir)\BuildLog-testboost.htm"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../src/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="true"
DebugInformationFormat="4"
DisableSpecificWarnings="4100"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\debug\openzap.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
BuildLogFile="$(IntDir)\BuildLog-testboost.htm"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../../src/include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4100"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\src\testboost.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -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

View File

@ -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,

View File

@ -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:

View File

@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;C:\wanpipe\include"
AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;&quot;C:\Program Files\Sangoma&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -16,36 +16,43 @@ static void handle_SIGINT(int sig)
#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");

View File

@ -2826,10 +2826,15 @@ OZ_DECLARE(zap_status_t) zap_configure_span_signaling(const char *type, zap_span
}
}
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;