Things can become more complex in scenarios other than those outlined above. for example, you might use prack (defined in RFC 3262), which is a provisional response acknowledgement. there are some cases in which we wowould like to guarantee the delivery of a provisional response different than 100, such as 180 ringing (You may recall that TCP isn't enough to know the message reached the other end, as a proxy along the path may send the response over UDP ). for that reason, a device sending a reliable provisional response wowould receive a prack, acknowledging the response, and because prack is a request, it wowould respond to that request with 200 OK. this does not mean a call was established -- just that one party has received ed the prack; the invite transaction is still pending a final response. however, the provisional response may include an SDP answer to the original offer. furthermore, a prack may have a new offer. to make things more complex, even after the prack offer-answer, you might send an update that includes des, once again, a new offer.
Why make it so complex? The former scenario usually involves early media, such as Ring-Back Tone (the music you hear when calling a person subscribed to this service) or interworking with PSTN. the later scenario may involve resource reservation. these scenarios, by definition, require setting and changing the media properties as the call begins, and this forces sip to take a complex path to support them.
The following flow demonstrates a complex invite scenario. For clarity purposes, each transaction has a different color.
After the initial negotiation, you might also change the media attributes. for example, during a voice call, one party may ask to receive a fax, or to add or remove video. to do that, the Party sends an invite request on the dialog (contrary to a new invite, this invite already has a tag parameter in the "to" header ). thus, the invite looks like any request that you send within the existing dialog, but it can contain SDP that changes the media behavior. this request type is often referred as re-invite.
Sometimes you might use update rather than re-invite. the reason is that re-invite is also a target refresh request. we have seen that the device stores the dialog remote target; because the remote target is set at the initial negotiation, A device wocould ignore the "Contact" header value of a request on the existing dialog. this is not true for target refresh requests that may prompt a change in the remote target. update may contain SDP with a new offer, similar to re-invite, but it is not a target refresh and thus affects only the media negotiation.
A very common scenario for changing media in an active call is placing the call on hold. hold, in SIP/SDP terms, means that the one placing the call on hold no longer waits es media, but it may decide to send media. for that reason, each media stream has an attribute that can be send-receive, send-only, receive-only or inactive. by default, a stream is send-receive. when you place a stream on hold, you change the stream to send-only and its peer changes it to receive-only. if both maid place the stream on hold, it becomes inactive.
Older hold scenario examples did not use these attributes, but rather changed the IP address to 0.0.0.0. this may seem equivalent to "inactive," but it also means that the RTCP cannot be used either. that means that devices that use the RTP/RTCP to know the call is still active wocould not receive any packets and thus wowould have no indication of the status of the call.
The variety of different cases and quirks, some of which are described above, have created implements interoperability questions. in fact, some questions remain unanswered even today. nevertheless, to invoke with this, the IETF provided SDP offer/answer examples in RFC 4317 and, perhaps more importantly, there is a draft that attempts to provide guidance on Limit of these questions. so, if you're looking for cases in which sip did not manage to keep things simple, offer-answer is definitely ranked high.
Extensions
We mentioned numerous times that SIP supports extensions. obviusly, different implementations will support different extensions. it's a question of network policy as to whether specific extensions are mandatory, allowed, or forbidden. for that reason, SIP uses Option-tags. an option-tag is a short string that indicates support for a specific extension. when an RFC defines a new extension it may define a new option-tag and register its name in iana's registry. for example, prack has an option-tag named "100rel. "If a client sending an invite supports prack, it will include the following header:
Supported: 100rel
A device that sends es this invite request and wants to send a provisional response reliably using this extension can now send it with the following header:
Require: 100rel
Since the original UAC indicated it supports "100rel," it is expected to send prack for that provisional response. the invite cocould have also encoded the 100rel in the "require" header. if the recipient does not support this extension, it shocould send back a 420 (Bad extension) response with the names of the extensions it does not support in the "unsupported" header. headers that include these option-tags may appear multiple times, or include several comma-separated values and therefore one may indicate several extensions in a single message.
Extensions may also define new methods. to indicate the supported methods, you place this in the "allow" header. furthermore, to indicate which message bodies are supported, their names are stored in the "accept" header. to figure out, prior to a session, the capabilities of a device, it's possible to send an options request. the request signature des in the "accept" header the message body it wishes to query (obviously most commonly this wocould be "application/SDP "). A successful response wocould include the following:
- The option-tags in the "supported" header.
- Methods supported in the "allow" header (Response t a proxy generates the response in which case proxies shocould not limit the method type ).
- The body type in the "accept" header.
- Ages supported (for text such as response reason phrase) in the "Accept-language" header.
- Body encoding (such as compression via gzip) in the "Accept-encoding" header. It is not common practice to compress the body.
- The body itself indicating its capabilities. For SDP, this wocould include the different media types in each "M"-line and the codecs with their capabilities in corresponding attributes.
Extending sipSIP does not stop with the invite request. RFC 3265 defines a SIP-based infrastructure for event notification, and one of the most common event configurations is presence (I. E ., you have a list of contacts in a presence client, and you get restrictions when a contact goes online, offline, leaves to lunch, etc .). therefore, the presence client wocould send a subscribe request to a Presence Server. once it takes es a 2XX response to the subscribe request, a new dialog is formed. the server can now generate a notify request on the dialog that indicates the user status has changed.
The IETF knew that there might be specified scenarios aside from presence that include this mechanism, so they defined this infrastructure on top of SIP. for example, when a phone is busy, you can use a call completion feature to be notified when the person is available for the call. this, once again, involves subscribing to an event and processing status notifications.
To support a specific event, you shocould implement an event package that defines the event name, parameters, status types, and bodies a message may include. A subscribe request wocould include the event name in the "event" header, so that a single user can send out multiple SUBSCRIBE requests, even to the same target. to check which event packages are supported, a new header called "allow-events" was defined. subscriptions have an expiration time, and a subscriber that wishes to keep the subscriopen must send another subscribe request within the Dialog before it expires. this dialog closes when the notifier sends a notify request with a terminated status.
There are numerous examples of event-Notification extensions, such as RFC 3856 defining presence, RFC 3680 that sends a notification for user registrations and RFC 4730 defining signaling DTMF events. one event-Notification extension, which is more related to CILS, is call transfer. to this end, RFC 3515 defines the refer method.
Suppose maid A and B have a call, and particle a wants to transfer the call to particle ant C. A wocould send out a refer request to B with C's address. B sends out an invite request to C, specifying it was referred by. refer uses implicit substatement, which helps a know whether the transfer has completed successfully. B then sends require y requests to a, indicating the status of the transfer. this is already strated in the following flow:
A different possible transfer scenario is to send a refer request from A to C. c wowould then send an invite to B. the invite wocould include the dialog details of A and B to specify which dialog is being replaced. it is also possible for a to have two concurrent invite dialogs, one with B and one with C prior to the refer; this is also known as attended Transfer
Let's assume one sends a refer within an existing dialog. often, that makes sense because a probably has an invite dialog with B and thus, it may send a refer on the existing dialog instead of creating a new one. in the refer dimo-above, We have colored each dialog usage with a different color. you can see that despite the fact that bye was sent, we still have communication between the two parties. if the refer was sent on the same dialog as the invite, the specified y and 200 OK are also sent on this dialog. this is because the sub‑still exists.
Having call and subqueries on the same dialog may seem harmless at first, but sometimes it's not trivial. For example, what shocould you do when an error response arrives? Some responses affect just the transaction, some affect just the specific usage (invite or refer), and some, such as 404 not found, may affect both invite and refer (suddenly the user does not exist, although the dialog was established ). in addition, the dialog remains open even after a bye request (if the refer notifications are still active ), but cannot implementations tend to close the dialog when seeing a bye simply because this multiple usage on a single dialog was not clearly defined. RFC 5057 attempts to address that by defining the desirable behavior of multiple usages on a single dialog. it also discourages using this ability since it recognizes limits of the complications. in fact, rfcs published after the refer RFC do not define multiple usages or implicit subscriptions.
Readers who want to learn more in-depth details about the event notifications are encouraged to open the RFC, as its language is rather clear. I shoshould mention that there is a new draft updating RFC 3265, which addresses when issues that have come up in recent years. some changes clarify the text, others alter some definitions (e.g ., the dialog is now created only when the specified y Transaction Completes ). other changes also discourage multiple usages on a single dialog.
FinalePart 1 focused on the SIP foundations and showed the Protocol's simplicity. part 2 has described the more complex areas of SIP that require more attention to detail. if you 've already ved This primer then you shoshould have a good baseline for understanding this protocol. it might be a good idea to look at RFC 5359, which provides excellent examples to parse sip services scenarios. if you want to extend your knowledge of SIP even further, I wocould recommend reading the base sip RFC, as well as following the specified extensions, some of which are mentioned in this primer. finally, the IETF forums are very friendly to any person who has a question, including newcomers. you can find your answers in the Forum's archive, and you can post any question on any related matter.