2008-02-27 00:05:52 +00:00
|
|
|
#include "openzap.h"
|
|
|
|
|
|
|
|
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
|
|
|
|
{
|
|
|
|
return ZAP_FAIL;
|
|
|
|
}
|
|
|
|
|
2008-08-29 15:58:59 +00:00
|
|
|
static int R = 0;
|
2008-09-06 05:46:14 +00:00
|
|
|
#if 0
|
2008-08-29 15:58:59 +00:00
|
|
|
static void handle_SIGINT(int sig)
|
|
|
|
{
|
|
|
|
if (sig);
|
|
|
|
R = 0;
|
|
|
|
return;
|
|
|
|
}
|
2008-09-06 05:46:14 +00:00
|
|
|
#endif
|
2008-02-27 00:05:52 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
zap_span_t *span;
|
2008-08-29 15:58:59 +00:00
|
|
|
int local_port, remote_port;
|
|
|
|
|
|
|
|
local_port = remote_port = 53000;
|
2008-02-27 00:05:52 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("OpenZAP loaded\n");
|
|
|
|
|
|
|
|
if (zap_span_find(atoi(argv[1]), &span) != ZAP_SUCCESS) {
|
|
|
|
fprintf(stderr, "Error finding OpenZAP span\n");
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2008-08-29 15:58:59 +00:00
|
|
|
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",
|
2008-08-29 20:41:17 +00:00
|
|
|
"remote_port", &remote_port,
|
|
|
|
TAG_END) == ZAP_SUCCESS) {
|
2008-08-29 15:58:59 +00:00
|
|
|
zap_span_start(span);
|
2008-02-27 00:05:52 +00:00
|
|
|
} else {
|
|
|
|
fprintf(stderr, "Error starting SS7_BOOST\n");
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2008-08-29 15:58:59 +00:00
|
|
|
while(zap_running() && R) {
|
2008-02-27 00:05:52 +00:00
|
|
|
zap_sleep(1 * 1000);
|
|
|
|
}
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
|
|
|
zap_global_destroy();
|
|
|
|
|
2008-09-06 05:46:14 +00:00
|
|
|
return 0;
|
2008-02-27 00:05:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* For Emacs:
|
|
|
|
* Local Variables:
|
|
|
|
* mode:c
|
|
|
|
* indent-tabs-mode:t
|
|
|
|
* tab-width:4
|
|
|
|
* c-basic-offset:4
|
|
|
|
* End:
|
|
|
|
* For VIM:
|
2009-09-14 22:06:20 +00:00
|
|
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
|
2008-02-27 00:05:52 +00:00
|
|
|
*/
|