Copyright 2010-2015 Obihai Technology, Inc.
164
Note that spaces have been used in the digit map. It is fine to include spaces to help make your digit map more
readable.
Matching Against Multiple Rules in Digit Map
One important function of a digit map is to determine if sufficient digits have been entered by the user during dialing. A
digit map normally contains more than one rule. The Digit Map Processor (DMP) must return the best matched rule at
some point, or declare the input digit sequence is invalid. The DMP keeps refining its decision as each digit is entered
until it reaches a
final decision
, or will be forced to make a
timely decision
when the interdigit timer expires.
The DMP restarts the interdigit timer on every newly entered digit. The duration of this timer can be either
long
or
short
. The long and the short timer values are set to 10s and 2s respectively by default and are configurable under the
Phone Settings
group via the
DigitMapLongTimer
and
DigitMapShortTimer
parameters respectively. Whether to
use the long or short interdigit timer depends on the current rule matching states. The DMP maintains a matching state
for each rule in the digit map as it processes each input digit. The following states are defined:
-
Partially Matched (PM) – The rule partially matches the accumulated input sequence. Initially all rules are in
this state before any digit is entered. Rules in this state have the potential of becoming EM or IM as more
digits are entered. Example: 1234 partially matches the rules xxxxxxx, 1xxxx, 1234567, <123:>xxxx.
-
Exactly Matched (EM) – The rule exactly matches the accumulated input sequence. However, any further input
digit will turn this rule into the MM state. Example: 1234 exactly matches the rules xxxx, 1234, 1xxx,
<123:5678>x
-
Indefinitely Matched (IM) – The rule matches the accumulated input sequence indefinitely, with a variable
length such that the rule can potentially stay as IM as more matching digits are entered. Example: 011853
indefinitely matches the rules xx., 011xx., <011:>xx.
-
Mismatch (MM) – The rule does not match the accumulated input sequence. This state will not change as
more digits are entered. Example: 1234 mismatches the rules 123, 1xx, 12345
Rules in the EM or IM state are candidates to be selected by the DMP. After processing a new digit, the DMP returns a
final decision if any of the following conditions holds:
1.
All rules are the MM state. DMP returns an error
2.
One or more rules are in the EM state with no rules in the IM state. DMP returns the best matched EM rule. If
the best matched rule is a barring rule, DMP returns an error instead
Otherwise, the DMP starts the short interdigit timer if there is at least one rule in the EM state, or else the long one.
When the interdigit timer expires, the DMP makes a timely decision by returning the best matched rule at that moment
if one is found, or else a timeout error. Again if the best matched rule in this case is a barring rule, the DMP returns an
error instead. Note that the timer to wait for the first input digit is NOT governed by the interdigit timer, but the
duration of dial tone being played and could be a lot lengthier than the long interdigit timer.
The best-matched rule is the one that has the most specific literals matching the input digit sequence. For example, the
input sequence 1234 matches the rule 123x better than 1xxx. On the other hand, an EM rule is always selected over an
IM rule.
Finally, the default interdigit timer can be overridden by appending the S
n
element at the end of the rule where
n
= 0–9
designating the number of seconds to wait before triggering the rule with a timer event.
Here are some more examples:
Consider the simple digit map
(<1408>xxx xxxx)
. As soon as 7 digits are entered, the DMP returns a complete
number by prepending the accumulated digits with
1408
.