Last time I gave a high level overview of SIP and also took a look at SIP network element types. This time, I'll be looking at SIP message and method types, and describing how SIP network elements communicate. If you can't remember the SIP network elements that I described last time, it's probably a good idea to take a quick look at my last post.
There are two overall types of SIP message:
Requests: a SIP request is sent from SIP clients (UACs, such as SIP phones) to a SIP servers. Requests are used to invoke certain operations on the servers.
Responses: responses are sent by servers to clients, and indicate the status of the request sent by the client. Responses can be either provisional or final, and can, for example, indicate the request has been successful, or that there has been an error.
Specific SIP response ranges include:
1XX (100-199): these are provisional or informational responses.
2XX: these indicate success.
3XX: these indicate redirection.
4XX: 4XX response indicate client errors.
5XX: these indicate server errors.
6XX: these describe global failures.
As mentioned, SIP requests can be used to invoke operations. These operations are also referred to as methods, and the most common methods are as follows:
INVITE: this message type is used when a client wants to initiate a session. The INVITE is sent to a server (UAS), and the server processes the INVITE and returns an appropriate response. An example of the usage of an INVITE request (method) is one sent by a SIP phone in order to invite another SIP phone to participate in a voice call (session).
REGISTER: this message is used to register contact information with a registrar server, and the contact information is used to build a location database (the registrar server is the front end of the location service). When a user wants to initiate a session with another user, it must first locate that user, and to do this the location service can be consulted.
ACK: this message is the reply to the final response for an INVITE.
BYE: this is used to terminate a session.
CANCEL: this is used to terminate a request for which a final response has not yet been received. This could be used, for example, if a SIP phone sends an INVITE to a second phone in order to initiate a call, but before the second phone is answered (and a final response sent), the first phone sends a CANCEL to terminate the call initiation request.
OPTIONS: this is used by a UA, such as a SIP phone, in order to query another UA about its capabilities.
Other SIP methods include SUBSCRIBE, PRACK, INFO, REFER, NOTIFY, and UPDATE.
If you are wondering how all these messages fit together in practice, here's an example of call setup and disconnect between a Cisco SIP gateway (GW1), and SIP IP phone (User B), both of which are functioning as SIP UAs. Note that ‘User A' and ‘PBX A' in this example are not enabled for SIP. There are numerous other example of message flows in the referenced document, but two others of particular interest may be call setup via a SIP proxy server, and call setup via a SIP redirect server. In these two examples, the PBXs and user phones are again not enabled for SIP - only the gateways and the proxy/redirect servers are SIP enabled, and the gateways are functioning as SIP UAs.
Next time I'll describe the Media Gateway Control Protocol (MGCP).