What Is SIP?
SIP is the protocol that allows for real-time voice calls between SIP devices designed to work with that technology. Each section of the Internet has protocols for sending and receiving data. HTTP is the protocol that translates pages of web text into the websites you actually see when you type in a web address. Email works over three different protocols: SMTP, IMAP, and POP. Session Initiation Protocol, or SIP, is one of the protocols for setting up real-time communications over the Web. It works for voice, video, and messaging communications. “SIP call flow” is a fancy term to describe how a SIP call works.
SIP Requests and SIP Responses
When making a SIP call, your SIP device sends requests to the endpoint (the other SIP device). A request needs an answer. When one SIP device sends a request to another, that endpoint sends back a response. It’s how the devices communicate behind the scenes to establish the connection or alternately let you know that a connection can’t happen at that time (e.g., the call goes to voicemail or transfers to another endpoint).
There are 14 SIP requests total, but the first 6 are those you’ll see pop up in call flow diagrams most often. They are:
- INVITE: Establishes a session
- ACK: Confirms INVITE request
- BYE: Ends a session
- CANCEL: Cancels establishing a session
- REGISTER: Communicates user location
- OPTIONS: Communicates info about the calling/receiving SIP phones’ capabilities
There are six classes of SIP responses. If you know HTTP/1.1 response codes, most of these will be familiar. SIP response codes are consistent with them and have expanded to include a sixth class.
1xx = Informational responses
2xx = Success responses
3xx = Redirection responses
4xx = Request failures
5xx = Server errors
6xx = Global failures
For your basic SIP to SIP call flow, you only need to know two of the responses (lest you start having memorization-specific test flashbacks). They are:
180 Ringing (the INVITE request is received, and the phone rings)
200 OK (the Request was successful)
How SIP to SIP Call Flow Works
There are various forms of SIP call flows depending on the software involved—basic SIP to SIP, proxy servers, SIP Gateways, etc. Here we’ve focused on the basic SIP call flow: a direct call from one SIP user to another.
Without knowing the usual SIP requests and response codes, this diagram may be confusing. And trust us when we say you don’t want to see the diagrams for other SIP call flows!
To the end users making the calls, all we seem to do is pick up the phone, dial, wait, chat, and hang up. Simple as pushing a button, right? It’s almost like magic.
“Any sufficiently advanced technology is indistinguishable from magic.”
—Arthur C. Clarke
Consider the curtain pulled back. When you pick up a phone and dial your colleague’s number, your SIP phone sends the INVITE request. Your colleague’s phone recognizes the request as the start of a session and starts ringing to alert her. She picks up, and her phone sends confirmation of the successful request. Your phone acknowledges the successful invite, and boom: You’re connected through real-time protocol (RTP), and a two-way voice channel opens.
When your colleague hangs up, her phone sends a BYE request back to your phone, which confirms the end of the session with another 200 OK confirmation. The entire call, from INVITE to the final 200 OK, is called a Dialog.
This explanation is a very long-winded and technical way of saying you had a phone call, and the phones happened to be SIP phones!