Session Initiation Protocol - SIP: SIP Trunking Configuration Step
Session Initiation Protocol - SIP: SIP Trunking Configuration Step
- SIP registration
- DTMF Transport
**InformationalPoints
SIP developed to set up, modify, and tear down multimedia sessions
Main signalling functions of the protocol are as follows –
- Location of an end point
- Contacting an end point to determine willingness to establish a session
- Exchange of media information to allow a session to be established
- Modification of existing media sessions
- Teardown of existing media sessions.
SIP User Agents –
SIP-enabled end device is called a SIP user agent (UA)
UA takes direction or input from a user and acts as an agent on their behalf
to set up and tear down media sessions with other UA.
UA must be capable of establishing a media session with another UA.
UA must maintain the state on calls that it initiates or participates in, which
includes the local and remote tags, Call-ID, local and remote CSeq header
fields.
Even after a call has been terminated, the call state must be maintained by a
user agent for at least 32 seconds in case of lost messages in the call tear
down.
During a session,a user agent will usually operate as both a UAC and a UAS.
UAs typically register with a proxy server in their domain.
** A re-INVITE is used to change the session parameters of an existing call which uses the
same Call-ID and tags as the original INVITE/200 OK exchange, but the CSeq is incremented
because it is a new request.
SIP message Headers example-
TAGS
Tags are really quite simple, but require a bit of explanation. The goal of a tag is to work with the Call-ID to
make an entire dialog unique no matter how many times a session might be forked. Actually, I should have
said tags since there are two. There is the local tag (From tag) which is assigned by the sender of a message
or the UAC. There is also the remote tag (To tag) which is assigned by the final recipient of the message or
the UAS (User Agent Server). The UAC puts its tag in the From header and the UAS puts its tag in the To
header. So, when a message leaves a UAC it has one tag in the From header and there is no tag in the To
header. When a UAS receives that message and responds back with a SIP response (e.g. 180 Ringing), it then
adds a tag to the To header. If multiple clients received the original message then they would all add their
own specific tag values. In other words, all those SIP messages will have the same From tag, but depending
on who is responding, there will be different To tags. Does this make sense? If not, here is a dumbed down
call flow that might explain it better:
Andrew sends:
INVITE [email protected]
180 Ringing
180 Ringing
P=Private
v=0
t=0 0
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:97 iLBC/8000
a=rtpmap:31 H261/90000
1. A 2-way call is established from GW-A to GW-B through the IMG using normal call
messaging procedures.
2. GW-A wants to put the call on hold. GW-A sends a Re-INVITE message to the IMG
with the a=sendonly line in the SDP. This tells the IMG that GW-A is in a send-only
mode and will not receive RTP/RTCP data.
3. The IMG then sends a 200 OK response with the a=recvonly line indicating that it
will only receive RTP/RTCP data and not transmit RTP/RTCP data packets to GW-A.
At this point, GW-A can only transmit to IMG.
4. The IMG then sends a Re-INVITE message to GW-B with the c=0.0.0.0 and
a=inactive in the SDP. By sending these two messages, the IMG effectively puts
the call on hold.
5. GW-B responds with a 200 OK telling the IMG it is now on hold. There is no voice
path between IMG and GW-B.
6. GW-A then wants to take the call off hold and resume the call. It sends a Re-
INVITE to the IMG with the line a=sendrecv telling the IMG it is now in a
send/receive mode and the call can resume.
7. The IMG responds with 200 OK message with the a=sendrecv line in its SDP.
8. The IMG then sends a Re-INVITE to GW-B with the same a=sendrecv message in
its SDP. GW-A responds with 200 OK and a=sendrecv in the SDP.
9. At this point the call resumes and RTP/RTCP data begin flowing again.
SIP-T (RFC3372) is advanced version of SIP which support to carry ISUP message over
SIP-ISUP interworking[edit]
SIP-I, or the Session Initiation Protocol with encapsulated ISUP, is a protocol used to create, modify, and terminate
communication sessions based on ISUP using SIP and IP networks. Services using SIP-I include voice, video
telephony, fax and data. SIP-I and SIP-T[28] are two protocols with similar features, notably to allow ISUP messages to be
transported over SIP networks. This preserves all of the detail available in the ISUP header, which is important as there
are many country-specific variants of ISUP that have been implemented over the last 30 years, and it is not always
possible to express all of the same detail using a native SIP message. SIP-I was defined by the ITU-T, whereas SIP-T
was defined via the IETF RFC route.[29]
Active time – t=0 0
0 = Session start time
0 = Session stop time
Code 0 = PCMU , and the µ law (u-law) is used in American PCM system
Code 3 = GSM
Code 18 = G729
G723 = 4
8 = 729 8 Kbps
Video h.263
V.17, V.27, V.29TDM code for fax
SIP registration –
A registrar server, also known as a registration server, accepts SIP REGISTER
requests.
The contact information from the request is then made available to other SIP servers
(proxies and redirect servers).
To header field contains the name of the resource being registered, and the Contact
header fields contain the contact or device URIs.
It creates a temporary binding between the address of record (AOR) URI in the To
and the device URI in the Contact header field.
Heisenberg sends a SIP REGISTER request to a type of SIP server known as a registrar
server.
SIP registrar server receives the message and uses the information in the request to
update the database used by proxies to route SIP requests.
The registrar binds the SIP URI of Heisenberg and the IP address of the device in a
database that can be used.
When a proxy server with access to the database receives an INVITE request
addressed to Heisenberg’s URI (i.e., an incoming call), the request will be proxied to
the Contact URI of the currently registered device.
- Each SIP device that originates or forwards a SIP message stamps its own address in a Via
header field, usually written as a host name that can beresolved into an IP address using a
DNS query.
- The Via header field contains the SIP version number (2.0), a “/”, then UDP for UDP
transport, a space, the hostname or address, a colon, then a port number (in this example
the “well-known” SIP port number 5060)
Max-Forwards - It is initialized to some large integer and decremented by each SIP server, which
receives and forwards the request, providing simple loop detection.
To and From - show the originator and destination of the SIP request.SIP requests are routed based
on the Request-URI instead of the To URI.
- This is because the Request-URI can be changed and rewritten as a request is forwarded, while the
To URI generally stays the same. When a name label is used, as in this example, the SIP URI is
enclosed in brackets <>.
Call-ID - it is an identifier used to keep track of a particular SIP session.The originator of the request
creates a locally unique string.
In addition to the Call-ID, each party in the session also contributes a random identifier,
unique for each call, called as tags.
Are included in the To and From header fields as the session is established.
The initial INVITE shown contains a From tag but no To tag.
The initiator of the session that generates the establishing INVITE generates the unique Call-
ID and From tag.
In the response to the INVITE, the user agent answering the request will generate the To tag.
The combination of the local tag, remote tag & the Call-ID uniquely identifies the established
session, known as a dialog.
** Dialog identifier is used by both parties to identify this call because there could be multiple calls
set up between them.
CSeq - It contains a number, followed by the method name, INVITE as here. This number
incremented for each new request sent.
** Via, Max-Forwards, To, From, Call-ID, and CSeq header fields represent the minimum required
header field set in any SIP request message.
Contact - IT contains the SIP URI of a user agent (UA). This URI can be used to route messages
directly to UA.
Subject - This optional Subject header field is present in this example. It is not used by the protocol,
but could be displayed during alerting to aid the called party in deciding whether to accept the call.
Content-Type & Content-Length - header fields indicate that the message body is Session
Description Protocol or SDP and contains 158 octets of data.
**This media information is needed because SIP makes no assumptions about the type of media
session to be established— the caller must specify exactly what type of session (audio, video,
gaming) that he wishes to establish.
- 180 Ringing is an example of a SIP response message. This message sent in response to the
INVITE.
- 180 message indicates that the called party, has received the INVITE and alerting is taking
place.
- It could be ringing a phone, a flashing message on a screen, or any other method of
attracting the attention of the called party.
** 1XX - Informational responses are used to convey noncritical information about the progress of
the call.
** To and From header fields in SIP are defined to indicate the direction of the request, not the
direction of the message.
- Since Tesla initiated this request, all responses to this INVITE will read To: Marconi From:
Tesla.
* The To header field now contains a tag that was generated by Marconi.
- When the B end, decides to accept the call (i.e., the phone is answered), a 200 OK response
is sent. The 200 OK is an example of a success class response.
- Via header field in this example is populated with Marconi’s host address and contains a
new transaction identifier since the BYE is considered a separate transaction from the INVITE
or ACK transactions shown previously.
- The To and From header fields reflect that this request is originated by Marconi, as they are
reversed from the messages in the previous transaction.
- Tesla, however, is able to identify the dialog using the presence of the same local and
remote tags and Call-ID as the INVITE, and tear down the correct media session.
Confirmation response to the BYE is a 200 OK:
- SIP URI is a name that is resolved to an IP address by using a SIP proxy server and DNS
lookups at the time of the call.
- A proxy server does not set up or terminate sessions, but sits in the middle of a SIP message
exchange, receiving messages and forwarding them.
- SIP has two broad categories of URIs: ones that correspond to a user, and ones that
correspond to a single device or end point.
* User URI is known as an address of record (AOR). A request sent to AOR will require database
lookups and service, which can result in the request being sent to one or more end devices.
* Device URI is known as a contact, and typically does not require database lookups.
- - An AOR URI is usually used in To and From header fields, as this is the general way to reach
a person and is suitable for storing in address books.
- A device URI is usually used in a Contact header field and is associated with a particular user
for a shorter period of time.
- DNS lookup of Heisenberg’s SIP URI domain name (munich.de) is performed, which returns
the IP address of the proxy server proxy.munich.de, which handles that domain.
1. DNS lookup by user agent to locate the IP address of the proxy. Database lookup is performed by
the proxy to locate the IP address.
2. The INVITE is then forwarded to Heisenberg’s IP address with the addition of a second Via header
field stamped with the address of the proxy.
The presence of two Via header fi elds, Heisenberg knows that the INVITE has been routed through a
proxy server. After getting the INVITE,
- This response contains the Via header fields, and the To, From, Call-ID, and CSeq header
fields from the INVITE request.
- This response is then sent to the address in the first Via header field, proxy.munich.de.
* Notice that the To header field now has a tag added to it to identify this particular dialog.
- Only the first Via header field contains a received parameter, since the second Via header
already contains the literal IP address in the URI.
- Proxy receives the response, checks that the fi rst Via header field has its own address
(proxy.munich.de), uses the transaction identifier in the Via header to locate the transaction,
removes that Via header fi eld, then forwards the response to the address in the next Via
header field: IP address 100.101.102.103, port 5060.
The resulting response sent by the proxy to Schroedinger is –
- Use of Via header fields in routing and forwarding SIP messages reduces complexity in
message forwarding.
- Request required a database lookup but response requires no lookup because the routing is
embedded in the message in the Via header fields.
- This ensures that responses route back through the same set of proxies as the request.
Proxy forwards the 200 OK message to Schroedinger after removing the fi rst
Via header field –
- Presence of the Contact header field with the SIP URI address of Heisenberg in the 200 OK
allows Schroedinger to send the ACK directly to Heisenberg,bypassing the proxy.
- This request, and all future requests, continue to use the tag in the To header field
- It shows that the proxy server is not really “in the call.
- It facilitates the two end points locating and contacting each other.
- This role of helping the two user agents locate each other is sometimes called rendezvous
and is a key function of the SIP protocol.
** A proxy server can force further messaging to route through it by inserting a Record-Route
header field.
- Note that the media is always end-to-end and not through the proxy.
- In SIP the path of the signaling messages is totally independent of the path of the media as the
separation of control channel and bearer channel.
SIP Servers-
SIP servers are applications that accept SIP requests and respond to them.
Proxy Servers-
- SIP proxy server receives a SIP request from a user agent or another proxy and acts
on behalf of the user agent in forwarding or responding to the request.
- Proxy server typically has access to a database or a location service to aid it in
processing the request (determining the next hop).
- Proxy server can be either stateless or stateful.
>A stateless proxy server processes each SIP request or response based solely on the
message contents. Once the message has beenprocessed, and forwarded or
responded to, no information (such as dialog information) about the message is
stored.
> A stateless proxy never retransmits a message, and does not use any SIP timers.
>>A stateful proxy server keeps track of requests and responses received in the past,
and uses that information in processing future requests and responses.
>> Astateful proxy server starts a timer when a request is forwarded. If no response
to the request is received within the timer period, the proxy willretransmit the
request, relieving the user agent of this task.
Forking Proxy –
A proxy server that receives an INVITE request, then forwards it to a number of locations at
the same time is called forking. It keeps track of each of the outstanding requests and the
response to each.
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 45.2.32.1:5060 ;branch=z9hG4bK67865
Max-Forwards: 70
To: sip:[email protected]
From: A. N. Sarkovskii<sip:[email protected]>;tag=7643545
Call-ID: 0140092501
CSeq: 1 INVITE
Subject: Bifurcation Question
Contact: <sip:[email protected]>
Content-Type: application/sdp
Content-Length: ...
The INVITE is received by the chaos.info proxy server, which forks to two user agents.
SIP/2.0 200 OK
Via: SIP/2.0/UDP 45.2.32.1:5060;branch=z9hG4bK67865
To: <sip:[email protected]>;tag=343214112
From: A. N. Sarkovskii<sip:[email protected]>;tag=7643545
Call-ID: 0140092501
CSeq: 1 INVITE
Contact: <sip:[email protected]>
Content-Type: application/sdp
Content-Length: ...
- A forking proxy server sends a CANCEL to the second UA to stop that phone alerting.
**If both UAs had answered, the forking proxy would have forwarded both 200 OK
responses back to the caller, who then would have had to choose which one, most likely by
accepting one and sending a BYE to the other.
** SIP session timer extension limits the time period over which astateful proxy must
maintain state information without a refresh re-INVITE.
Inthe initial INVITE request, a Session-Expires header field indicates a timer interval
after which stateful proxies may discard state information about the session.
User agents must tear down the call after the expiration of the timer. The caller
can send re-INVITEs to refresh the timer.
Example –
Redirect Servers –
- A type of SIP server that responds to, but does not forward, requests.
- It uses a database or location service to lookup a user.
- The location information, however, is sent back to the caller in a redirection class
response (3xx)
- Notice that the ACK request reuses the same branch ID as the INVITE and the 302
response.
- As an ACK to a non-2xx final response is considered to be part of the same
transaction as the INVITE.
- Only an ACK sent in response to a 200 OK is considered a separate transaction with a
unique branch ID.
- Also, an ACK to a non-2xx final response is a hop-by-hop response, not an end-to-
end response
This exchange completes this call attempt, so a new INVITE is generated with a new
Call-ID and sent directly to the location obtained from the Contact header field in the
302 response from the redirect server.
** A 180 Ringing response is not sent; instead, the 200 OK response is sent right away.
- Since 1xx informational responses are optional, this is a perfectly valid response by the UAS
if Heisenberg responded to the alerting immediately and accepted the call.
Registrar Servers -
** A proxy receiving a CANCEL immediately sends a 200 OK response back to the sender and
generates a new CANCEL, which is then forwarded in the next hop to the same set of
destinations as the original request.
** An ACK to a 2xx response is generated by the end point, a 3xx, 4xx, 5xx, or 6xx response
is acknowledged on a hop-by-hop basis.
SDP:
- UA receiving a method/request it does not support replies with a 501 Not Implemented
response.
- These are case sensitive and conventionally use all uppercase.
INVITE –
- A media session is considered established when the INVITE, 200 OK, and ACK
messages have been exchanged between the UAC and the UAS.
- A successful INVITE request establishes a dialog between the two user agents, which
continues until a BYE is sent by either party to end the session.
- An INVITE sent for an existing dialog references the same Call-ID as the original
INVITE and contains the same To and From tags. Sometimes called a re-INVITE, the
request is used to change the session characteristics or refresh the state of the
dialog. The CSeq command sequence number is incremented so that a UAS can
distinguish the re-INVITE from a retransmission of the original INVITE.
- A re-INVITE must not be sent by a UAC until a final response to the initial INVITE has
been received—instead, an UPDATE request can be sent.
** An Expires header in an INVITE indicates to the UAS how long the call request is valid.
REGISTER –
- It is used by a UA to notify a SIP network of its current Contact URI (IP address).
- It is necessary, however, for a user agent to register to receive incoming calls from
proxies that serve that domain.
- To header contains the SIP URI of the AOR (address of record) of the user agent that
is being registered.
- The From contains the SIP URI of the sender of the request, usually the same as the
To header.
-
BYE --
ACK --
** For 2xx responses, the ACK is end-to-end, but for all other final responses it is done on a
hop-by-hop basis when stateful proxies are involved.
- A hop-by-hop ACK reuses the same branch ID as the INVITE since it is considered part
of the same transaction.
- A end-to-end ACK uses a different branch ID as it is considered a new transaction.
A stateful proxy receiving an ACK message must determine whether or not the ACK should
be forwarded downstream to another proxy or user agent.
This is done by comparing the branch ID for a match pending transaction branch IDs. If there
is not an exact match, the ACK is proxied toward the UAS. Otherwise, the ACK is for this hop
and is not forwarded by the proxy.
CANCEL –
* CANCEL only has meaning for an INVITE since only an INVITE may take several seconds (or
minutes) to complete. All other SIP requests complete immediately.
- A proxy does not wait for responses to the forwarded CANCEL requests, but
responds immediately.
- UA confirms the cancellation with a 200 OK response to the CANCEL and replies to
the INVITE with a 487 Request Terminated response.
OPTIONS –
- it is used to query a user agent or server about its capabilities and discover its
current availability.
Methods - REFER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, UPDATE, INFO, and PRACK are
left to cover
https://www.researchgate.net/figure/The-use-of-SUBSCRIBE-and-NOTIFY-SIP-
messages_fig6_281805500
- it is used to indicate the methods supported by the UA or proxy server sending the
response.
Call-ID -
- It is mandatory in all SIP requests and responses.
- It is part of the dialog used to uniquely identify a call between two user agents.
- A Call-ID is always created by a user agent and is never modified by a server.
Call-ID: 34a5d553192cc35
Call-ID: 44fer23ei4291dekfer34231232
Contact –
Example - feature tag isfocus is used to indicate that the URI in the Contact header field is a
conference URI.
SIP/2.0 200 OK
Via: SIP/2.0/UDP client.chicago.example.com
;branch=z9hG4bKhjhs8ass83;received=192.0.2.4
To: <sip:[email protected]>;tag=733413
From: Carol <sip:[email protected]>;tag=32331
Call-ID: d432fa84b4c76e66710
CSeq: 45 INVITE
Contact: <sip:[email protected]>;isfocus
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER,
SUBSCRIBE, NOTIFY
Allow-Events: dialog, conference
Accept: application/sdp, application/conference-info+xml,
message/sipfrag
Supported: replaces, join, gruu
Content-Type: application/sdp
Content-Length: ...
CSeq -
- It is a required header field in every request.
- It contains a decimal number that increases for each request.
- Exception for CANCEL and ACK requests, which use the CSeq number of the INVITE
request to which it refers.
Date -
- It is used to convey the date when a request or response is sent.
* SIP only supports the use of the GMT time zone (Date: Fri, 13 Oct 1998 23:29:00 GMT)
Expires -
- It is used to indicate the time interval in which the request or message contents are
valid.
- When present in an INVITE request, the header field sets a time limit on the
completion of the INVITE request.
- Once the session is established, the value from the Expires header fi eld in the
original INVITE has no effect.
- It may contain a SIP date or a number of seconds.
Expires: 60
Expires: Fri, 15 Apr 2000 00:00:00 GMT
From –
- It indicates the originator of the request.
- It may contain a tag used to identify a particular call.
-
Record-Route –
- It is used to force routing through a proxy for all subsequent requests in a session
(dialog) between two UAs.
- A proxy inserting its address into a Record-Route header field and forces future
requests to include a Route header field containing the address of the proxy that
forces this proxy to be included.
To -
- It is a required header field in every SIP message used to indicate the recipient of the
request.
- Any response generated by a proxy must have a tag added to the To header field.
* The To header field URI is never used for routing—the Request-URI is used for this
purpose.
Via –
- It is used to record the SIP route taken by a request and is used to route a response
back to the originator.
- UA generating a request records its own address in a Via header field.
- It contain protocol name, version number, and transport (SIP/2.0/UDP, SIP/2.0/TCP,
etc.) and may contain port numbers and parameters such as received, rport, branch,
maddr, and ttl.
- A received tag is added to a Via header field if a UA or proxy receives the request
from a different address than that specified in the top Via header field.
* If an rport tag is included in a Via in a request, a proxy will insert the port the request was
received on and use this port for routing the response.
* This indicates that a NAT or firewall proxy is in the message path.
P-Asserted-Identity -
- It is used between trusted proxies to assert the identity of a UA that has been
authenticated using some means.
- A UA receiving a request from a proxy that it trusts will typically render the value in a
P-Asserted-Identity header field to the user as a “Verified Caller ID” as opposed to a
From header value which is unverified.
- A proxy receiving a P-Asserted-Identity from another proxy that it does not trust will
remove the header field.
P-Asserted-Identity: <sip:[email protected]>
Max-Forwards –
- It is used to indicate the maximum number of hops that a SIP request may take.
- A proxy receiving the header fi eld with a value of zero discards the message and
sends a 483 Too Many Hops response back to the originator.
- The suggested initial value is 70 hops.
Max-Forwards: 10
Session-Expires –
- It is used to specify the expiration time of the session.
- To extend the session, either UA can send a re-INVITE or UPDATE with a new
Session-Expires header field.
- At the expiration of the interval in the Session-Expires, either UA may send a BYE and
call-stateful proxies may destroy any state information.
Session-Expires: 3600
Content-Language –
Content-Language: en
Content-Length -
- It is used to indicate the number of octets in the message body. A Content-Length: 0
indicates no message body.
Content-Length: 0
Content-Type -
- It is used to specify the Internet media type in the message body.
- If this header fi eld is not present, application/sdp is assumed.
Content-Type: application/sdp
100 Trying -
> It is a hop-by-hop request. It is never forwarded and may not contain a message body.
> It does not contain a To tag and hence does not create an early dialog.
180 Ringing -
> It is used to indicate that the INVITE has been received by the user agent and alerting is
taking place.
> When the UA answers immediately, a 200 OK is sent without a 180 Ringing; this scenario is
called the “fast answer” case in telephony.
2) 2XX Success -
- It indicate that the request has succeeded or has been accepted.
200 OK -
> It used to accept a session invitation, it will contain a message body containing the media
properties of the UAS.
> It used in response to other requests, it indicates a successful completion or receipt of the
request.
202 Accepted -
> It indicates that the UAS has received and understood the request, but that the request
may not have been authorized or processed by the server.
> It is commonly used in responses to SUBSCRIBE.
204 No Notification -
> It is used in response to a SUBSCRIBE request that was successful but no notifi cation
associated with the request will be sent.
3) 3XX Redirection -
- It is sent by a SIP server acting as a redirect server in response to an INVITE,
- A UAS, can send a redirection class response to implement certain types of call forwarding
features.
- UAC can be configured to automatically generate a new INVITE upon receipt of a
redirection class response without requiring user intervention.
- To prevent looping, the server must not return any addresses contained in the request Via
header fi eld, and the client must check the address returned in the Contact header field.
- It is used by a server or UAS to indicate that the request cannot be fulfilled as it was
submitted.
- These responses will require user intervention before a new request can be generated.
401 Unauthorized -
> It indicates that the request requires the user to perform authentication.
403 Forbidden -
> It is sent when the server has understood the request, found the request to be correctly
formulated, but will not service the request.
> It is used to deny a request.
> A stateful proxy can send this response after the request transaction times out without
receiving a final response.
- This response class indicates that the server knows that the request will fail wherever it is
tried.
- Only a server that has definitive knowledge of the user identified by the Request-URI in
every possible instance should send a global error class response.
Session Description Protocol (SDP)
- It contains the following information about the media session:
- IP address (IPv4 or IPv6 address or host name);
- RTP profile (usually RTP/AVP although there are others such as RTP/SAVP);
- Port number (used by UDP or TCP for transport);
- Media type (audio, video, interactive whiteboard, and so forth);
- Media encoding scheme (PCM A-Law, MPEG II video, and so forth).
- SDP was not designed to be easily extensible. The only way to extend or add new
capabilities to SDP is to define a new attribute type.
Example -
v=0
o=johnston 2890844526 2890844526 IN IP4 43.32.1.5
s=IETF Update
i=This broadcast will cover the latest from the IETF
u=http://www.sipstation.com
e=Alan Johnston [email protected]
p=+1-314-555-3333 (Daytime Only)
c=IN IP4 225.45.3.56/236 (** IP address that will be sending the media packets)
b=CT:144
t=2877631875 2879633673
m=audio 49172 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 23422 RTP/AVP 31
a=rtpmap:31 H261/90000
o= It contains information about the originator of the session and session identifiers.
o=username session-id version network-type address-type address
u= It contains a uniform resource indicator (URI) with more information about the session.
p= It contains a phone number. The phone number should be given in globalized format,
beginning with a +, then the country code, a space or −, then the localnumber. Either spaces
or - are permitted as spacers in SDP. A comment may be present inside brackets( ).
Attributes ---
a=rtpmap:0 PCMU/8000
a=rtpmap:6 DVI4/16000
a=rtpmap:8 PCMA/8000
a=rtpmap:99iLBC
Attributes can be either session level or media level in SDP.
- Session level means that the attribute is listed before the first media line in the SDP.
If this is the case, the attribute applies to all the media lines below it.
- Media level means it is listed after a media line. In this case, the attribute only applies to
this particular media stream.
SDP can include both session level and media level attributes. If the same attribute appears
as both, the media level attribute overrides the sessionlevel attribute for that particular
media stream
Example, the caller Tesla wants to set up an audio and video call with two possible audio
codecs and a video codec in the SDP carried in the initial INVITE -
v=0
o=Tesla 2890844526 2890844526 IN IP4 lab.high-voltage.org
s=-
c=IN IP4 100.101.102.103
t=0 0
m=audio 49170 RTP/AVP 0 8
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
m=video 49172 RTP/AVP 32
a=rtpmap:32 MPV/90000
Special Case—Call Hold -
One party in a call can temporarily place the other on hold (i.e., suspending the media
packet sending). This is done by sending an INVITE with an identical SDP to that of the
original INVITE but with a=sendonly attribute present. The call is made active again by
sending another INVITE with the a=sendrecv attribute present.
-- Dynamic payload types are in the range of 96–127. Payloads in this range do not refer to a
particular codec; instead the required a=rtpmap attribute must be used to indicate the
payload.
-- Rules associated with the use of dynamic payloads in the SDP offer answer exchange are -
The last rule means that it is possible that payload 97 means one codec in one direction but
another codec in a different direction.
Media Transport Protocol –
a) Real-Time Transport Protocol (RTP)
* In terms of media quality, the 2 important factors are the packet loss rate and the end-to-
end latency.
- (RTP) is an application layer protocol that uses UDP for transport over IP.
- Version (V): This 2-bit fi eld is set to 2, the current version of RTP
- Padding (P): If this bit is set, there are padding octets added to the end of the packet to
make the packet a fixed length. This is most commonly used if the media stream is
encrypted.
- CSRC count (CC): It contains the number of content source identifiers (CSRC). It is only used
by mixers that take multiple RTP streams and output a single RTP stream.
- Marker (M): This single bit is used to indicate the end of a complete frame in video, or the
start of a talk-spurt in silence-suppressed speech.
- Sequence Number: This 16-bit field is incremented for each RTP packet sent and is used to
detect missing/out of sequence packets.RTP allows detection of a lost packet by a gap in the
Sequence Number.
- Timestamp: This 32-bit field indicates in relative terms the time when the payload was
sampled. It allows the Rx to remove jitter and to play back the packets at the right interval
assuming sufficient buffering.
- Synchronization source identifier (SSRCI): This 32-bit field identifies the sender of the RTP
packet. At the start of a session, each participant chooses an SSRC number randomly.
- Contributing source identifier (CSRC): This fi eld is only present if the RTP packet is being
sent by a mixer, which has received RTP packets from a number of sources and sends out
combined packets.
* A continuous bit rate codec such as PCM will have a linearly increasing Timestamp.
* A variable bit rate codec, however, which sends packets at irregular intervals, will have an
irregularly increasing Timestamp, which can be used to play back the packets at the correct
interval.
*** A low bit rate codec that is optimized for transmitting vocal sounds will not transport
the superimposed sine waves of a DTMF signal without introducing significant noise, which
may cause the DTMF digit receiver to fail to detect the digit. As a result, it is useful to switch
to another codec when the sender detects a DTMF tone.
*** As an RTP packet contains the payload type, it is possible to change codecs on the fly
without any signaling information being exchanged between the UAs. Switching codecs in
general should probably not be done without a SIP signaling exchange (re-INVITE).
> In RTP, a translator is an element that converts the codec or sampling rate of an RTP
stream.
An RTP mixer is an element that combines multiple RTP streams into a single RTP stream in
a media specific way.
- It allows participants in an RTP session to send each other quality reports and statistics,
and exchange some basic identity information.
- RTCP traffic is all overhead & the bandwidth allocated to these messages remains fixed
regardless of the number of participants.
* For example, in a basic two-participant audio RTP session, the RTP/AVP profi le states that
RTCP packets are to be sent about every 5 seconds; forfour participants, RTCP packets can
be sent every 10 seconds.
- It gives feedback on the quality of the connection including information such as:
• Number of packets sent and received;
• Number of packets lost;
• Packet jitter.
* RTCP uses the next highest port from the RTP port
DTMF Transport -
- DTMF must be transported and supported for user signaling—for example, when entering
a personal identifi cation number (PIN), (IVR) systems, telephonebanking, and many other
systems use DTMF tones for signaling.
- low bit rate codecs, which are optimized for encoding voice, often do not reliably encode
DTMF tones. As a result, there is a need to transport DTMF not as sine waves but as actual
digits.
* A payload known as telephone-events has been defined for transport over RTP.
Payload contains:
• Event: an octet used to encode the event such as the DTMF key pressed;
• End (E) bit: a bit used to indicate the end of the event;
• Reserved (R) bit: a bit reserved for future use, set to zero and ignored;
• Volume: 6 bits for the level of the tone in dBm0;
• Duration: 16 bits used for a timestamp for the event duration.
> When a user presses a DTMF key, or a gateway detects a DTMF tone in band, an RTP
telephone-events packet is created and sent.
- Marker (M) bit in the RTP header is set to indicate that this is the fi rst packet sent.
> When the key is released or the DTMF tone is no longer detected, a fi nal RTP
telephoneevent packet is created. The end (E) bit will be set and the duration fi eld will
contain the actual tone duration.
Mute Call Issue
TDm