The Source for Java Technology Collaboration
User: Password:
Register | Login help    

Search

Online Books:
java.net on MarkMail:


Writing your first IM server using SailFin CAFE

Posted by binod on October 27, 2009 at 8:58 AM PDT

In this edition, I am explaining, how to write a simple IM server using SailFin CAFE.

If you have read my earlier blogs on SailFin CAFE (here and here) then there is nothing additional need to be done!. The same applications that supports 2-party calls or Conference application are already capable of handling IM between two users.

package my.test;
@org.glassfish.cafe.api.bean.CommunicationBean
public class YourCommunicationPOJO {
}

That means the above code will support IM also, apart from supporting 2-party calls.

Here are the steps to run this application.

  • Download and Install latest SailFin V2 build
  • Download and install latest SailFin CAFE build.
  • Package the application using the normal web application packaging format. Use your favorite IDE to do that. For compilation, please use SAILFIN_HOME/lib/communication-api.jar.
  • Start/Restart SailFin and deploy the application (eg: asadmin deploy firstcafe.war)
  • Now your application is ready to test against any SIP phones. To use X-Lite sip phone, follow the steps below.

  • Setup two X-Lite phones with accounts "alice@example.com" and "bob@example.com" respectively. They will register with SailFin CAFE
  • Send IM messages between alice and bob.


  • In the following weeks, I will cover more features like, integration with web applications, redirecting the call, rejecting call, typing detection etc.

    Related Topics >> Blogs      Glassfish      Instant Messaging      J2EE      Java Enterprise      Open Source      
    Comments
    Comments are listed in date ascending order (oldest first)