From 8202ffd5784e8f7bf43300f5a49e2758dd3e8523 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 8 Sep 2008 23:01:44 +0000 Subject: [PATCH] fix config parser and build on some systems git-svn-id: http://svn.openzap.org/svn/openzap/trunk@547 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/Makefile.in | 2 +- libs/openzap/mod_openzap/mod_openzap.c | 2 +- .../src/ozmod/ozmod_analog/ozmod_analog.c | 17 +++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libs/openzap/Makefile.in b/libs/openzap/Makefile.in index 63c1a4d6e3..a9263de5cf 100644 --- a/libs/openzap/Makefile.in +++ b/libs/openzap/Makefile.in @@ -40,7 +40,7 @@ SOLINK = @SOLINK@ OZ_SRCDIR=@oz_srcdir@ oz_builddir=@oz_builddir@ SRC=src -top_builddir=@top_builddir@ +top_builddir=@oz_builddir@ INSTALL=@INSTALL@ LIBTOOL=@LIBTOOL@ LTINSTALL=$(LIBTOOL) --mode=install $(INSTALL) diff --git a/libs/openzap/mod_openzap/mod_openzap.c b/libs/openzap/mod_openzap/mod_openzap.c index 94dd0f9f23..86a16f72d3 100644 --- a/libs/openzap/mod_openzap/mod_openzap.c +++ b/libs/openzap/mod_openzap/mod_openzap.c @@ -1547,7 +1547,7 @@ static switch_status_t load_config(void) } else if (!strcasecmp(var, "hold-music")) { hold_music = val; } else if (!strcasecmp(var, "max_digits") || !strcasecmp(var, "max-digits")) { - digit_timeout = val; + max_digits = val; } else if (!strcasecmp(var, "enable-analog-option")) { analog_options = enable_analog_option(val, analog_options); } diff --git a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c index 6bf8b86977..167c230220 100644 --- a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c +++ b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c @@ -95,14 +95,6 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_analog_configure_span) return ZAP_FAIL; } - if (digit_timeout < 2000 || digit_timeout > 10000) { - digit_timeout = 2000; - } - - if (max_dialstr < 2 || max_dialstr > 20) { - max_dialstr = 11; - } - analog_data = malloc(sizeof(*analog_data)); memset(analog_data, 0, sizeof(*analog_data)); assert(analog_data != NULL); @@ -126,6 +118,15 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_analog_configure_span) } } + + if (digit_timeout < 2000 || digit_timeout > 10000) { + digit_timeout = 2000; + } + + if (max_dialstr < 2 || max_dialstr > 20) { + max_dialstr = 11; + } + span->start = zap_analog_start; analog_data->digit_timeout = digit_timeout; analog_data->max_dialstr = max_dialstr;