SIP three way handshakes

Time for another post on SIP, why SIP?  Because SIP is good, SIP is like a nice dessert, it is something that just works. This time I want to touch on some of its basic fundamentals; the three way handshake. I decided on this topic because recently I have been working on a number of issues that had to do with incomplete SIP messaging between endpoints and calls that were being cut off after about 30 to 40 seconds. Now, when you come across calls that disconnect after a certain and set period time and time again, you can bet money on it, that some timer has expired forcing the call to drop.

So let me brush up some basics regarding SIP call establishment. SIP Sessions are used with Voice and Video over IP, to establish a call session between users. The core SIP specification provides a way to set up and manage sessions between two user agents (i.e. endpoints, such as desk phones, or software SIP clients).

SIP sessions, sometimes referred to informally as “calls” and more formally referred to as dialogs, are created via invitations from one User Agent (User Agent Client or UAC) to another (User Agent Server or UAS). This invitation transaction is basically a three-way handshake between the UAC and UAS that consists of the initial INVITE message sent by the UAC to the UAS, one or more provisional responses sent by the UAS to the UAC, a final response sent by the UAS to the UAC, and an acknowledgment sent by the UAC to the UAS.

The three way handshake (similar to a TCP three way handshake) in SIP works as follows INVITE  –response (1xx)  – ACK. So as soon as the INVITE is sent to request a dialog  (Alice in the example picture above), Bob sends a 100 TRYING status update back, so UA1 does not re-transmit its INVITE. The 180 RINGING is sent back to Alice to signify that the phone is ringing. The 200 OK is sent from the called party as soon as Bob picks up the phone (in this cased the OK also contains the SDP). After this the ACK is send by the caller. Remember the ACK is always sent by the party that sent the initial INVITE. This ACK as part of the 3 way handshake is important because with this ACK the caller confirms back to the called party that it has received a final response to an INVITE Request. All these messages within the three way handshake will have the same Cseq # in their message header.

So, in  a nutshell, the 3 way SIP handshake is:

  • The caller sends an INVITE
  • The callee sends an 200 OK to accept the call
  • The caller sends an ACK to indicate that the handshake is done and a call is going to be setup

I you want more in depth documentation on SIP, i suggest you read  RFC 3261



SIP trunking; where are we at now?

SIP Trunking; where are we at now? Chasing a myth?

SIP is rapidly becoming the de facto standard protocol for IP telephony. Hang on, did I just answer my opening question? Well not quite, so let me re-phrase that question and see if I can find some insight into the fact that, although SIP is increasingly pervasive, then why is it that ISDN is still the preferred way of connecting our PBX to a carrier?

Read more

Link building 101

Getting your website or brand ranked high enough in Google search results for someone to notice you,  contact you and approach your for business, is Bloody Hard work.  There is no guaranteed recipe on how to get your website on the first two pages of Google search results.

Read more

Google Analytics and wordpress

How Google Analytics and WordPress go together

Albert Einstein once said; “Imagination is more important than knowledge”.  That might be well for fundamental scientific research, but how do you actually do research on your website?  How can you establish how popular your website is in terms of traffic, which geographic location do these visitors come from? and what sort of devices do they use predominately?  All this boils down to knowledge.

Read more

VOIP, what’s the fuzz all about?

Dogtel can implement VOIP in the Melbourne area and we are very passionate about it, so let us explain about its advantages.

VOIP has been around for a while. People also use terms like IP Telephony and Internet telephony (made famous by companies like Skype). But let’s stick with the term “VOIP”.

Read more

Responsive website, why should I care?

In the last couple of years,  the number of personal devices with which we  browse the internet has increased. Not only that, but the variety of devices we do that with has increased as well.  Samsung Tablets, iPADs,  Google Nexus,  iPhone,  Android phones and the good old desktop, you name it.  All these devices have a different screen size and thus a different user experience when looking at the same website on any of these devices.

Read more

What is Network integration?

Network integration

Read more