Skip to main content

15. - SIP and the PSTN

  • Basic SIP to PSTN example
  • SIP Messages used in SIP to PSTN call
  • Other SIP to PSTN Codes
  • SIP and Early Media
  • Early Offer / Delayed Offer
  • SIP Gateways
  • TRIP
  • SIP-T and PSTN Bridging
  • ISUP to SIP Code Message Mapping
  • More on SIP addressing
  • DTMF and SIP

 

  • image.png

Here our SIP phone dial the number of a PSTN device, the proxy will send the invite onto the SIP/PSTN Gateway that will next sent the proper setup message to the PSTN switch then to the telephone.

A PRACK 183 inform the SIP phone of the progress of the call setup and setup an Early Media (RTP)

Once the PSTN phone start ringing the alerting 180 Ringing messages are sent back to our SIP phone along with the 200 OK

Our SIP phone will response with an ACK then the media will start to flow, it is up to the SIP/PSTN gateway to convert the media from RTP to TDM and viceversa

image.png

In more detail 01216896815, the SIP proxy uses the location services and determines the number is on the PSTN it then passes the invite to the SIP/PSTN Gateway which thenn by the PSTN Switch goes to Grahams phone. The detail on the next image shows the INVITE along with the contact details and SDP information

image.png

Some other sample SIP Codes re: SIP to PSTN call setup attemps are 

  • 404 Not Found : The number called is unallocated
  • 407 Proxy authenticarion Req : Call Rejected
  • 480 Temporary Unavailable : No User Response
  • 486 Busy Here : Called Party is Busy
  • 502 Bad Gateway : Network out of order
  • 600 Busy Everywhere : Useer Busy
  • 603 Decline : Call Rejected
  • 604 Does not exist anywhere : Unallocated number

Here is an example of a PSTN to SIP Call Flow

image.png

Early Media

To overcome a few problems that arise due to the two different systems such as SIP and the PSTN trying to work together, a concept called 'Early Media' has been introduced

Early media is not required on standard PSTN calls as when a number is dialed a media channel is established so that the caller can hear the ringing tone of the remote device, This also gives companies the opportunity to replace ringing media with corporate messages or other instructions for the caller before they get to speak to a real person.

Clipping is a problem where if a person using a PSTN phone answer their phoene adn starts talking straight away without Early Media the SIP phone that is calling them will miss the first part of the conversation as it hasn't yet received a 200 ok message to enable it to setup the RTP media path.

Early media also allows Busy Tone and other announcements to be played to the caller even though the called phone has not been picked up.

image.png

Early Offer / Delayed Offer

With Early offer the invite sends the SDP to being voice inmediately 

image.png

With delayed  offer Invite goes without SDP allowing the other end select a codec to use, if available it will reply with an ACK SDP to begin media.

image.png

SIP Bridging or SIP-T is a framework that can enable SIP networks to carry legacy telephone signals across an IP based network to another legacy network, This would have a dramatic effect on long distance call charges which is great for end users but of course there are technical issues that need to be addressed.

The legacy SS7 ISUP messages have to be interrogated by the SIP/PSTN gateway and then the information that will help SIP proxies to route the SIP messages is built into the SIP header, while othert ISUP information added as a MIME message body, to ensure that the body is closed to 'unwanted' parties snooping on the network it can be encrypted and this is discussed in the security module course.

SIP INFO is another SIP-T approach or method that is used for in-call ISUP signaling across an IP network.

In essence SIP-T must provide translation beteen protocols and providee feature transparency across PSTN to SIP to PSTN interconnections.

 

image.png

ISUP and SIP messages

image.png

ISDN User part (ISUP) to SIP codes

 

image.png

Here is an example of a PSTN to PSTN via SIP

image.png

 

ISUP Encapsulation / SDP also known as SIP Bridging

If this is all that a client requires, then all of the ISUP information can be held in the body of the SIP message and the details such as To: From: Contact, etc. never changes as these just relates to the SIP gateway addresses, an example of the SDP portion of the SIP message (mime/isup) is below, This way any ISUP information that cannot be mapped to SIP will be retained and in this case, secured as well.

image.png

  • The o field show which originating gateway is going to connect to the gateway in vegas and then forward the SIP message.
  • The c field also shows originating gateway details

 

image.png

 

SIP and DTMF

As well as DTMF Dialling tones there are a lot more tonees and events that need to be considered when carrying them across a SIP/VoIP network

DTMF Tones

image.png

image.png

Standard subscriber line tones

image.png

Country specific subscriber line tones

image.png

Trunk Events

image.png

 

Different types of DTMF
  • Inband: DTMF is transmitted in the same RTP stream as the meedia is, thus some tones will be heard by parties in a conversation, it's important to understand that compression codecs such as g.729, g.723 etc, may make the tones unintelligible so this will only really work when using the G.711 codec or better.
  • RFC 2833: Known also as Out of band method that takes DTMF out of the RTP stream and into it's on RTP packet, this means that the DTMF codes can survive ok even if the main stream is compressed, the Out-of-band RTP packets theen hold thee various event codes and the tone is -regenerated by an appropriate gateway or SIP UA.
  • RFC 4733: Builds on and supersedes RFC 2833 though its taking a while for manufacturers to support it, it actually requires that devices don't have to support every tone and event there is, just simply advertise what they DO support when setting up a connection, example if the payload format uses the payload type number 100, and the implementation can handle the DTMF tones (events 0 through 15) and the dial and ringing tones (assuming as an example that these were defined as events with codes 66 and 70 respectively) it would include the following description in its SDP message:
  • m=audio 12346 RTP/AVP 100
    a=rtpmap:100 telephone-event/8000
    a=fmtp:100 0-15,66,70
  • RFC 4734: More  event codes for modem, fax and text telephony signals that get carried in the RTP payload.
  • SIP INFO: is used to carry session control information along the SIP signaling path 'during' an existing session, In the example of a phone call to a bank, the session is established but you may get asked to type in an account number, SIP INFO can carry the digits you type without changing the characteristics of the SIP session, Its worth noting that SIP proxies can see and act upon SIP INFO messages and not DTMF Inband or RFC 2833 packets.


DTMF RFC 2833 example

image.png

 

SIP INFO DTMF example

image.png

 

 

Summary

  • SIP Networks and the PSTN can work well together as long as SIP gateways perform the correct ISUP to SIP mapping in order for a call to reach its destination
  • This also is true for SIP to PSTN calls and PSTN to PSTN bridging across a SIP based internetwork
  • Gateways can be complex devicees and it wouln't be uncommon to find a single server running gateway, proxy, location, registration service on it
  • TRIP is an emerging protocol that promises to do for SIP what BGP did for i nternet in making it easy for SIP calls to be connected to the most appropriate gateway.
  • DTMF tones havee been known to be problematic so support for at least RFC 2833 is recommended for all manufacturers and ITSPs
  • SIP tu ISUP commands do map fairly well though it takes time to remember what each of the command does and what the responses s hould be, this do not intend to give you all the details on USUP to SIP mapping, check RFC 3398 for more details