mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
add basics for analog (wip)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@130 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
36
libs/freetdm/src/testanalog.c
Normal file
36
libs/freetdm/src/testanalog.c
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "openzap.h"
|
||||
#include "zap_analog.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_analog_configure_span(span, on_signal);
|
||||
zap_analog_start(span);
|
||||
|
||||
while(zap_test_flag(span->analog_data, ZAP_ANALOG_RUNNING)) {
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
zap_global_destroy();
|
||||
|
||||
}
|
Reference in New Issue
Block a user