SIP Servlet Engine© Documentations
 
  Top >   SIP Servlet Programming >  Examples of SIP Applications
 
 

Examples of SIP Applications

This document provides a number of SIP application samples you can create using SIP servlets. Most of the examples below are implemented in sip-demo where you can actually see how these applications work.

Proxy Server

The first example is the simplest SIP application, SIP proxy server.

The figure below shows a sequence where User A calls to User B.


Figure 1: SIP Sequence Example of Proxy Server

The redirecting function of the SIP proxy can use the Proxy class defined by the SIP Servlet API. By implementing a function of specifying a destination address in the Proxy class, you can create a minimum required element as a proxy server.

SIP proxy has various functions such as forking and conditional redirection. You can add these functions to provide your own function like redirection in case of absence as shown below.

The development tool ProxyServlet takes destination information from the location management component. When redirection fails or time out, there is a function of redirecting messages to other services such as voice mail through the Web screen.

Click2dial

Click2Dial is a function that enables you to call to an address by clicking the address on the Web screen.

Generally, you can implement Click2Dial using any one of three methods:

  1. Register a soft phone as a helper application of a Web browser, and when a user clicks an address, pass the event to the start-up argument of the terminal. One example is a start-up process with the tel: protocol. You can easily implement this method since you only need to perform terminal-side configuration. But you can only pass a telephone number.
  2. Register a soft phone as a helper application of a Web browser. When a user clicks an address, a normal HTTP request is issued to the server. Use the returned data to start the terminal. This method allows you to add more information due to server access. Note that you can start a soft phone only on the same terminal.
  3. When a user clicks the address, a normal HTTP request is sent to the server that establishes a call between two users. This kind of Click2Dial is called 3PCC (Third Party Call Control).

The third method (3PCC) is suitable for SIP servlets since they can perform SIP signaling. 3PCC is a model where the third party controls the call, and therefore can be used for other services. For example,

  • A conferencing service where a message is sent to all participants at the specified time for starting the conference, and the call is disconnected at the end time.
  • A Click2Dial service where an external terminal including a mobile phone receives the response to the click event instead of the soft phone on the same PC.
  • A service that functions as an operator to establish a call between two terminals.

These services can be implemented with 3PCC. Also, since the 3PCC controller functions as B2BUA, you can redirect the destination to another UA for interrupt.

sip-demo provides a simple Click2Dial service using 3PCC. Figure 2 illustrates a brief scenario.


Figure 2: Example Scenario of Click2Dial using 3PCC

  1. User A uses a Web browser to display his or her buddy list or address book.
  2. The server inquires the location management component about the state of the buddy and gets the state (online/offline).
  3. User A selects the destination (User B in this example) and clicks the link. Clicking it generates a HTTP request that is sent to the Web application.
  4. When the Web application receives the Click2Dial request, it notifies the 3PCC servlet of this request. The 3PCC servlet then establishes a session between User A and B based on the received request.
  5. Once the session established, User A and B can talk each other.

Figure 3 shows the HTTP and SIP sequence that implements the scenario. Red lines represent HTTP, blue and green lines represent SIP. This sequence is the simplest example of 3PCC that is defined in draft-ietf-sipping-3pcc-06.txt as Type I. SIP Servlet Engine provides a SIP servlet (CallControlServlet) that performs the 3PCC process as one of the basic components. CallControlServlet supports Type1,Type3, and Type4 defined in the above draft and functions (for example, returning the call state to a requester as an event).


Figure 3: Example of 3PCC HTTP/SIP Sequence (Type1)

B2BUA

B2BUA (Back-to-back User Agent) refers to a method of SIP signaling, not a particular application function. B2BUA can be used as an efficient framework when you build a SIP-enabled application on the server side. SIP Servlet Engine builds the 3PCC servlet shown above on B2BUA, and provides a B2BUA servlet as part of the basic components.

With B2BUA, a server application functions as a user agent (UA) and two or more SIP dialogs are associated with each other.

The following example shows how a B2BUA servlet receives an INVITE request from User A and sends it to User B.

This sequence seems to be the same as normal proxying, but is different from a SIP transaction point of view. For proxying, the above four SIP messages belong to the same SIP dialog. For B2BUA, the B2BUA servlet terminates the SIP transaction before passing to the destination. This means User A (blue) and User B (red) belong to different SIP dialogs.

Taking advantage of such feature of B2BUA, you can develop the following application.

Using these functions:
    • A service where charges are per call and a direct call between a guest and teacher is not allowed (such as Keen.com and English schools )
    • A service to log chat messages
You can develop these applications.
  • You can take advantage of the fact that User A only communicates with B2BUA. You can create a star network consisting of the B2BUA servlet and terminals. This enables a terminal that supports only one-to-one communication to use a 1- to-n service.
  • Since B2BUA continues to mediate until the SIP dialog terminates, you can intervene in a session during a call. A typical example is the conferencing service described above.

Voice Mail

The following figure illustrates a sequence of voice mail.

In this application, the SIP servlet (RecorderServlet) functions as a terminal. It handles an incoming call from User A, establishes a RTP session, and records voice data as voice mail.

Generally, recorded data on voice mail is played by telephone. In sip-demo, data is recorded in the AVI format and played by an application such as Windows Media Player.

When designing the system, note that such application may handle a lot of packets.

Chat Room

A chat room is an example application of B2BUA. Providing a star connection around a chat room servlet enables chatting by multiple users.

OKISoftphone supports 1-to-1 chatting. For conference, maximum of four users.

Redirection in Case of Absence

Combining the above applications, you can provide various functions.

The figure below shows an example of the combination of 3PCC and voice mail. When a session can not be established due to a busy line, it asks a user whether he or she wants to record a message on voice mail.

In the above example, the Web screen is already opened when 3PCC call is made. When the session establishment fails, the system can use the progress monitor to ask the user for recording the message on voice mail.

For a normal proxy process that does not use a Web screen, the same function can be implemented by popping-up a Web browser from the soft phone.

This application needs a function that starts a Web browser when the Contact header contains HTTP URL.

OKISoftphone supports this function.

Applications

This document provides only simple applications to clarify the use of the product. Combining and adapting these elements allows you to develop various applications.

Such applications include:

  • Adding VoIP, chat, and presence functions to a traditional Web application.
    • Click2dial
    • Calls using presence information.
    • Location tracking
  • Adding a Web user interface to a traditional telecommunication application.
    • Voice Mail
    • Redirection of call
    • Alternative IVR (Interactive Voice Response) system
    • Call center, help desk
  • A new application using SIP and HTTP.
    • Home security
    • Information appliance
    • Real time Web service with event notification


*1: Type3, Type4

Last Modified:Mon May 17 18:27:03 JST 2004