]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix parsing of dtmf string
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 27 Oct 2011 16:46:33 +0000 (11:46 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 27 Oct 2011 16:46:37 +0000 (11:46 -0500)
src/switch_core_io.c

index a36d55776b43ff6a72945fc2b1dd92201d9e45f2..e27bf86d0ffac298dc2d36d0586c43fb289ee67f 100644 (file)
@@ -1435,7 +1435,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core
                dur = switch_core_default_dtmf_duration(0) / 8;
                if ((p = strchr(argv[i], '@'))) {
                        *p++ = '\0';
-                       if ((dur = atoi(p)) > 50) {
+                       if ((dur = atoi(p)) > (int)switch_core_min_dtmf_duration(0) / 8) {
                                dtmf.duration = dur * 8;
                        }
                }
@@ -1444,7 +1444,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core
                for (p = argv[i]; p && *p; p++) {
                        if (is_dtmf(*p)) {
                                dtmf.digit = *p;
-
+                               
                                if (dtmf.duration > switch_core_max_dtmf_duration(0)) {
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s EXCESSIVE DTMF DIGIT [%c] LEN [%d]\n",
                                                                          switch_channel_get_name(session->channel), dtmf.digit, dtmf.duration);