mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
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:
@@ -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,
|
||||
|
@@ -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:
|
||||
|
@@ -41,7 +41,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;C:\wanpipe\include"
|
||||
AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;"C:\Program Files\Sangoma""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
|
@@ -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");
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user