/mcp5 Called Number destination-pattern <DNIS-number>dnis-map <map-number> Note: The Number String Dial-Peer Hunting and URI Dial-Peer Hunting section go into how the gateway evaluates a list of potential commands for each match criteria row before moving to the next match criteria. For example, it evaluates all potential destination-pattern matches and destination e164-pattern-map matching commands before it examines the calling number commands.
Number String Dial-Peer Hunting Number String Preference: Much like URIs have a specific order of operations for evaluating matches, there is also a set of rules used when evaluating a numeric digit-string. The default dial-peer hunt scheme for a Cisco gateway is set to 0. This means the gateway searches for a pattern with the longest match (most specific). If there are two dial- peers with the same match length, the gateway looks at the explicitly defined dial-peer preference. Lastly, if both of those are the same, it chooses one in a random order. There are other dial-peer hunt schemes available for configuration; however, most deployment keep the default of 0. Tip: If dial-peers are being matched outside the default order, an administrator can examine the running configuration for a non-default dial-peer hunt scheme.
Gateway(config)# dial-peer hunt ? <0-7> Dial-peer hunting choices, listed in hunting order within each choice: 0 - Longest match in phone number, explicit preference, random selection. 1 - Longest match in phone number, explicit preference, least recent use. 2 - Explicit preference, longest match in phone number, random selection. 3 - Explicit preference, longest match in phone number, least recent use. 4 - Least recent use, longest match in phone number, explicit preference. 5 - Least recent use, explicit preference, longest match in phone number. 6 - Random selection. 7 - Least recent use.