The basis of a VoIP network is the voice gateway. The gateway converts TDM traffic from the Public Switched Telephone Network (PSTN) into either H.323- or Session Initiation Protocol (SIP)-based VoIP traffic. Considered intelligent endpoints, the gateways can provide billing, alarming, built-in interactive voice response (IVR), routing, digit manipulation, and security. In addition, they can support a wide variety of PSTN protocols, such as foreign exchange office (FXO), foreign exchange station (FXS), Primary Rate Interface (PRI), channel-associated signaling (CAS), R2, Qsig, and Signaling System 7 (SS7). The voice gateways can support both origination and termination. Figure 1 shows a model of a wholesale provider that offers PSTN termination for Internet telephony or application service providers (ITSPs/ASPs).