Ejabberd 14.12 mod_mam multisession issue - xmpp

I have configured ejabberd 14.12 server with enabled multisession and working mod_mam (XEP-0313 v0.2, https://github.com/kongo2002/ejabberd-mod-mam, http://xmpp.org/extensions/attic/xep-0313-0.2.html)
mod_mam works great when i send message from user with one connected session to different user with one session
However if user-1#example has 2 online sessions with different resources and user-2#example sends to user-1#example (to bare JID) one message - mod_mam saves two messages
ejabberd log:
<0.708.0>#ejabberd_http_bind:http_put:792 Looking for session: <<"2a16b709927907352b5696d8c7fbb4bdc641c736">>
<0.606.0>#ejabberd_http_bind:handle_sync_event:440 New request: {http_put,152025,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"152025">>},{<<"sid">>,<<"2a16b709927907352b5696d8c7fbb4bdc641c736">>},{<<"key">>,<<"e9815d19f02d2ca9249209cdd82c818fae01b821">>}],[{xmlel,<<"message">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}],251,1,<<>>,{{10,0,2,2},49075}}
<0.606.0>#ejabberd_http_bind:handle_http_put_event:575 New request: {http_put,152025,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"152025">>},{<<"sid">>,<<"2a16b709927907352b5696d8c7fbb4bdc641c736">>},{<<"key">>,<<"e9815d19f02d2ca9249209cdd82c818fae01b821">>}],[{xmlel,<<"message">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}],251,1,<<>>,{{10,0,2,2},49075}}
<0.606.0>#ejabberd_http_bind:rid_allow:866 Previous rid / New rid: 152024/152025
<0.606.0>#ejabberd_http_bind:process_http_put:608 Actually processing request: {http_put,152025,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"152025">>},{<<"sid">>,<<"2a16b709927907352b5696d8c7fbb4bdc641c736">>},{<<"key">>,<<"e9815d19f02d2ca9249209cdd82c818fae01b821">>}],[{xmlel,<<"message">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}],251,1,<<>>,{{10,0,2,2},49075}}
<0.606.0>#ejabberd_http_bind:process_http_put:619 Key/OldKey/NextKey: e9815d19f02d2ca9249209cdd82c818fae01b821/4b0850aed0c7d411c41f28c041f0e176db7cf4d7/4b0850aed0c7d411c41f28c041f0e176db7cf4d7
<0.606.0>#ejabberd_http_bind:process_http_put:659 -- SaveKey: e9815d19f02d2ca9249209cdd82c818fae01b821
<0.606.0>#ejabberd_http_bind:process_http_put:671 reqlist: [{hbr,152025,<<"4b0850aed0c7d411c41f28c041f0e176db7cf4d7">>,[]},{hbr,152024,<<"882220e875a29152d9b15510b8673137e8360e42">>,[]}]
<0.606.0>#ejabberd_http_bind:process_http_put:717 really sending now: [{xmlel,<<"message">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}]
<0.607.0>#ejabberd_router:do_route:322 route
from {jid,<<"user-2">>,<<"ch">>,<<"ch_jsjac">>,<<"user-2">>,<<"ch">>,<<"ch_jsjac">>}
to {jid,<<"user-1">>,<<"ch">>,<<>>,<<"user-1">>,<<"ch">>,<<>>}
packet {xmlel,<<"message">>,[{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}
<0.496.0>#mod_mam:handle_cast:313 Packet: {xmlel,<<"message">>,[{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}
<0.607.0>#ejabberd_local:do_route:296 local route
from {jid,<<"user-2">>,<<"ch">>,<<"ch_jsjac">>,<<"user-2">>,<<"ch">>,<<"ch_jsjac">>}
to {jid,<<"user-1">>,<<"ch">>,<<>>,<<"user-1">>,<<"ch">>,<<>>}
packet {xmlel,<<"message">>,[{<<"to">>,<<"user"...>>},{<<"type">>,<<...>>}],[{xmlel,<<...>>,...}]}
<0.607.0>#ejabberd_sm:do_route:514 session manager
from {jid,<<"user-2">>,<<"ch">>,<<"ch_jsjac">>,<<"user-2">>,<<"ch">>,<<"ch_jsjac">>}
to {jid,<<"user-1">>,<<"ch">>,<<>>,<<"user-1">>,<<"ch">>,<<>>}
packet {xmlel,<<"message">>,[{<<"to">>,<<"user"...>>},{<<"type">>,<<...>>}],[{xmlel,<<...>>,...}]}
<0.607.0>#ejabberd_sm:route_message:658 sending to process <0.586.0>
<0.607.0>#ejabberd_sm:route_message:658 sending to process <0.649.0>
<0.615.0>#ejabberd_http_bind:prepare_response:914 OutPacket: [{xmlstreamelement,{xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ch_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}}]
<0.615.0>#ejabberd_http_bind:send_outpacket:1056 --- outgoing data ---
<body xmlns='http://jabber.org/protocol/httpbind'><message xmlns='jabber:client' from='user-2#example/ch_jsjac' to='user-1#example' type='chat'><body>2-222</body></message></body>
--- END ---
<0.580.0>#ejabberd_http_bind:prepare_response:914 OutPacket: [{xmlstreamelement,{xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ch_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}}]
<0.580.0>#ejabberd_http_bind:send_outpacket:1056 --- outgoing data ---
<body xmlns='http://jabber.org/protocol/httpbind'><message xmlns='jabber:client' from='user-2#example/ch_jsjac' to='user-1#example' type='chat'><body>2-222</body></message></body>
--- END ---
<0.496.0>#mod_mam:handle_cast:313 Packet: {xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ch_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}
<0.496.0>#mod_mam:handle_cast:313 Packet: {xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ch_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"2-222">>}]}]}
We can see double 'handle_cast' from mod_mam.
When i querying messages from archive i got something like this:
<message xmlns='jabber:client' from='user-1#example' to='user-1#example/42114606331421936688301010'>
<result xmlns='urn:xmpp:mam:tmp' id='54C104E31E374104E800009B'>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2015-01-22T14:10:43Z'/>
<message from='user-2#example/8658298161421935653320719' to='user-1#example' type='chat'>
<body>
2-222
</body>
</message>
</forwarded>
</result>
</message>
<message xmlns='jabber:client' from='user-1#example' to='user-1#example/42114606331421936688301010'>
<result xmlns='urn:xmpp:mam:tmp' id='54C104E31E374104E800009C'>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2015-01-22T14:10:43Z'/>
<message from='user-2#example/8658298161421935653320719' to='user-1#example' type='chat'>
<body>
2-222
</body>
</message>
</forwarded>
</result>
</message>
But i want receive only one message without duplicate.
Similarly if user-1#example has 3 online sessions with different resources and user-2#example sends to user-1#example (to bare JID) one message - mod_mam saves two messages.
ejabberd log:
<0.690.0>#ejabberd_http_bind:http_put:792 Looking for session: <<"2a16b709927907352b5696d8c7fbb4bdc641c736">>
<0.606.0>#ejabberd_http_bind:handle_sync_event:440 New request: {http_put,151909,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"151909">>},{<<"sid">>,<<"2a16b709927907352b5696d8c7fbb4bdc641c736">>},{<<"key">>,<<"97451cccc5e5f52563e625169fbc6fecc17ae950">>}],[{xmlel,<<"message">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}],251,1,<<>>,{{10,0,2,2},47540}}
<0.606.0>#ejabberd_http_bind:handle_http_put_event:575 New request: {http_put,151909,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"151909">>},{<<"sid">>,<<"2a16b709927907352b5696d8c7fbb4bdc641c736">>},{<<"key">>,<<"97451cccc5e5f52563e625169fbc6fecc17ae950">>}],[{xmlel,<<"message">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}],251,1,<<>>,{{10,0,2,2},47540}}
<0.606.0>#ejabberd_http_bind:rid_allow:866 Previous rid / New rid: 151908/151909
<0.606.0>#ejabberd_http_bind:process_http_put:608 Actually processing request: {http_put,151909,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"151909">>},{<<"sid">>,<<"2a16b709927907352b5696d8c7fbb4bdc641c736">>},{<<"key">>,<<"97451cccc5e5f52563e625169fbc6fecc17ae950">>}],[{xmlel,<<"message">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}],251,1,<<>>,{{10,0,2,2},47540}}
<0.606.0>#ejabberd_http_bind:process_http_put:619 Key/OldKey/NextKey: 97451cccc5e5f52563e625169fbc6fecc17ae950/17ba9df4939c3fbd9c7f5021af54e4edb6d11496/17ba9df4939c3fbd9c7f5021af54e4edb6d11496
<0.606.0>#ejabberd_http_bind:process_http_put:659 -- SaveKey: 97451cccc5e5f52563e625169fbc6fecc17ae950
<0.606.0>#ejabberd_http_bind:process_http_put:671 reqlist: [{hbr,151909,<<"17ba9df4939c3fbd9c7f5021af54e4edb6d11496">>,[]},{hbr,151908,<<"7a3ebe3b5639ddcc6f73e004c58966e21364257d">>,[]}]
<0.606.0>#ejabberd_http_bind:process_http_put:717 really sending now: [{xmlel,<<"message">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}]
<0.607.0>#ejabberd_router:do_route:322 route
from {jid,<<"user-2">>,<<"ch">>,<<"ex_jsjac">>,<<"user-2">>,<<"ch">>,<<"ex_jsjac">>}
to {jid,<<"user-1">>,<<"ch">>,<<>>,<<"user-1">>,<<"ch">>,<<>>}
packet {xmlel,<<"message">>,[{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}
<0.496.0>#mod_mam:handle_cast:313 Packet: {xmlel,<<"message">>,[{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}
<0.607.0>#ejabberd_local:do_route:296 local route
from {jid,<<"user-2">>,<<"ch">>,<<"ex_jsjac">>,<<"user-2">>,<<"ch">>,<<"ex_jsjac">>}
to {jid,<<"user-1">>,<<"ch">>,<<>>,<<"user-1">>,<<"ch">>,<<>>}
packet {xmlel,<<"message">>,[{<<"to">>,<<"user"...>>},{<<"type">>,<<...>>}],[{xmlel,<<...>>,...}]}
<0.607.0>#ejabberd_sm:do_route:514 session manager
from {jid,<<"user-2">>,<<"ch">>,<<"ex_jsjac">>,<<"user-2">>,<<"ch">>,<<"ex_jsjac">>}
to {jid,<<"user-1">>,<<"ch">>,<<>>,<<"user-1">>,<<"ch">>,<<>>}
packet {xmlel,<<"message">>,[{<<"to">>,<<"user"...>>},{<<"type">>,<<...>>}],[{xmlel,<<...>>,...}]}
<0.607.0>#ejabberd_sm:route_message:658 sending to process <0.586.0>
<0.607.0>#ejabberd_sm:route_message:658 sending to process <0.649.0>
<0.607.0>#ejabberd_sm:route_message:658 sending to process <0.683.0>
<0.615.0>#ejabberd_http_bind:prepare_response:914 OutPacket: [{xmlstreamelement,{xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ex_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}}]
<0.615.0>#ejabberd_http_bind:send_outpacket:1056 --- outgoing data ---
<body xmlns='http://jabber.org/protocol/httpbind'><message xmlns='jabber:client' from='user-2#example/ex_jsjac' to='user-1#example' type='chat'><body>3-333</body></message></body>
--- END ---
<0.580.0>#ejabberd_http_bind:prepare_response:914 OutPacket: [{xmlstreamelement,{xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ex_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}}]
<0.580.0>#ejabberd_http_bind:send_outpacket:1056 --- outgoing data ---
<body xmlns='http://jabber.org/protocol/httpbind'><message xmlns='jabber:client' from='user-2#example/ex_jsjac' to='user-1#example' type='chat'><body>3-333</body></message></body>
--- END ---
<0.686.0>#ejabberd_http_bind:prepare_response:914 OutPacket: [{xmlstreamelement,{xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ex_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}}]
<0.686.0>#ejabberd_http_bind:send_outpacket:1056 --- outgoing data ---
<body xmlns='http://jabber.org/protocol/httpbind'><message xmlns='jabber:client' from='user-2#example/ex_jsjac' to='user-1#example' type='chat'><body>3-333</body></message></body>
--- END ---
<0.496.0>#mod_mam:handle_cast:313 Packet: {xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ex_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}
<0.496.0>#mod_mam:handle_cast:313 Packet: {xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ex_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}
<0.496.0>#mod_mam:handle_cast:313 Packet: {xmlel,<<"message">>,[{<<"from">>,<<"user-2#example/ex_jsjac">>},{<<"to">>,<<"user-1#example">>},{<<"type">>,<<"chat">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"3-333">>}]}]}
<0.580.0>#ejabberd_http:process_header:283 (#Port<0.5639>) http query: 'POST' /http-bind/
<0.580.0>#ejabberd_http:process_request:448 client data: <<"<body rid='568139' sid='fd0a27af99432dc8b6a252ce6dc87e35da715cc1' xmlns='http://jabber.org/protocol/httpbind' key='f4967d3d77af57b2c35847986de0720b8ad6215c' > </body>">>
<0.580.0>#ejabberd_http:process:359 [<<"http-bind">>] matches [<<"http-bind">>]
<0.580.0>#ejabberd_http:process:363 [{'Accept-Language',<<"ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4">>},{'Accept-Encoding',<<"gzip, deflate">>},{'Referer',<<"http://localhost:3000/profile">>},{'Accept',<<"*/*">>},{'Content-Type',<<"text/xml; charset=UTF-8">>},{'User-Agent',<<"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36">>},{<<"Origin">>,<<"http://localhost:3000">>},{'Content-Length',<<"166">>},{'Connection',<<"keep-alive">>},{'Host',<<"localhost:5280">>}]
<0.580.0>#mod_http_bind:process:68 Incoming data: <body rid='568139' sid='fd0a27af99432dc8b6a252ce6dc87e35da715cc1' xmlns='http://jabber.org/protocol/httpbind' key='f4967d3d77af57b2c35847986de0720b8ad6215c' > </body>
<0.580.0>#ejabberd_http_bind:parse_request:1128 --- incoming data ---
<body rid='568139' sid='fd0a27af99432dc8b6a252ce6dc87e35da715cc1' xmlns='http://jabber.org/protocol/httpbind' key='f4967d3d77af57b2c35847986de0720b8ad6215c' > </body>
Questions:
It is normal behaviour for mod_mam(XEP-0313) or bug of module?
How i may fix it?
Issue on github: https://github.com/kongo2002/ejabberd-mod-mam/issues/7

From the XMPP MAM specification, it looks like you need to query on full JID (with the resource) if you do not want to get message from all resources. It seems like the correct behavior.
Reference: http://xmpp.org/extensions/xep-0313.html#filter-jid

mod_mam from ejabberd-contrib works perfect. Problem solved.

Related

Unable to send messages to a MUC room

When I try to send a message to an XMPP MUC Room such as:
<message to="room#conference.chat.example.com" type="groupchat">
<body>TEST</body>
</message>
The message will not be delivered to other participants in the room and I get this response from the server:
<message
xmlns="jabber:client" lang="en" to="karim#chat.example.com/resource" from="room#conference.chat.example.com" type="error">
<error code="503" type="cancel">
<service-unavailable
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
</service-unavailable>
<text
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" lang="en">User session not found
</text>
</error>
<body>TEST</body>
Im using ejabberd Community Server v20.07 installed into Docker using the official image.
The full ejabberd.yml configuration file that Im using can be found here.
The full server log can be found here.
The above error happen with different clients and not only one.
You have configured this, and this is completely wrong:
hosts:
- chat.example.com
- conference.chat.example.com
modules:
mod_muc:
...
I guess you didn't notice the option HOSTS in the MOD_MUC documentation: https://docs.ejabberd.im/admin/configuration/modules/#mod-muc
Try something like this:
hosts:
- chat.example.com
modules:
mod_muc:
hosts:
- conference.#HOST#
...

Openfire server pep based avatars , Android client

I have setup openfire server and my android clients works well with it except that I am unable to publish avatars , the problem is that the server simply ignores the publish avatar iq packet , no errors , nothing in the log files. I am using standard XMPP pep avatar stanza , please hep
Thankyou for your replies everyone, I found that the issue is with openfire server 3.10 which does not parse the standard XEP 0084 stanza well, infact I found the logs and server was crashing so i modified the IQ as , for example this should be the standard IQ for publishing avatar
<iq type='set' from='juliet#capulet.lit/chamber' id='publish1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:avatar:data'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<data xmlns='urn:xmpp:avatar:data'>
qANQR1DBwU4DX7jmYZnncm...
</data>
</item>
</publish>
</pubsub>
</iq>
but as you can see there is no "to" address in the standard IQ , openfire server would create the pubsub node in DB and crash and would not reply with result asking the user to now publish metadata ,so what i had to do is send this packet and then the standard metadata packet , but then send meta data packet again with a "to" address which would be replied by the server as result that the metadata notification succeded as
standard meta data to be sent to server for the first time ,
<iq type='set' from='juliet#capulet.lit/chamber' id='publish2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:avatar:metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='urn:xmpp:avatar:metadata'>
<info bytes='12345'
id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
height='64'
type='image/png'
width='64'/>
</metadata>
</item>
</publish>
</pubsub>
</iq>
and then again like this with addition of "to" address
<iq type='set' from='juliet#capulet.lit/chamber' to="mydomain.com" id='publish2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:avatar:metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='urn:xmpp:avatar:metadata'>
<info bytes='12345'
id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
height='64'
type='image/png'
width='64'/>
</metadata>
</item>
</publish>
</pubsub>
</iq>
in the above way avatar publishing is working and Im successfully issuing a notification to other users also
and here is the server crash log incase
2016.03.02 10:41:02 ERROR [socket_c2s-thread-3]: org.jivesoftware.openfire.handler.IQHandler - Internal server error
java.lang.NullPointerException
at org.jivesoftware.openfire.pubsub.PubSubEngine.createNodeHelper(PubSubEngine.java:1165)
at org.jivesoftware.openfire.pubsub.PubSubEngine.publishItemsToNode(PubSubEngine.java:340)
at org.jivesoftware.openfire.pubsub.PubSubEngine.process(PubSubEngine.java:98)
at org.jivesoftware.openfire.pep.PEPServiceManager.process(PEPServiceManager.java:215)
at org.jivesoftware.openfire.pep.IQPEPHandler.handleIQ(IQPEPHandler.java:423)
at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:66)
at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:372)
at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:115)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:78)
at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:342)
at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler.java:99)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:307)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:199)
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:181)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:109)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:407)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:236)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703)
at java.lang.Thread.run(Unknown Source)

Does XMPP require a dialback?

I've been doing it as follows :
Step 1. <Stream>
Step 2. <Auth> (PLAIN)
Step 3. <Session>
Stuck here.
This tutorial does not mention dialback: http://ceit.uq.edu.au/content/how-xmpp-works-step-step
However, under 8.3. Protocol of the documentation, it says to use a dialback: http://xmpp.org/rfcs/rfc3920.html
Right now, this is the full response I get from my server:
<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1027203257' from='mysite.com' version='1.0' xml:lang='en'>
<stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='yy7di5kE0syuCXOQTXNBTclpJWo='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
<stream:error><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>
</stream:stream>
I've seen in some peoples code, after step 2, they run <stream> again, but in others they don't. Is this needed?
Server Dialback is uses for s2s (server-to-server) connections. You don't need it for c2s (client-to-server) connections.

Enabling mod_proxy65 on ejabberd server installed on ec2 ubuntu instance

I am working on a iOS chat application, so for media transfer to work i need to enable mod_proxy65, and i have enabled the same in ejabberd.cfg file with their default setting: {mod_proxy65[]}. on client side i am using the https://github.com/robbiehanson/XMPPFramework xmpp framework for iOS.
in TURNSocket.m i have used proxy candidate as dev.myserver.com in place of default jabber.org . now when I try to open the TURN connection, the series of iq received and sent are as follows:
SEND: <iq type="get" to="dev.myserver.com" id="A9876DD0-B13C-4DC7-B812-2A6E653288BC"><query xmlns="http://jabber.org/protocol/disco#items"/></iq>
RECV: <iq xmlns="jabber:client" from="dev.gungroo.com" to="smita#dev.myserver.com/24983171131368877324197828" id="A9876DD0-B13C-4DC7-B812-2A6E653288BC" type="result"><query xmlns="http://jabber.org/protocol/disco#items"><item jid="conference.dev.myserver.com"/><item jid="irc.dev.myserver.com"/><item jid="proxy.dev.myserver.com"/><item jid="pubsub.dev.myserver.com"/><item jid="vjud.dev.myserver.com"/></query></iq>
SEND: <iq type="get" to="proxy.dev.myserver.com" id="26D694FB-C679-478C-A3D1-A84B9A583534"><query xmlns="http://jabber.org/protocol/disco#info"/></iq>
RECV: <iq xmlns="jabber:client" from="proxy.dev.myserver.com" to="smita#dev.myserver.com/24983171131368877324197828" id="26D694FB-C679-478C-A3D1-A84B9A583534" type="result"><query xmlns="http://jabber.org/protocol/disco#info"><identity category="proxy" type="bytestreams" name="SOCKS5 Bytestreams"/><feature var="http://jabber.org/protocol/disco#info"/><feature var="vcard-temp"/><feature var="http://jabber.org/protocol/bytestreams"/><x xmlns="jabber:x:data" type="result"><field var="FORM_TYPE" type="hidden"><value>http://jabber.org/network/serverinfo</value></field></x></query></iq>
SEND: <iq type="get" to="proxy.dev.myserver.com" id="C60068A2-985C-4C5C-87B3-C9FFFB41FDF0"><query xmlns="http://jabber.org/protocol/bytestreams"/></iq>
RECV: <iq xmlns="jabber:client" from="proxy.dev.gungroo.com" to="smita#dev.myserver.com/24983171131368877324197828" id="C60068A2-985C-4C5C-87B3-C9FFFB41FDF0" type="result"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost jid="proxy.dev.myserver.com" host="10.212.103.159" port="7777"/></query></iq>
here is the problem, its returning me the internal ip address(10.212.103.159) of server dev.myserver.com, resulting in failure of making the TURN connection. why doesn't it return external ip address of proxy.dev.myserver.com ?
to be on the same page: proxy.dev.myserver.com and dev.myserver.com both points to same external ip. and the port 7777 is open at my server dev.myserver.com . anybody who have worked with the same, please help??
here is the last iq(sent and received) which shows the error message:
SEND
<iq type="set" to="smita1#dev.myserver.com/38303823331368691199448799" id="2D376DBF-D437-48C8-B0FF-B10A5CD73240">
<query xmlns="http://jabber.org/protocol/bytestreams" sid="2D376DBF-D437-48C8-B0FF-B10A5CD73240" mode="tcp">
<streamhost xmlns="http://jabber.org/protocol/bytestreams" jid="proxy.dev.myserver.com" host="10.212.103.159" port="7777"/>
</query>
</iq>
RECV
<iq xmlns="jabber:client" from="smita1#dev.myserver.com/38303823331368691199448799" to="smita#dev.myserver.com/278621573136869119737843" type="error" id="2D376DBF-D437-48C8-B0FF-B10A5CD73240">
<query xmlns="http://jabber.org/protocol/bytestreams" sid="2D376DBF-D437-48C8-B0FF-B10A5CD73240" mode="tcp">
<streamhost xmlns="http://jabber.org/protocol/bytestreams" jid="proxy.dev.myserver.com" host="10.212.103.159" port="7777"/>
</query>
<error type="cancel" code="501">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
it would be really great if someone can point me to the problem. Thanks!
This helped me to resolve the issue. xx.xx.xx.xx is my external ip:
{mod_proxy65, [{hostname, ["xx.xx.xx.xx"]}]},
Visit this ,I can give an idea [XMPPFramework - TURNSocket can't receive the data that sent by myself? ]
Also [http://xmpp.org/extensions/xep-0096.html],[ XMPP Sending/Receving file in iphone sdk ...? ]

send xmpp <message> to component on other domain

step 1:on the same domain(.myserver.kicks-ass.net), i able to send to the mycomponent,succesfully.
step 2:when i login to other domain ,example gmail.com and try send to another user on test#.myserver.kicks-ass.net, success as well.
step 3:just like step2, but i send the to mycomponent.myserver.kicks-ass.net , i get below error
<message xmlns='jabber:client'
to='mycomponent.myserver.kicks-ass.net'
from='user#gmail.com/123'
type='chat'>
<body>
just t4st
</body>
<x xmlns='jabber:x:event'>
<offline/>
<composing/>
</x>
</message>
<message xmlns='jabber:client'
to='user#gmail.com/123'
from='mycomponent.myserver.kicks-ass.net'
type='error'>
<body>
just t4st
</body>
<x xmlns='jabber:x:event'>
<offline/>
<composing/>
</x>
<error code='404'
type='cancel'>
<remote-server-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</message>
Do you have an SRV record for:
_xmpp-server._tcp.mycomponent.myserver.kicks-ass.net
You can test for this with the following shell command:
% dig +short -t SRV _xmpp-server._tcp.mycomponent.myserver.kicks-ass.net.
Can you telnet to that host/port from outside your network? For example:
% dig +short -t SRV _xmpp-server._tcp.jabber.org.
30 30 5269 hermes.jabber.org.
% telnet hermes.jabber.org 5269
Trying 208.68.163.220...
Connected to hermes.jabber.org.
Escape character is '^]'.
<<
<stream:error><bad-format xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></stream:stream>
Connection closed by foreign host