/weblog/describing-voip-session-initiation-protocol

Describing VoIP's Session Initiation Protocol

Wednesday, June 18, 2008

At this time, Session Initiation Protocol (SIP) is probably the most commonly used VoIP signalling protocol. SIP is responsible for the set-up, tear-down, or to modify connections in which Real Time Protocol (RTP) can transfer the audio or video data. It is important to understand this distinction as SIP is not your voice communication; SIP is means for systems to understand how your devices (phones, servers, PBX') handle your communications.

SIP is a lightweight protocol and is similar in many ways to HTTP (Hyper-Text Transport Protocol). Like HTTP, SIP is completely text-based. This makes debugging easy and reduces the complexity of the protocol. To illustrate SIP's simplicity, let's use HTTP "conversation" as an example.

While browsing to this webpage, several things happened between your web browser and the Advantia web server. First, your computer performed a DNS (Domain Name Service) look-up of "advantia.ca". This returned the IP address of the Advantia Web server. With this IP address, your computer understood where to go on the internet to contact the Advantia Web server. Your browser then made a TCP connection on port 80 to the web server and once the connection was established, your browser sent a "GET" request for the "/weblog/how-sip-works" file. The server responded with a "200 OK" and sent the HTML to your browser.

However, let's assume for a moment that the file doesn't exist. In that case, the server would have sent to your browser a "404 Not Found" Message. Another situation may be that I decided to move the "/weblog/how-sip-works" to another location. In that case, the web server could have responded with a "301 Moved Permanently" and information about where your browser show look for the file's new location.

The 200, 404, and 301 are known as "status codes" in the HTTP world. This HTTP example is a very basic breakdown, but this is how SIP communication works. When you call someone via SIP, the commands sent are known as "SIP Methods". These SIP methods are similar to the HTTP "GET" command your browser sent to this web server. HTTP Status Codes and SIP Methods are both found in the header portion of the communication. The difference is that HTTP sends the data (html, text, image data, etc.) in the message body and then closes the TCP connection but moving digitized voice (or video) requires that a continuous stream of data. The information communicated by SIP endpoints describes how a second, transport protocol (RTP) is to be used to stream the conversation between humans.

Interested in learning how a SIP enabled telephone system can benefit your business? Please feel free to contact me anytime.


Basic SIP Methods
INVITEInvite a person to a call.
ACKAcknowledgment. These are used in conjunction with INVITE messages.
BYETerminates a request.
CANCELRequests information about the remote server.
OPTIONSFor example, "what codecs do you support?"
REGISTERThis is typically used if your connection is DHCP or dynamic.
INFOThis gives information about the current call. It can also be used to transmit other information (Images, for example).

SIP Response Code Definitions
100Trying
180Ringing
181Call is being forwarded
182Queued
183Session in progress
200OK
202Accepted: Used for referrals
300Multiple choices
301Moved permanently
302Moved temporarily
305Use proxy
380Alternate service
400Bad request
401Unauthorized (used only by registrars)
402Payment required (reserved for future use)
403Forbidden
404Not found (User not found)
405Method not allowed
406Not acceptable
407Proxy authentication required
408Request time-out (could not find the user in time)
410Gone (the user existed once, but is not available here any more)
413Request entity too large
414Request-URI too long
415Unsupported media type
416Unsupported URI scheme
420Bad extension (Bad SIP protocol extension used)
421Extension required
423Interval too brief
480Temporarily unavailable
481Call/transaction does not exist
482Loop detected
483Too many hops
484Address incomplete
485Ambiguous
486Busy here
487Request terminated
488Not acceptable here
491Request pending
493Indecipherable (could not decrypt S/MIME body part)
500Server internal error
501Not implemented (The SIP request method is not implemented here)
502Bad gateway
503Service unavailable
504Server time-out
505Version not supported (Does not support this version of SIP)
513Message too large
600Busy everywhere
603Decline
604Does not exist anywhere
606Not acceptable