Enterprise Instant Messaging (Microsoft Unified Communications , IBM Sametime, Jabber)

Comprehensive Instant Messaging information resource for enterprise IT professionals
posts - 94, comments - 0, trackbacks - 0

Creating and Sending custom N-way Chat invites using Sametime Java Toolkit

Nway invites allow multiple users to communicate in a single chat session. This article specifies the process to create a Nway invite programmatically using Sametime Java toolkit and sending it other users.
 
 Step1: Add following import statements:
     import com.lotus.sametime.post.PostService;
     import com.lotus.sametime.post.Post;
     import com.lotus.sametime.core.types.STUser;
     import com.lotus.sametime.core.types.STId;
 
 Step2: Add the following function. This function demonstrates the process of creating and sending N-Way invite:
     public void createNwayInvite() {
         com.lotus.sametime.core.util.NdrOutputStream ndrOutputStream = new com.lotus.sametime.core.util.NdrOutputStream();
         try {
                 ndrOutputStream.writeLong(0);
                 ndrOutputStream.writeBoolean(false);
                 ndrOutputStream.writeShort(0);
                 ndrOutputStream.writeUTF("<Custom PlaceID>");
                 ndrOutputStream.writeUTF("");
                 ndrOutputStream.writeUTF("<YourSametimeServer.com>");
                 ndrOutputStream.writeBoolean(false);
                 ndrOutputStream.writeBoolean(false);
                 ndrOutputStream.writeUTF("");
                 ndrOutputStream.writeUTF("");
                 ndrOutputStream.writeUTF("");
                 ndrOutputStream.writeLong(0);
             } catch (IOException ex1)  {
                 ex1.printStackTrace();
             }
 
             STUser STUser = new STUser(new STId("<User STID>",""),"","");
             STUser[] STUsers = new STUser[] { STUser};
             _Post = _PostService.createPost(25,"<Place Title>","<Message:Join the meeting>",0,ndrOutputStream.toByteArray(),STUsers,true);
             _Post.addPostListener(this);
             _Post.send();
     }

Print | posted on Wednesday, May 23, 2007 7:06 PM |