[jdev] How to Do Groupchat in Jabber

ashiraz ashiraz.3ir0kn at no-mx.jabberforum.org
Wed Nov 12 00:03:03 CST 2008


Ok I would like to send a message to a chatroom on a jabber server. 

The server I am trying to write a message to is for example
sip at jabber.ietf.org



This is how far I have reached with my own ejabbered server installed
locally on my machine : 

c1 (I am trying to communicate with the jabber server on my machine): 

<stream:stream xmlns:stream='http://etherx.jabber.org/streams'
to='HenryVIII'  xmlns='jabber:client'>


s1 (response from the jabber server on my machine): 

<?xml version='1.0'?><stream:stream
xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams' id='2804214120'
from='henryviii' xml:lang='en'>

c2 (I am requesting authentication):


<iq type='get' to='HenryVIII' id='auth1'>
<query xmlns='jabber:iq:auth'>
<username>testanon</username>
</query>
</iq>

s2(my server sends back form to fill out):

<iq type='result' from='HenryVIII' id='auth1'>
<query xmlns='jabber:iq:auth'>
	<username>admin</username>
	<password/>
	<digest/>
	<resource/>
</query>
</iq>

c3 (I send back filled out form):

<iq type='set' id='auth2'>
<query xmlns='jabber:iq:auth'>
<username>admin</username>
<password>admin</password>
	     <resource>MyResource</resource>
</query>
</iq>

s3 (server responds : sweet response!):

<iq type='result' id='auth2'/>

c4(i try to join a multi user chat room):

<presence
from='admin at HenryVIII'
to='sip at jabber.ietf.org/IETF Announcer'/>

(no response from server)

c4.5 (I think maybe I have joined the chatroom somehow even though my
client/user does not show up in the chatroom- but I send it a test
message anyways) : 

<message to='sip at jabber.ietf.org' from='admin at HenryVIII'
type='groupchat'>
<body>hello my friend ...</body>
</message>

After a long pause I get this response : 

<presence from='sip at jabber.ietf.org/IETF Announcer'
to='admin at henryviii/MyResource' type='error'>

<error code='404' type='cancel'><remote-server-not-found
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</presence>

<message from='sip at jabber.ietf.org' to='admin at henryviii/MyResource'
type='error'>
<body>hello my friend ...</body>
<error code='404' type='cancel'>
<remote-server-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</message>

...

is there an example sample exchange that I could use? How do I monitor
the xmpp communicatio to and from an xmpp client (someone else wrote
like psi or gmain) and the chat server? I recall reading about tcpdump
(maybe that will help with a sample exchange?)


-- 
ashiraz
------------------------------------------------------------------------
ashiraz's Profile: http://www.jabberforum.org/member.php?userid=17305
View this thread: http://www.jabberforum.org/showthread.php?t=1065




More information about the JDev mailing list