From dc1e8512148bc6425643d24d792e561e24397094 Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Tue, 26 Mar 2019 22:39:04 +0000 Subject: [PATCH] =?UTF-8?q?FS-9264:=20FS-10976:=20fix=20detect=5Faudio,=20?= =?UTF-8?q?detect=5Fsilence=20and=20wait=5Ffor=5Fsilence=5Ffunction=20dial?= =?UTF-8?q?plan=20apps=20(thanks=20Sergey=20KHripchenko=20and=20Herv=C3=A9?= =?UTF-8?q?=20D=C3=A9prez=20for=20pointing=20these=20out)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mod/applications/mod_dptools/mod_dptools.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 082a8f81c5..50601be2fc 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -4570,7 +4570,7 @@ SWITCH_STANDARD_APP(wait_for_silence_function) char *lbuf = NULL; if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data)) - && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 3) { + && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 4) { thresh = atoi(argv[0]); silence_hits = atoi(argv[1]); listen_hits = atoi(argv[2]); @@ -4592,7 +4592,7 @@ SWITCH_STANDARD_APP(wait_for_silence_function) #define DETECT_AUDIO_SYNTAX " []" SWITCH_STANDARD_APP(detect_audio_function) { - char *argv[5] = { 0 }; + char *argv[4] = { 0 }; uint32_t thresh, audio_hits, timeout_ms = 0; int argc; char *lbuf = NULL; @@ -4603,12 +4603,8 @@ SWITCH_STANDARD_APP(detect_audio_function) audio_hits = atoi(argv[1]); timeout_ms = atoi(argv[2]); - if (argv[3]) { - timeout_ms = switch_atoui(argv[3]); - } - if (thresh > 0 && audio_hits > 0) { - switch_ivr_detect_audio(session, thresh, audio_hits, timeout_ms, argv[4]); + switch_ivr_detect_audio(session, thresh, audio_hits, timeout_ms, argv[3]); return; } @@ -4620,7 +4616,7 @@ SWITCH_STANDARD_APP(detect_audio_function) #define DETECT_SILENCE_SYNTAX " []" SWITCH_STANDARD_APP(detect_silence_function) { - char *argv[5] = { 0 }; + char *argv[4] = { 0 }; uint32_t thresh, silence_hits, timeout_ms = 0; int argc; char *lbuf = NULL; @@ -4631,12 +4627,8 @@ SWITCH_STANDARD_APP(detect_silence_function) silence_hits = atoi(argv[1]); timeout_ms = atoi(argv[2]); - if (argv[3]) { - timeout_ms = switch_atoui(argv[3]); - } - if (thresh > 0 && silence_hits > 0) { - switch_ivr_detect_silence(session, thresh, silence_hits, timeout_ms, argv[4]); + switch_ivr_detect_silence(session, thresh, silence_hits, timeout_ms, argv[3]); return; }