mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 23:24:18 +00:00
dyna won't you blow your horn
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@517 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
1 parent
2973d68f37
commit
bc1ccab19c
34 files changed
+706
-354
No files matched your search
@@ -1,5 +1,4 @@
|
||||
#include "openzap.h"
|
||||
#include "zap_analog.h"
|
||||
|
||||
|
||||
static void *test_call(zap_thread_t *me, void *obj)
|
||||
@@ -59,11 +58,20 @@ static ZIO_SIGNAL_CB_FUNCTION(on_signal)
|
||||
return ZAP_SUCCESS;
|
||||
}
|
||||
|
||||
static int R = 0;
|
||||
static void handle_SIGINT(int sig)
|
||||
{
|
||||
if (sig);
|
||||
R = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
zap_span_t *span;
|
||||
int span_id;
|
||||
zap_analog_data_t *analog_data;
|
||||
int digit_timeout = 2000;
|
||||
int max_dialstr = 11;
|
||||
|
||||
if (argc < 2) {
|
||||
printf("usage %s <spanno>\n", argv[0]);
|
||||
@@ -86,19 +94,22 @@ int main(int argc, char *argv[])
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (zap_analog_configure_span(span, "us", 2000, 11, on_signal) != ZAP_SUCCESS) {
|
||||
|
||||
if (zap_configure_span("analog", span, on_signal,
|
||||
"tonemap", "te",
|
||||
"digit_timeout", &digit_timeout,
|
||||
"max_dialstr", &max_dialstr
|
||||
) == ZAP_SUCCESS) {
|
||||
zap_log(ZAP_LOG_ERROR, "Error configuring OpenZAP span\n");
|
||||
goto done;
|
||||
}
|
||||
analog_data = span->signal_data;
|
||||
zap_analog_start(span);
|
||||
|
||||
while(zap_test_flag(analog_data, ZAP_ANALOG_RUNNING)) {
|
||||
zap_span_start(span);
|
||||
|
||||
while(zap_running() && R) {
|
||||
zap_sleep(1 * 1000);
|
||||
}
|
||||
|
||||
|
||||
done:
|
||||
done:
|
||||
|
||||
zap_global_destroy();
|
||||
|
||||
|
||||
Reference in new issue
Block a user