SIP Servlet Engine© Documentations
 
  Top >   SIP Servlet Programming >    Basic Components >   SIP Signaling Component >   B2BUA Function
 
 

B2BUA Function

B2BUA (Back-to-Back User Agent) provides the way to communicate using two separated dialogs created after a dialog is terminated within a server. B2BUA is greatly different from the normal proxy process in that messages can be processed very flexibly because two separated dialogs are independent of each other.

Figure 1 shows that the B2BUA servlet functions as a bridge to receive INVITE[A] from User A and send INVITE[B] to User B. These two INVITE requests belong to different dialogs in the SIP protocol.


Figure 1: Sequence of B2BUA Function

The B2BUA function itself does not offer any new functions. By creating an application that inherits this class, you can easily implement B2BUA-based signaling. So, SIP Servlet Engine provides the SIP servlet that has the B2BUA function as one of basic components.

B2BUAServlet Class

com.oki.sip.equips.signal;

public abstract class B2BUAServlet extends BasicSipServlet {

    public abstract SipURI resolveSipURI(SipServletRequest req);

    protected  void connectSessions(SipSession session1, SipSession session2);
}

resolveSipURI is an abstract method that returns the URI of the destination. Any inherited class must define this method to return the destination of the SIP request specified in the argument. The B2BUA servlet sends back the request with this return value set to the Request URI.

The following example describes the implementation of sending back a request with contact information corresponding to the URI of the To header set for the destination.

SipURI callee = (SipURI) req.getTo().getURI();
List contactList = location.getContacts(callee, null);
return (SipURI) ((Address) contactList.get(0)).getURI();

connectSessions is a method that associates two dialogs comprising B2BUA with each other. This method is used for an application to associate two SIP sessions.

Last Modified:Sat Mar 20 02:43:23 PM JST 2004