]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_rayo FS-6071 fix DTMF overflow and increase max DTMF matching from 64 to 256
authorChris Rienzo <chris.rienzo@grasshopper.com>
Mon, 6 Jan 2014 14:50:28 +0000 (09:50 -0500)
committerChris Rienzo <chris.rienzo@grasshopper.com>
Mon, 6 Jan 2014 14:50:44 +0000 (09:50 -0500)
src/mod/event_handlers/mod_rayo/rayo_input_component.c

index 41383a1d2318f209859ebe2e90546b661f2da1ce..72f52cb5525a98a6e4b55b52ac01146783d6aa43 100644 (file)
@@ -32,7 +32,7 @@
 #include "srgs.h"
 #include "nlsml.h"
 
-#define MAX_DTMF 64
+#define MAX_DTMF 256
 
 #define INPUT_MATCH_TAG "match"
 #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);
 
-               /* adjust result if terminating digit was pressed */
                if (is_term_digit) {
+                       /* finalize result if terminating digit was pressed */
                        if (match == SMT_MATCH_PARTIAL) {
                                match = SMT_NO_MATCH;
                        } else if (match == SMT_MATCH) {
                                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) {