cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
235
Views
1
Helpful
3
Replies

Dial-peer not matching, shouldn't longest-prefix rule apply?

SergioG
Level 1
Level 1
I'm trying to figure out why the more specific dial-peer doesn't match. Check out below and please let me know if you see any reason why Dial-peer 200 is not being matched in this scenario. According to Cisco's documentation, for non-DID outbound call legs, destination-pattern uses the longest-prefix rule to match.
 
Inbound call leg matches fine, just weird that the outbound call leg is matching Dial-peer 1500 and not 200 when it has the longest-prefix. Thoughts?
 
From CUCM: Calling Number = 4838 | Called Number = 22864
INBOUND Dial-peer Matched:
dial-peer voice 100 voip
 translation-profile outgoing strip-9
 destination-pattern 9.T
 session protocol sipv2
 session target ipv4:x.x.x.x
 incoming called-number .T
 voice-class sip bind media source-interface GigabitEthernet y/y/y
 dtmf-relay rtp-nte sip-notify
 codec g711ulaw
 no vad
OUTBOUND Dial-peer Matched:
dial-peer voice 1500 voip
 destination-pattern .T
 session protocol sipv2
 session target ipv4:x.x.x.x
 incoming called-number 9.T
 voice-class sip bind media source-interface GigabitEthernet x/x/x
 dtmf-relay rtp-nte sip-notify
 codec g711ulaw
 no vad
 
The OUTBOUND Dial Peer that should be Matched:
dial-peer voice 200 voip
 description Inbound/Outbound Webex Calling
 translation-profile incoming strip-double+
 max-conn 250
 destination-pattern ^22864$
 session protocol sipv2
 session target sip-server
 incoming uri request 100
 voice-class codec 200
 voice-class stun-usage 100
 no voice-class sip localhost
 no voice-class sip early-offer forced
 voice-class sip tenant 100
 dtmf-relay rtp-nte sip-notify
 srtp
 no vad
1 Accepted Solution

Accepted Solutions

Outtake from this document. Explain Cisco IOS and IOS XE Call Routing 

Number String Dial-Peer Hunting

Number String Preference:

Much like URI's 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 deploymens keep the default of 0.

Tip: If dial-peers are being matched outside the default order, an administrtor 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.

The longest match number string dial-peer algorithm finds the dial-peer with the most numbers in a sequence that exactly match a sequence of numbers in a number string. This concept is clarified in the subsequent scenario.

Scenario: Eligible dial-peers have been configured with these possible matches, and the gateway is evaluating a digit-string of 2001. Dial-peer 1 can match any number 2000 through 2999 while dial-peer 2 can match 2000 through 2009. Dial-Peer 2 would be matched for this call as it is the longest match (most specific) for the digit string 2001 when the default dial-peer hunting mechanisms is employed (dial-peer hunt 0). In other words, the sequence of numbers 200 is the largest sequence that exactly matches a sequence of number in the number string 2001.

!
dial-peer voice 1 voip
 destination-pattern 2...
!
dial-peer voice 2 voip
 destination-pattern 200.
!

Preference is defined as the administrator defined weight for each dial-peer. Administrators can configure a preference so the call always uses a specific dial-peer before others. By default, all dial-peers are preference 0. A dial-peer with preference 0 is matched before another dial-peer with preference 1 through 10. Most administrators setup multiple dial-peers to send a call to a specific CUCM subscriber with a backup subscriber or another call agent being configured using another dial-peer with a lower preference (which is configured with a higher number).

ScenarioTwo dial-peers are configured with the same match length for the digit string of 2001. The administrator defines an explicit preference. The gateway evaluates both dial-peers the same since their match length is the same. However, the administrator sets dial-peer 1 with a higher preference so that dial-peer is chosen as the first dial-peer used in routing the call. Dial-Peer 2 would remain as a secondary option can a failure occur on the first dial-peer.

!
dial-peer voice 1 voip
 destination-pattern 2...
preference 1
!
dial-peer voice 2 voip
 destination-pattern 2...
preference 2
!

A Cisco gateway only attempts to route a call via one eligible outbound dial-peer at a time. If a failure condition is observed on the first selected dial-peer, then the gateway  attempts to route the call out the next eligible dial-peer. This continues until the call either succeeds or fails because there are no more eligible dial-peers left to try. A common symptom of dial-peer hunting and failure is a noticeable delay in ringback while making calls. Debugs are usually needed to verify exactly why the call is failing on a given dial-peer. The command huntstop can be employed on a dial-peer if an administrator does not want a gateway to look for another dial-peer when a failure condition is observed.

ScenarioTwo dial-peers are configured with the same match length for the digit string of 2001. The administrator has defined an explicit preference and does not want to match dial-peer 2 for this particular call. Since there are two dial-peers with the same match-length, the preference is used to determine the dial-peer. Dial-Peer 1 has the lowest configured preference number, so it is used to route the call. If a failure condition occurs on the outbound call leg using dial-peer 1, then the gateway immediately stops dial-peer hunting since the huntstop command is configured. In this scenario, dial-peer 2 is never utilized for outbound routing. 

!
dial-peer voice 1 voip
 destination-pattern 2...
 preference 1
 huntstop
!
dial-peer voice 2 voip
 destination-pattern 2...
 preference 2
!

 



Response Signature


View solution in original post

3 Replies 3

If you post the output from debug voip ccapi inout put in a text file we can check what’s going on.



Response Signature


Outtake from this document. Explain Cisco IOS and IOS XE Call Routing 

Number String Dial-Peer Hunting

Number String Preference:

Much like URI's 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 deploymens keep the default of 0.

Tip: If dial-peers are being matched outside the default order, an administrtor 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.

The longest match number string dial-peer algorithm finds the dial-peer with the most numbers in a sequence that exactly match a sequence of numbers in a number string. This concept is clarified in the subsequent scenario.

Scenario: Eligible dial-peers have been configured with these possible matches, and the gateway is evaluating a digit-string of 2001. Dial-peer 1 can match any number 2000 through 2999 while dial-peer 2 can match 2000 through 2009. Dial-Peer 2 would be matched for this call as it is the longest match (most specific) for the digit string 2001 when the default dial-peer hunting mechanisms is employed (dial-peer hunt 0). In other words, the sequence of numbers 200 is the largest sequence that exactly matches a sequence of number in the number string 2001.

!
dial-peer voice 1 voip
 destination-pattern 2...
!
dial-peer voice 2 voip
 destination-pattern 200.
!

Preference is defined as the administrator defined weight for each dial-peer. Administrators can configure a preference so the call always uses a specific dial-peer before others. By default, all dial-peers are preference 0. A dial-peer with preference 0 is matched before another dial-peer with preference 1 through 10. Most administrators setup multiple dial-peers to send a call to a specific CUCM subscriber with a backup subscriber or another call agent being configured using another dial-peer with a lower preference (which is configured with a higher number).

ScenarioTwo dial-peers are configured with the same match length for the digit string of 2001. The administrator defines an explicit preference. The gateway evaluates both dial-peers the same since their match length is the same. However, the administrator sets dial-peer 1 with a higher preference so that dial-peer is chosen as the first dial-peer used in routing the call. Dial-Peer 2 would remain as a secondary option can a failure occur on the first dial-peer.

!
dial-peer voice 1 voip
 destination-pattern 2...
preference 1
!
dial-peer voice 2 voip
 destination-pattern 2...
preference 2
!

A Cisco gateway only attempts to route a call via one eligible outbound dial-peer at a time. If a failure condition is observed on the first selected dial-peer, then the gateway  attempts to route the call out the next eligible dial-peer. This continues until the call either succeeds or fails because there are no more eligible dial-peers left to try. A common symptom of dial-peer hunting and failure is a noticeable delay in ringback while making calls. Debugs are usually needed to verify exactly why the call is failing on a given dial-peer. The command huntstop can be employed on a dial-peer if an administrator does not want a gateway to look for another dial-peer when a failure condition is observed.

ScenarioTwo dial-peers are configured with the same match length for the digit string of 2001. The administrator has defined an explicit preference and does not want to match dial-peer 2 for this particular call. Since there are two dial-peers with the same match-length, the preference is used to determine the dial-peer. Dial-Peer 1 has the lowest configured preference number, so it is used to route the call. If a failure condition occurs on the outbound call leg using dial-peer 1, then the gateway immediately stops dial-peer hunting since the huntstop command is configured. In this scenario, dial-peer 2 is never utilized for outbound routing. 

!
dial-peer voice 1 voip
 destination-pattern 2...
 preference 1
 huntstop
!
dial-peer voice 2 voip
 destination-pattern 2...
 preference 2
!

 



Response Signature


Hey Roger,

 

Thanks for the assistance.

I think the important part from the documentation provided is: " If a failure condition is observed on the first selected dial-peer, then the gateway attempts to route the call out the next eligible dial-peer."

The outbound leg was failing on the more specific pattern and choosing to go to the next eligible dial-peer, which matched on the .T Destination-Pattern

I'll mark this as solved. It behaved the correct way after I modified my dial-peers. (Got a busy tone, but it was doing what it was supposed to be doing now. The busy tone is due to some other incorrect configuration).