From 7d75e8df8934ee18a1050536e58c7e20ee04e16b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 19 Nov 2008 17:34:32 +0000 Subject: [PATCH] close OPENZAP-31 git-svn-id: http://svn.openzap.org/svn/openzap/trunk@611 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c | 8 ++++---- libs/openzap/src/ozmod/ozmod_analog/zap_analog.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c index ad6bd60b48..15cd842027 100644 --- a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c +++ b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c @@ -85,7 +85,7 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_analog_configure_span) const char *tonemap = "us"; const char *hotline = ""; uint32_t digit_timeout = 10; - uint32_t max_dialstr = 11; + uint32_t max_dialstr = MAX_DTMF; const char *var, *val; int *intval; uint32_t flags = ZAP_ANALOG_CALLERID; @@ -143,8 +143,8 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_analog_configure_span) digit_timeout = 2000; } - if ((max_dialstr < 2 && !strlen(hotline)) || max_dialstr > 20) { - max_dialstr = 11; + if ((max_dialstr < 1 && !strlen(hotline)) || max_dialstr > MAX_DTMF) { + max_dialstr = MAX_DTMF; } span->start = zap_analog_start; @@ -228,7 +228,7 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj) uint8_t frame[1024]; zap_size_t len, rlen; zap_tone_type_t tt = ZAP_TONE_DTMF; - char dtmf[128] = ""; + char dtmf[MAX_DTMF+1] = ""; zap_size_t dtmf_offset = 0; zap_analog_data_t *analog_data = zchan->span->signal_data; zap_channel_t *closed_chan; diff --git a/libs/openzap/src/ozmod/ozmod_analog/zap_analog.h b/libs/openzap/src/ozmod/ozmod_analog/zap_analog.h index 6fde39e9ca..b48b168e69 100644 --- a/libs/openzap/src/ozmod/ozmod_analog/zap_analog.h +++ b/libs/openzap/src/ozmod/ozmod_analog/zap_analog.h @@ -41,6 +41,7 @@ typedef enum { } zap_analog_flag_t; #define ZAP_MAX_HOTLINE_STR 20 +#define MAX_DTMF 256 struct zap_analog_data { uint32_t flags;