mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-06 19:58:34 +00:00
37 lines
646 B
C
37 lines
646 B
C
|
#include "openzap.h"
|
||
|
#include "zap_isdn.h"
|
||
|
|
||
|
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
|
||
|
{
|
||
|
return ZAP_FAIL;
|
||
|
}
|
||
|
|
||
|
int main(int argc, char *argv[])
|
||
|
{
|
||
|
zap_span_t *span;
|
||
|
|
||
|
zap_global_set_default_logger(ZAP_LOG_LEVEL_DEBUG);
|
||
|
|
||
|
if (zap_global_init() != ZAP_SUCCESS) {
|
||
|
fprintf(stderr, "Error loading OpenZAP\n");
|
||
|
exit(-1);
|
||
|
}
|
||
|
|
||
|
printf("OpenZAP loaded\n");
|
||
|
|
||
|
if (zap_span_find("wanpipe", 1, &span) != ZAP_SUCCESS) {
|
||
|
fprintf(stderr, "Error finding OpenZAP span\n");
|
||
|
}
|
||
|
|
||
|
|
||
|
zap_isdn_configure_span(span, Q931_TE, 0, on_signal);
|
||
|
zap_isdn_start(span);
|
||
|
|
||
|
while(zap_test_flag(span->isdn_data, ZAP_ISDN_RUNNING)) {
|
||
|
sleep(1);
|
||
|
}
|
||
|
|
||
|
zap_global_destroy();
|
||
|
|
||
|
}
|