mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 16:39:14 +00:00
fix parsing of dtmf string
This commit is contained in:
parent
f08b96764a
commit
a4da1054a0
@ -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;
|
dur = switch_core_default_dtmf_duration(0) / 8;
|
||||||
if ((p = strchr(argv[i], '@'))) {
|
if ((p = strchr(argv[i], '@'))) {
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
if ((dur = atoi(p)) > 50) {
|
if ((dur = atoi(p)) > (int)switch_core_min_dtmf_duration(0) / 8) {
|
||||||
dtmf.duration = dur * 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++) {
|
for (p = argv[i]; p && *p; p++) {
|
||||||
if (is_dtmf(*p)) {
|
if (is_dtmf(*p)) {
|
||||||
dtmf.digit = *p;
|
dtmf.digit = *p;
|
||||||
|
|
||||||
if (dtmf.duration > switch_core_max_dtmf_duration(0)) {
|
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_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);
|
switch_channel_get_name(session->channel), dtmf.digit, dtmf.duration);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user