On the surface, sending an email or making a phone call is a simple matter of pressing a few buttons. But underneath the UI are lightning-fast requests and responses that ensure delivery and connectivity before, during, and after we communicate with each other. In the digital world, codes exist for each and every one of these actions.
Every part of a SIP call involves sending requests from one device to the other. Starting a call? INVITE request. Ending a call? BYE request. And so on. There are 14 SIP requests; the first 6 are the most common.
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
PRACK = Provisional acknowledgment
SUBSCRIBE = Subscribes to notifications
NOTIFY = Notifies the subscriber of a new event
PUBLISH = Publishes an event to the server
INFO = Sends mid-session info
REFER = Asks the callee to start a call transfer
MESSAGE = Sends an instant message
UPDATE = Changes the session’s state
We briefly discussed this in our SIP Call Flow blog, listing a few of the main SIP requests and responses that occur with every VoIP call. A quick glance at the SIP versions should immediately ring a bell if you are familiar with HTTPS/1.1 response codes. You know, the 404 Page Not Found and similar errors that show up in your browser every now and then. You send a request: a web address. The server either responds with the page or an error code if the page is unreachable. SIP response codes are very similar, with many overlapping codes between the protocols.
1xx = Informational responses. The main response code for SIP calling is 180 Ringing, meaning the call INVITE was successfully received and the callee’s phone starts ringing.
2xx = Success responses. The main response here is 200 OK, meaning any sent request went through successfully.
3xx = Redirection responses. These occur when a call can’t reach the endpoint, but instead of failing, there are redirect options.
4xx = Request failures. An error blocked the request from succeeding. (Here’s your 404 Not Found or 403 Forbidden.)
5xx = Server errors.
6xx = Global failures. This one is just for SIP; HTTPS response codes only go through the fifth class.
If you’re curious about all of the codes in each class, check out this comprehensive list of SIP responses.
On one hand, it makes sense that Internet protocols have similar error codes. On the other hand, wouldn’t it make sense for SIP response codes to line up with other telephony standards? Well, they do! Landlines might feel outdated these days, but old-school calls have the same requests and responses flying around under the UI—whether that interface is a VoIP app or a telephone keypad.
The PSTN name for them is cause codes. The code numbering is different, but the functions line up with SIP response codes. Here’s an example of the default mapping from PSTN to SIP; check out the full list of PSTN cause codes here.