 billed, managed, and maintained separately from the TDM gateways. In summary, in a SP network, the media gateway fulfills all its traditional roles of translat- ing SIP signaling and RTP media to TDM signaling and analog media. However, it accom- plishes this task as a shared resource among many customers. The features and interconnects of a SP media gateway are shown in Figure 5-5. Media Gateway TDM Voice Call Agent Traffic Network Receives SIP messages and translates them into TDM messages in the form of SS7 messages or non SS7 messages Network (for example, ISDN, CAS, E1R2, and so on) Receives RTP packets and translates them into audio tones that can be sent across the TDM networks Deals with DTMF tones extraction from media straam and injection into audio stream Network Video Network Call Agent Network Provide functionality for Echo cancellation, Voice Activity Detection, and Video Traffic codec encapsulation of speech The vast majority of Media Gateways convert SIP Traffic into TDM traffic for connection to the PSTN. SP Media Gateways usually terminate traffic from a wide variety of call agents including International TDM networks, Mobile Switching Centers (MSC), and SIP Trunking Call Agents. Figure 5-5 Features and Interconnects of a SP Media Gateway SP Network-Legally Required Supplementary Services Systems/Legal Intercept and Emergency Services As SPs look to offer PSTN replacement services via SIP trunks, they might be mandated and required to offer some of the same services that currently exist on TDM trunks. The major mandated supplementary services are Legal intercept of voice calls Emergency calling As previously discussed, in the United States, as in many countries, SPs are required to maintain records of calls, including such information as calling and called party, time of day, and duration of call. This requirement is the same regardless of whether the technol- ogy to make those calls is done with TDM trunks or SIP trunks. As such, SPs are required to ensure that they have in place some architec