6.7 HANDLING SIP WITH JAVA

In Chapter 5, we introduced the importance of SIP. We shall explore the protocol in greater depth in Chapter 14. In many ways, it is similar to HTTP. There are two endpoints where one initiates a request to the other, which duly responds. The key difference is that, unlike HTTP, the responses don't include any of the data that the two ends want to exchange. The actual exchange is an entirely separate IP connection, which could potentially be any protocol, though most usually a protocol used to sustain an ongoing session of some sort, meaning some type of real-time exchange or ‘conversation’, such as audio, video or IM.

Given the similarity to HTTP, we would expect Java to offer support for SIP, which is does. However, there are two APIs for supporting SIP. The first is a model called the SIP Servlet, which is very similar to the Web Servlets, and the second is called JAIN SIP.

The JAIN initiative is a community of industry experts, coordinated by Sun Microsystems, developing a set of open, standard Java APIs to handle call signalling. For the purposes of this discussion, we don't need to get into the details of the differences between JAIN SIP and SIP Servlet. It is more useful to think of the SIP Servlet as being a type of program in its own right that comes alive in response to a SIP message coming into an application server. The servlet can also initiate SIP dialogues. On the other hand, JAIN SIP can be thought of as a component that gets used by other ...

Get Next Generation Wireless Applications: Creating Mobile Applications in a Web 2.0 and Mobile 2.0 World, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.