added
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@877 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
fadd0826c7
commit
29f6db19af
|
@ -0,0 +1,85 @@
|
|||
#include "openzap.h"
|
||||
|
||||
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
|
||||
{
|
||||
return ZAP_FAIL;
|
||||
}
|
||||
|
||||
static int R = 0;
|
||||
#if 0
|
||||
static void handle_SIGINT(int sig)
|
||||
{
|
||||
if (sig);
|
||||
R = 0;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
zap_span_t *span;
|
||||
int local_port, remote_port;
|
||||
|
||||
local_port = remote_port = 53000;
|
||||
|
||||
zap_global_set_default_logger(ZAP_LOG_LEVEL_DEBUG);
|
||||
|
||||
if (argc < 2) {
|
||||
printf("umm no\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
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");
|
||||
goto done;
|
||||
}
|
||||
|
||||
#if 1
|
||||
if (1) {
|
||||
if (zap_configure_span("sangoma_boost", span, on_signal,
|
||||
"sigmod", "sangoma_brid",
|
||||
"local_port", &local_port,
|
||||
"remote_ip", "127.0.0.66",
|
||||
"remote_port", &remote_port,
|
||||
TAG_END) == ZAP_SUCCESS) {
|
||||
zap_span_start(span);
|
||||
|
||||
} else {
|
||||
fprintf(stderr, "Error starting sangoma_boost\n");
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
while(zap_running() && R) {
|
||||
zap_sleep(1 * 1000);
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
zap_global_destroy();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
* indent-tabs-mode:t
|
||||
* tab-width:4
|
||||
* c-basic-offset:4
|
||||
* End:
|
||||
* For VIM:
|
||||
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
|
||||
*/
|
Loading…
Reference in New Issue