Skip to main content

REST'ing @ SailFin CAFE

Posted by rampsarathy on January 25, 2010 at 6:43 AM PST

Converged (Http/SIP) applications gives users the flexibility of creating or accessing information about their communications (call/conferences/im ...) over the web. To make this possible a typical converged application would contain an entry point for all the Http requests, which is mostly an Http Servlet. This servlet would return back appropriate responses by accessing the corresponding communication (SIP) sessions. Every communication application that is deployed would need one (or more) Http servlets in order to support Web clients (as shown in figure 1). But, the fact is that most of the operations that are required by web clients are quite similar and do not differ much on the server side with respect to the implementation of the http servlet. Common tasks a web client might do include setting up a call (CallSetup), querying status of calls, terminating a call, modifying a call etc... From a developers perspective its desirable if the converged application development framework provides a means of exposing these common tasks rather than having to write a htttp servlet for it. It also helps if these are exposed as an API, that is portable as well as open standards compliant. 



Figure 1


SailFin CAFE solves this problem by exposing these through a REST API. When a CAFE application is deployed (with some information added to web.xml descriptor), all the regular tasks of creating and managing the communication are exposed as REST URIs  and the required resources provisioned automatically. Build v1-b24  of CAFE  comes with REST resources implementation of Call and Conference. By including the following lines in the web.xml deployment descriptor the REST resources are provisioned and made available for your CAFE application

<web-app version="2.5" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
        <servlet-name>CAFE REST Service</servlet-name>
        <servlet-name>CAFE REST Service</servlet-name>

The REST resources are implemented using the Jersey JSR 311 (Figure 2) implementation that is bundled with SailFin. The deployment descriptor above indicates that the CAFE REST resources that are available under the package should be made availble through Jersey. Once a CAFE application with such a deployment descriptor is deployed, Web clients would be able to access the  REST URIs, for their application


Figure 2


For e.g to create a call from the  web client (assuming the SIP UAs of Alice and Bob have registered)


where contextroot is the context root of the deployed application and callid is the callid for the call. And server/client refers to the nature of the APIs. Currently only server APIs are available , and these are synchronous where the client has to wait for a response on the same connection.

For a complete list of REST URIs and the content schema please see

The WADL is available here

Currently, (at the time of writing this article) only sychronous (server API, client has to wait for the response on the same connection) support is available, keep watching this space, i will update as soon as we have async APIs.


rest-1.png14.7 KB
rest-2.png18 KB
Related Topics >>