Wednesday, December 23, 2009

Connecting a VoIP System to a Service Provider Network

A VoIP system that can place calls only to other devices on the IP network is only marginally useful; we still need to place calls out to the PSTN, and to do so we need to connect to a phone service provider, whether via traditional TDM links or ITSP connections. The device that acts as the interface to the PSTN is the voice gateway; it provides the physical connection and logical translation between two or more different network technologies.

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
When a router is matching the dialed digits against the patterns in the configured dial peers, it attempts to find the longest match. This occurs on a digit-by-digit basis. Each successive digit may validate some patterns while eliminating others until a single pattern represents the longest match between the dialed digits and the destination pattern, at which point the call is routed to the outbound dial peer configured with that matching pattern.

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)

No comments:

Post a Comment