From 29f6db19afe5646234589ea3eb17a917d750f80d Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 17 Nov 2009 18:06:57 +0000 Subject: [PATCH] added git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@877 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/freetdm/src/testsangomaboost.c | 85 +++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 libs/freetdm/src/testsangomaboost.c diff --git a/libs/freetdm/src/testsangomaboost.c b/libs/freetdm/src/testsangomaboost.c new file mode 100644 index 0000000000..a0b02792c4 --- /dev/null +++ b/libs/freetdm/src/testsangomaboost.c @@ -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: + */