SIP Early Offer vs Delayed Offer

The most visited page in my blog is CUCM SIP Trunk to ITSP connection. From time to time my readers and students ask me to explain what the difference between the Early Offer and Delayed Offer in the SIP signaling is. Let’s say your ITSP want you to use SIP signaling with Early Offer in the SIP Trunk. How can you be sure, that your SIP trunk really works in Early Offer mode?

First of all, let’s define, what the both definitions refers to. When we say “Early Offer” or “Delayed Offer”, we want to clarify how the SIP devices exchange their media information or do so called Media Negotiation. Media Negotiation is the procedure when the parties inform each other about the type of media traffic (audio/video), codecs used for audio and video, their media ports and IP addresses. Typically, the media information is provided with Session Description Protocol (SDP) messages. 

In SIP Delayed Offer the media parameters are negotiated only after the called party goes off-hook and answers the call – no information about the calling device’s media characteristics are sent in the SIP INVITE. Let’s have a look to the diagram below. 

As you see here, the SDP messages in SIP Delayed Offer are sent in 200 OK and ACK SIP messages. 200 OK is the message confirming the answer of the call. The remote party encapsulates the SDP information into 200 OK and sends it to the calling party. It says something like “My codec is G711, my traffic is audio, my media IP is 10.1.1.1 and my media port is 16384. Do you support and accept this?”

If the calling party supports the codec offered, it returns its own media information in SIP ACK message. It also includes the near-end party’s codec, port, IP address, etc. However, if we have codec mismatch, then the media negotiation fails and the call is dropped. Of course, in calls with SIP Delayed Offer the called party is always bothered – its phone is ringing, the user have to answer the call and immediately after that the call is released in case of codec mismatch (assume here that we have wrong codec configuration). 

In order to avoid bothering the remote user with such calls, when codec negotiation fails, we can use SIP Early Offer mode. In this mode the session initiator (calling device) sends its capabilities (including supported codecs) in the SDP contained in the initial SIP INVITE in the very beginning of  the call. The offer in the SDP message body contains the IP address, UDP port number, list of codecs, and so on, that the calling device supports. This method allows the called device to choose its preferred codec for the session.

The called device chooses the offered codecs that it wishes to use for the call and returns them in its answer in the SDP body of a SIP response. The answer also contains the IP address and UDP port number of the called device. Once the answer is received, two-way media can be established. If the codec mismatches, then the remote party sends 488 Media Not Acceptable answer for the initial INVITE. The call IS NOT delivered to the remote phone and the remote user is not disturbed.

So if you see the SDP information in the SIP INVITE messages between your SIP devices, it means that your SIP connection uses SIP Early Offer. And quite the contrary, if there is no SDP in SIP INVITE, then you deal with SIP Delayed Offer