The ultimate goal of a gateway protocol on a VoIP network is to allow Real-Time Transport Protocol (RTP) streams (that is, streams of VoIP packets) to flow directly between endpoints. During the call setup process, each endpoint (for example, an FXO port in a gateway) needs to learn the IP address and User Datagram Protocol (UDP) port to use in order to get a phone call to the other end of the conversation.
Besides just setting up a call, you might optionally want to perform call administration and accounting features. These features can keep track of bandwidth usage on the wide-area network (WAN) and maintain call records, which can be used for billing or planning purposes. You might also need a way to obtain status information about a current call.
While your local gateway might know how to reach local phones, that local gateway might need to contact an external database of addresses to determine the location of a remote phone. This external database can learn about remote phones by having the gateway used by those remote phones register those phone numbers with the database. By having this central repository of phone number to IP address mappings, less configuration needs to be performed on each local gateway.
Consider the following example. A gateway located in Lexington, KY knows how to reach phone numbers in the 859 area code (that is, the area code of Lexington, KY). The Lexington gateway registers itself with an address database, as shown in Figure 5-1. When a gateway registers with a database, the gateway tells the database what the gateway's IP address is and what phone numbers the gateway can reach. In this example, the gateway has an IP address of 172.16.1.10.
Figure 5-1. Gateway Registration
A caller attached to a gateway in Orlando, FL then wants to call a number in the 859 area code. However, the Orlando gateway lacks any information about the 859 area code. The Orlando gateway then asks the database how to get to the 859 area code. The database responds by saying, "You can reach phone numbers in the 859 area code by sending your packets to an IP address of 172.16.1.10," as shown in Figure 5-2. The Orlando gateway sets up a call with the Lexington gateway, using a gateway protocol (for example, H.323), and RTP packets begin to flow between the IP phones.
Figure 5-2. Gateway Resolution
In the Cisco IP telephony environment, a CCM server acts as a database that can direct a gateway (for example, a Cisco voice-enabled router) to a remote gateway connected to the destination phone.