ol Transmission Protocol (SCTP). The SG does not modify these signalling messages; it just routes them to the proper Media Gateway Controller (MGC). An MGC performs two tasks: (1) it converts the signal between the PSTN's signalling protocol (usually ISDN User Part (ISUP)) and SIP, and (2) it controls the Media Gateway (MG). The MG is responsible for media conversion. It incorporates both voice-over-circuits and VoIP interfaces. An MGC issues commands to the MG such as open voice channel or close voice channel. The protocol they use to communicate is a master/slave protocol such as MGCP or H.248. Chapter 7 Figure 7-13 PSTN signalling Architecture of a Signalling Gateway distributed gateway. PSTN signalling over IP PSTN side IP side Media Gateway Controller Master/slave control protocol Voice stream Voice stream Media Gateway SIP Extensions for PSTN Interworking Gateways between SIP and the PSTN normally make use of some common SIP extensions. They usually support reliable delivery of provisional responses in order to deliver progress reports to the PSTN side. Gateways often support QoS preconditions as well. Besides these common extensions, two other extensions were designed with PSTN interworking in mind: the INFO method and MIME media types for ISUP and QSIG Objects. They are used between two gateways for calls that originate in the PSTN, tra- verse a SIP network, and end up back in the PSTN again. This scenario is referred to as SIP bridging (Figure 7-14). A call between two PSTN phones might traverse a SIP network for many reasons. It might have to utilize some enabling services that are only pre- sent in the SIP network. If it couldn't traverse the SIP network, all such services would be off-limits to PSTN users. Another call might be routed through SIP because it's cheaper for the provider. A provider might also use his or her IP network to offload his or her circuit-switched network. Under some circumstances, a call originally destined for a SIP phone can be redi- rected to a PSTN phone. Building Applicati