s the pri- mary job in making SIP viable. But as we've established in Chapter 1, both the architecture and the design philosophy of the PSTN are at odds with the IETF in general and SIP in particular. Compatibility can only be achieved by implementing gateways to perform protocol conversions in the border between the PSTN and the IP network (Figure 7-8). Gateways work by acting as a network node for the PSTN and as an end point for the SIP network. With this mechanism in place, the SIP architec- ture is not influenced at all by the interworking with PSTN protocols. A gateway typically looks just like a SIP UA to the SIP network. Thus, the network responds to calls originated in the PSTN, which are calls origi- nated by another SIP entity as far as SIP is concerned. Gateways let SIP preserve all of its good features even as it connects to the PSTN. In fact, a general rule for SIP interworking with other systems is to ensure that SIP does not have to change behaviors to do SO. It is always better to build a complex gateway on the edge for protocol conversion than to push further complexity into the protocols themselves. The PSTN uses several different signalling protocols and thus several types of gateways exist between the PSTN and SIP. Figure 7-8 Gateways between networks provide the interworking function. Gateway VolP network Gateway Building Applications with the SIP Toolkit Low-Capacity Gateways The proper architecture for a particular gateway is a function of its capac- ity and its requirements. Low-capacity gateways usually integrate sig- nalling and media handling in a single box. They usually interact with PSTN access protocols such as Digital Subscriber Line No. 1 (DSS-1), and they are intended to support residential or small office requirements. For instance, a few years ago, Bob had an ISDN phone at home that used DSS-1 to communicate to its PSTN local exchange (Figure 7-9). As technol- ogy improved, he decided to replace his old ISDN phone with a small gate- way that supports SIP and DSS-1 (Figure 7-10