Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Sourav #1
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: What should I use as the room-jid?
HI.

I'm trying a build a group chat application where I want use the same UI for one-to-one chat as well as for the group chat. But I'm having a problem to decide what should be the room JID. 

What should I pass as the "RoomJID" in the CreateReservedRoom(RoomJid) function to create a chat room?

Thanks in advance!
Avatar
Alex #2
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The roomjid has the following format:
roomname@muc-server/Nickname

The Muc server normallys runs on a subdomain of your chatserver. But you can use of course any Muc server on the federated XMPP network.

For our server ag-software.de the muc server jid is conference.ag-software.de. So if I want to create a room "test" the room Jid is test@conference.ag-software.de. But normally you use the MucManager class which creates this all automatically when you pass roomname, muc server and your nickname.

Alex
Avatar
Sourav #3
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
Thanks for that quick reply, Alex.

In my application, the users use their google accounts to chat. Its a sort of gtalk application with customized changes as per the requirements. What should be the roomJID in that case?

Like I said, the user should be able to create a chat room during a one-to-one chat and add users so that they can have a group chat.

I'm trying to create a room as following when a user adds a new member to the chat:

          Jid roomJID = new Jid("groupchat@talk.google.com");  
         // This is what I'm no able to under as to how to create a roomJID that will incorporate all the users!
        
          muc = new MucManager(xmppCon);
        
          muc.CreateReservedRoom(roomJID);
           
          muc.JoinRoom(roomJID, newMemberJID.user); 

And after that sending messages as "groupchat" to the "roomJID" instead of sending to a particular user.

The messages are not sent to the users but instead are turned into "error" type and are reverted.
Avatar
Sourav #4
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
I even tried :

XmppClientConnection conn = new XmppClientConnection("ag-software.de");          
        
            muc = new MucManager(conn);

            m_RoomJid = new Jid("groupchat@conference.ag-software.de");

            muc.CreateReservedRoom(m_RoomJid);
           
            muc.JoinRoom(m_RoomJid, "user1");      
            muc.JoinRoom(m_RoomJid, "user2");

But still the same result. The "error" type is reverted saying "Conference doesn't exist!"

Will be grateful  for any help.
Avatar
Sourav #5
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
Typing error! I meant :
    • "Conference room doesn't exist"
Avatar
Alex #6
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You order is wrong.

You have to call first JoinRoom() followed by CreateReservedRoom().

JoinRoom enters the room when it exists, or creates and enters the room when it doesn't exist.

Alex
Avatar
Sourav #7
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
Hi.

On changing the order like you said, I get a 404 error - "Remote server not found"
Avatar
Alex #8
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Then the server you are logged in to does not talk to our group chat server.

Alex
Avatar
Sourav #9
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
I'm logged into a gmail account. Does it not talk to your group chat server?

If no, then can you, please, suggest any other group chat server that will respond?
Avatar
Sourav #10
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
I have tried "jabber.org" server for group chat as well. Gives the same error!
Avatar
Alex #11
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
then your server is not setup correctly for federation. Eitehr install your local server with groupchat support, or create an account on a public server like jabber.org which is setup correctly.

Alex
Avatar
Sourav #12
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
But as per requirements, the users can only login through their gmail accounts. I have to initiate a MUC between them.

Is it possible to login with gmail account and then use the chat room of another server like yours (conference.ag-software.de) ?
Avatar
Alex #13
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
if you use Gmail Ids you can use Googles group chat server. AFAIK the Jid is groupchat.google.com. You should not use other foreign servers for your company or client without asking them or checking the policies.

See also: http://wiki.bitlbee.org/GtalkGroupchats
Avatar
Sourav #14
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
Thanks a ton, Alex. You have been a great help. The group chat is working with "groupchat.google.com". Still there are some little issues.   I'll get back to you in case I need more advice on this application.

Regards!
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS