2010-01-15 19:22:49 +00:00
|
|
|
#include "freetdm.h"
|
2009-11-17 18:06:57 +00:00
|
|
|
|
2010-01-15 20:35:11 +00:00
|
|
|
static FIO_SIGNAL_CB_FUNCTION(on_signal)
|
2009-11-17 18:06:57 +00:00
|
|
|
{
|
2010-01-15 19:22:49 +00:00
|
|
|
return FTDM_FAIL;
|
2009-11-17 18:06:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int R = 0;
|
|
|
|
#if 0
|
|
|
|
static void handle_SIGINT(int sig)
|
|
|
|
{
|
|
|
|
if (sig);
|
|
|
|
R = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2010-01-15 19:22:49 +00:00
|
|
|
ftdm_span_t *span;
|
2009-11-17 18:06:57 +00:00
|
|
|
int local_port, remote_port;
|
|
|
|
|
|
|
|
local_port = remote_port = 53000;
|
|
|
|
|
2010-01-15 19:22:49 +00:00
|
|
|
ftdm_global_set_default_logger(FTDM_LOG_LEVEL_DEBUG);
|
2009-11-17 18:06:57 +00:00
|
|
|
|
|
|
|
if (argc < 2) {
|
|
|
|
printf("umm no\n");
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2010-01-15 19:22:49 +00:00
|
|
|
if (ftdm_global_init() != FTDM_SUCCESS) {
|
2010-01-15 19:56:54 +00:00
|
|
|
fprintf(stderr, "Error loading FreeTDM\n");
|
2009-11-17 18:06:57 +00:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2010-01-15 19:22:49 +00:00
|
|
|
if (ftdm_global_configuration() != FTDM_SUCCESS) {
|
2010-01-15 19:56:54 +00:00
|
|
|
fprintf(stderr, "Error configuring FreeTDM\n");
|
2009-11-17 18:06:57 +00:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2010-01-15 19:56:54 +00:00
|
|
|
printf("FreeTDM loaded\n");
|
2009-11-17 18:06:57 +00:00
|
|
|
|
2010-01-15 19:22:49 +00:00
|
|
|
if (ftdm_span_find(atoi(argv[1]), &span) != FTDM_SUCCESS) {
|
2010-01-15 19:56:54 +00:00
|
|
|
fprintf(stderr, "Error finding FreeTDM span\n");
|
2009-11-17 18:06:57 +00:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 1
|
|
|
|
if (1) {
|
2010-01-15 19:22:49 +00:00
|
|
|
if (ftdm_configure_span("sangoma_boost", span, on_signal,
|
2009-11-17 18:06:57 +00:00
|
|
|
"sigmod", "sangoma_brid",
|
|
|
|
"local_port", &local_port,
|
|
|
|
"remote_ip", "127.0.0.66",
|
|
|
|
"remote_port", &remote_port,
|
2010-01-15 19:22:49 +00:00
|
|
|
TAG_END) == FTDM_SUCCESS) {
|
|
|
|
ftdm_span_start(span);
|
2009-11-17 18:06:57 +00:00
|
|
|
|
|
|
|
} else {
|
|
|
|
fprintf(stderr, "Error starting sangoma_boost\n");
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-01-15 19:22:49 +00:00
|
|
|
while(ftdm_running() && R) {
|
|
|
|
ftdm_sleep(1 * 1000);
|
2009-11-17 18:06:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
2010-01-15 19:22:49 +00:00
|
|
|
ftdm_global_destroy();
|
2009-11-17 18:06:57 +00:00
|
|
|
|
|
|
|
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:
|
|
|
|
*/
|