The Session Description Protocol (SDP)-VoIP Part 2
SDP at work in a SIP based VoIP call
During a SIP based VoIP call initialization, when a caller dials a number on a SIP phone, a SDP message is attached to the SIP INVITE message which is sent to the IP PBX the SIP phone is registered to. In the SDP message, connection details, media details and DTMF event types are advertised.Typically, such information is sent from the caller’s SIP phone to the IP PBX, which is then relayed to the other SIP phone which is receiving the call. The SIP phone receiving the call which at this stage it is still being established, also sends SDP data back to the IP PBX which is relayed to the SIP phone making the call. Because of such process, if the call is established the SIP phones taking part in this SIP based VoIP call know to where the media stream should be sent and what type of media and codec to use. They also now know what media type and codec they will be receiving.
Codec priority
Since SIP phones normally support more than one codec, as we will see in the capture below, supported codecs are sent in a particular order in the SDP message; depending on the priority which can be set by the user in the phone set’s settings. Example:- SIP phone A has the following codec priority; 1: PCMU, 2: PCMA, 3: GSM
- SIP phone B has the following codec priority; 1: Speex, 2: G729, 3: PCMA
SDP Capture in an INVITE SIP message
Below is a capture of a SDP message sent from a SIP phone to an IP PBX it is registered to when trying to make a call:v=0 o=root 42852867 42852867 IN IP4 10.130.130.114 s=call c=IN IP4 10.130.130.114 t=0 0 m=audio 61896 RTP 0 8 3 101 a=rtpmap:0 pcmu/8000 a=rtpmap:8 pcma/8000 a=rtpmap:3 gsm/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=sendrecv From the above capture’s we can see that:
Session Description section
Version – V=0- SDP Protocol Version. Up to now there are no minor versions.
- root = username of originator.
- 42852867 = Session ID which is randomly generated from the SIP phone.
- 42852867 = Session Version which is also randomly generated from the SIP phone.
- IN = Owner’s network type, in this case “IN” for Internet.
- IP4 = Owner’s address type, in this case IP version 4.
- 10.130.130.114 = Owner’s IP address.
- call = Session name using human readable characters.
- IN = Owner’s network type, in this case “IN” for Internet.
- IP4 = Owner’s address type, in this case IP version 4.
- 10.130.130.114 = Caller’s SIP phone’s IP address.
Time Description section
Active time – t=0 0- 0 = Session start time
- 0 = Session stop time
Media Description section
Media name and Transport address – m=audio 61896 RTP 0 8 3 101- audio = Media type of stream. This can also be video, message, audio etc.
- 61896 = The port number on which the media stream will be transmitted.
- RTP = The protocol which will be used to stream the media, in this case Real Time Protocol.
- 0 = The code specifying the codec, in this case codec 0 = G.711 PCMU.
- 8 = The code specifying the codec, in this case codec 8 = G.711 PCMA.
- 3 = The code specifying the codec, in this case codec 3 = GSM.
- 101 = DTMF payload type number the SIP phone supports.
Session attribute lines
- a=rtpmap:0 pcmu/8000
- a=rtpmap:8 pcma/8000
- a=rtpmap:3 gsm/8000
- a=rtpmap:101 telephone-event/8000
- a=fmtp:101 0-16
- a=ptime:20
- a=sendrecv
As seen above, SDP plays a very important role in a SIP based VoIP call as it is used for describing multimedia sessions for session announcement, session invitation and other types of multimedia sessions initiation. SDP is also used in other VoIP signalling protocols apart from SIP, such as H.323.
Take this line as example
m=audio 8000 RTP/AVP 3 110 8 0 98 101 This line tell you all the codec is prepared to use, and other additional info like : media type, protocol , port etc
Session attribute lines
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:110 speex/8000
a=rtpmap:98 iLBC/8000
101 = DTMF payload type number the SIP phone supports.
No hay comentarios:
Publicar un comentario