Understanding Gateways, Voice Ports, and Dial Peers
The following sections establish some terms of reference.
Gateways
In the Cisco Unified Communications architecture, a gateway is typically a voice-enabled router with an appropriate voice port installed and configured. Gateways can have both analog and digital voice port connections, including analog FXO, FXS, and E&M or digital T l / E l or PRI interfaces.
Call Legs
A call leg is the inbound or outbound call path as it passes through the gateway. As the call comes into the gateway, it is associated with an inbound port. (This is the inbound call leg.) As the call is sent out another gateway port, this creates the outbound call leg. There will be inbound and outbound call legs at each gateway router.
Dial Peers
A dial peer is a pointer to an endpoint, identified by an address (a pattern of digits). Cisco gateways support two types of dial peers: POTS and VoIP. POTS dial peers are addressed with PSTN phone numbers, and VoIP dial peers are addressed by IP addresses. Dial peers identify the source and destination endpoints of call legs; an inbound call leg is matched to a dial peer, and the outbound call leg is routed to a destination dial peer. Depending on the direction of the call, the dial peers may be POTS inbound and VoIP outbound, vice versa, or possibly both VoIP. It is unlikely but not impossible that the
inbound and outbound dial peers would both be POTS. Each dial peer also defines attributes such as the codec to use, QoS settings, and other feature settings. Dial peers are configured in the gateway IOS, using either the CLI or GUI interface.
The partial output that follows shows a simple POTS dial peer configuration:
The number assigned to dial peers is arbitrary, although dial peer 0 exists by default and cannot be deleted. The keyword pots creates a POTS dial peer; the keyword voip would create a VoIP dial peer. The destination-pattern command identifies that the attached device (phone or PBX) terminates calls to the specified number (or a range of numbers if connecting to a PBX). The port command identifies the physical hardware connection the dial peer will use to reach the destination pattern.
The destination-pattern command associates a phone number with a dial peer. The specified pattern can be a specific phone number (as above, 8675309) or an expression that defines a range of numbers. The router uses the patterns to decide which dial peer (and associated physical port) it should route a call to. The following table briefly explains destination-pattern syntax.
Configuring VoIP dial peers is equally simple. Examine the following configuration:
In this example, the destination pattern is any four-digit number starting with "4." A new command, session-target, is used to identify the IP (version 4 in this case) address of the gateway or call agent that will terminate the call. If the IP address is on a router, it should be a loopback IP so that the address is always available even if a physical interface fails. The preceding configuration creates an H.323 dial peer (in contrast to a SIP dial-peer).
Routers attempt to match dial peers for the inbound call leg according to the following rules:
1. Look for the incoming called-number command in a dial peer that matches the called number or DNIS string of the inbound leg.
2. Look for the answer-address command in a dial peer that matches the calling number or ANI string of the inbound call leg.
3. Look for the destination-pattern command in a dial peer that matches the calling number or ANI string of the inbound call leg.
4. Look for the POTS dial peer port command that matches the voice port of the incoming call (POTS dial peers only).
5. If all of the above fail to match, match against Default Dial Peer 0 as a last resort.
The default dial peer 0 config for inbound POTS calls includes the following:
- no ivr application
Consider the following configuration:
Given this configuration, the following example dialed numbers illustrate how the patterns match dialed digits:
- The dialed number 867-5309 will match dial peer 40 (exact 7-digit match)
- The dialed number 867-4309 will match dial peer 30 (first four digits match)
- The dialed number 867-3309 will match dial peer 20 (first four digits match)
- The dialed number 876-5309 will match dial peer 10 (no other exact match, so the ".T" pattern matches)