From f2099bf999fae87962fcd8f4902e7729ebc6e54f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 8 Sep 2011 08:12:07 -0500 Subject: [PATCH] FS-3529 please try this revision I suspect its related to some uninitilized memory causing flags to be set that are not in the dtmf structure in certian cases --- src/mod/applications/mod_fax/mod_fax.c | 2 +- src/mod/applications/mod_spandsp/mod_spandsp_dsp.c | 2 +- src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp | 2 +- src/mod/endpoints/mod_skypopen/mod_skypopen.c | 2 +- src/switch_ivr.c | 2 +- src/switch_ivr_async.c | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mod/applications/mod_fax/mod_fax.c b/src/mod/applications/mod_fax/mod_fax.c index a899d270fc..340a497a23 100644 --- a/src/mod/applications/mod_fax/mod_fax.c +++ b/src/mod/applications/mod_fax/mod_fax.c @@ -1329,7 +1329,7 @@ static switch_bool_t inband_dtmf_callback(switch_media_bug_t *bug, void *user_da if (digit_str[0]) { char *p = digit_str; while (p && *p) { - switch_dtmf_t dtmf; + switch_dtmf_t dtmf = {0}; dtmf.digit = *p; dtmf.duration = switch_core_default_dtmf_duration(0); switch_channel_queue_dtmf(channel, &dtmf); diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c index 8a31a9272d..bed6c1021b 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c @@ -52,7 +52,7 @@ static void spandsp_dtmf_rx_realtime_callback(void *user_data, int code, int lev if (digit) { /* prevent duplicate DTMF */ if (digit != pvt->last_digit || (pvt->samples - pvt->last_digit_end) > pvt->min_dup_digit_spacing) { - switch_dtmf_t dtmf; + switch_dtmf_t dtmf = {0}; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "DTMF BEGIN DETECTED: [%c]\n", digit); pvt->last_digit = digit; dtmf.digit = digit; diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp index fe1f7cb8c0..4033577f7c 100644 --- a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp +++ b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp @@ -928,7 +928,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch switch_channel_t *channel = switch_core_session_get_channel(session); while (p && *p) { - switch_dtmf_t dtmf; + switch_dtmf_t dtmf = {0}; dtmf.digit = *p; dtmf.duration = SWITCH_DEFAULT_DTMF_DURATION; switch_channel_queue_dtmf(channel, &dtmf); diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen.c b/src/mod/endpoints/mod_skypopen/mod_skypopen.c index 4f095ff886..a5d90d0c50 100644 --- a/src/mod/endpoints/mod_skypopen/mod_skypopen.c +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen.c @@ -943,7 +943,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch if(channel){ while (p && *p) { - switch_dtmf_t dtmf; + switch_dtmf_t dtmf = {0}; dtmf.digit = *p; dtmf.duration = SWITCH_DEFAULT_DTMF_DURATION; switch_channel_queue_dtmf(channel, &dtmf); diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 56397ede5c..b7f4a38b71 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -241,7 +241,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, if (args) { - switch_dtmf_t dtmf; + switch_dtmf_t dtmf = {0}; /* dtmf handler function you can hook up to be executed when a digit is dialed during playback diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index c99d332c7f..b5d0591ec5 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -566,7 +566,7 @@ SWITCH_DECLARE(void) switch_ivr_session_echo(switch_core_session_t *session, swi switch_ivr_parse_all_events(session); if (args && (args->input_callback || args->buf || args->buflen)) { - switch_dtmf_t dtmf; + switch_dtmf_t dtmf = {0}; /* dtmf handler function you can hook up to be executed when a digit is dialed during playback @@ -2154,7 +2154,7 @@ static switch_bool_t inband_dtmf_callback(switch_media_bug_t *bug, void *user_da if (digit_str[0]) { char *p = digit_str; while (p && *p) { - switch_dtmf_t dtmf; + switch_dtmf_t dtmf = {0}; dtmf.digit = *p; dtmf.duration = switch_core_default_dtmf_duration(0); dtmf.source = SWITCH_DTMF_INBAND_AUDIO; @@ -3188,7 +3188,7 @@ static void *SWITCH_THREAD_FUNC speech_thread(switch_thread_t *thread, void *obj } if (is_dtmf(c)) { - switch_dtmf_t dtmf; + switch_dtmf_t dtmf = {0}; dtmf.digit = c; dtmf.duration = switch_core_default_dtmf_duration(0); dtmf.source = SWITCH_DTMF_INBAND_AUDIO;