mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 08:49:01 +00:00
mod_rayo FS-6071 fix DTMF overflow and increase max DTMF matching from 64 to 256
This commit is contained in:
parent
8db351858b
commit
8d30da28d7
@ -32,7 +32,7 @@
|
|||||||
#include "srgs.h"
|
#include "srgs.h"
|
||||||
#include "nlsml.h"
|
#include "nlsml.h"
|
||||||
|
|
||||||
#define MAX_DTMF 64
|
#define MAX_DTMF 256
|
||||||
|
|
||||||
#define INPUT_MATCH_TAG "match"
|
#define INPUT_MATCH_TAG "match"
|
||||||
#define INPUT_MATCH INPUT_MATCH_TAG, RAYO_INPUT_COMPLETE_NS
|
#define INPUT_MATCH INPUT_MATCH_TAG, RAYO_INPUT_COMPLETE_NS
|
||||||
@ -183,13 +183,18 @@ static switch_status_t input_component_on_dtmf(switch_core_session_t *session, c
|
|||||||
|
|
||||||
match = srgs_grammar_match(component->grammar, component->digits, &interpretation);
|
match = srgs_grammar_match(component->grammar, component->digits, &interpretation);
|
||||||
|
|
||||||
/* adjust result if terminating digit was pressed */
|
|
||||||
if (is_term_digit) {
|
if (is_term_digit) {
|
||||||
|
/* finalize result if terminating digit was pressed */
|
||||||
if (match == SMT_MATCH_PARTIAL) {
|
if (match == SMT_MATCH_PARTIAL) {
|
||||||
match = SMT_NO_MATCH;
|
match = SMT_NO_MATCH;
|
||||||
} else if (match == SMT_MATCH) {
|
} else if (match == SMT_MATCH) {
|
||||||
match = SMT_MATCH_END;
|
match = SMT_MATCH_END;
|
||||||
}
|
}
|
||||||
|
} else if (component->num_digits >= MAX_DTMF) {
|
||||||
|
/* maximum digits collected and still not a definitive match */
|
||||||
|
if (match != SMT_MATCH_END) {
|
||||||
|
match = SMT_NO_MATCH;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (match) {
|
switch (match) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user