raykichi / jabber-net

Automatically exported from code.google.com/p/jabber-net
Other
0 stars 0 forks source link

<message> packets not getting delivered to client if addressed to Bare JID #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using the Jabber-net library to build an IM client that connects to 
the eJabberd server.

The problems that I am encountering is that <code><message></code> packers 
are not getting delivered to my client if they are addressed to the bare 
JID.

For example if I have three clients
1) IM custom (logged in as source@server/custom)
2) IM custom (logged in as destination@server/custom)
3) IM Spark (logged in as destination@server/Spark)

if #1 sends the following message
<message id="JN_17" to="destination@server/custom" type="chat" 
from="source@server/custom">
  <thread>da19059b-dbdb-48bd-8b2b-8deac4ce58c0</thread>
  <body>Test Message 1</body>
</message>

The message is delivered to #2 only as it should be.

But if #1 sends the following message
<message id="JN_17" to="destination@server" type="chat" 
from="source@server">
  <thread>da19059b-dbdb-48bd-8b2b-8deac4ce58c0</thread>
  <body>Test Message 2</body>
</message>

The message is delivered ONLY to the Spark client (#3) when it should be 
delivered to both (#2) and (#3).

I suspect that the issue could be cuase by how I am connecting to eJabberd 
from client #2?  Could this be the case?  Does anyone have any ideas as to 
what could cuase a message sent to the server not to be routed to a 
specific resource?

Thanks,

Casey

Original issue reported on code.google.com by BCaseyHa...@gmail.com on 3 Dec 2008 at 3:09

GoogleCodeExporter commented 9 years ago
This is an ejabberd issue.  One potential solution would be for them to 
implement 
Message Mine'ing: http://xmpp.org/extensions/inbox/mine.html

Original comment by hil...@gmail.com on 3 Dec 2008 at 3:31

GoogleCodeExporter commented 9 years ago
One difference that I have noticed is that the Spark client is using PLAIN 
authentication and the Jabber-Net library is using <auth mechanism="DIGEST-MD5" 
xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />

A second difference that I noticed is that 
Spark is establishing a session using:
<iq id="J74ma-1" type="set">
  <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
</iq>

and Jabber-Net is using:
<iq id="JN_2" type="set" to="v-doc-imchat.infoassure.local">
    <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
</iq>

I don't know if including the 'to' attribute matters or not.

Original comment by BCaseyHa...@gmail.com on 3 Dec 2008 at 3:41

GoogleCodeExporter commented 9 years ago
What puzzles me is why messages are being delivered to Spark clients and not to 
the 
Jabber-Net baised client.  Could you give details to why you believe this is an 
eJabberd issue.  If the behavior was happening with both the Spark Client and 
with 
my client based on the Jabber-Net Libary then I would conclude that the issue 
lies 
with eJabberd.

I did the following experiment:

Using just 2 clients
1) IM custom (logged in as source@server/custom)
2) IM custom (logged in as destination@server/custom)

if #1 sends the following message
<message id="JN_17" to="destination@server/custom" type="chat" 
from="source@server/custom">
  <thread>da19059b-dbdb-48bd-8b2b-8deac4ce58c0</thread>
  <body>Test Message 1</body>
</message>

The message is delivered to #2 as it should be.

But if #1 sends the following message
<message id="JN_17" to="destination@server" type="chat" 
from="source@server">
  <thread>da19059b-dbdb-48bd-8b2b-8deac4ce58c0</thread>
  <body>Test Message 2</body>
</message>

The message is NOT delivered to (#2) when it should be

This leads me to believe that the issue is not, per . . . 

At the time of original writing of this XEP, many XMPP servers handle message 
stanzas sent to a user@host (or "bare") JID with no resource by delivering that 
message only to the resource with the highest priority for the target user

that the message is only being sent to the highest priority becuase there is 
ONLY 
one recieving user logged on.

Thanks,

Casey

Original comment by BCaseyHa...@gmail.com on 3 Dec 2008 at 3:52

GoogleCodeExporter commented 9 years ago
Once I determined that the issue was related to the routing of the Message 
packets 
in general I started experimenting with Direct Invitation to a room as defined 
in:

http://xmpp.org/extensions/xep-0249.html

When I did this I got the following unexpected result:

Using just 2 clients
1) IM custom (logged in as source@server\custom)
2) IM Spark (logged in as destination@server\spark)

When I send the message:

<message id="JN_23" from="source@server\custom" 
to="destination@server\spark"><x 
jid="room1@server" xmlns="jabber:x:conference" /></message>

The response I get is:

<message from='destination@server\spark' to='source@server/custom' type='error' 
id='JN_23'><x jid='room1@server' xmlns='jabber:x:conference'/><error code='404' 
type='cancel'><remote-server-not-found xmlns='urn:ietf:params:xml:ns:xmpp-
stanzas'/></error></message>

Using the same two clients when I send the message:

<message id="JN_23" from="source@server\custom" to="destination@server"><x 
jid="room1@server" xmlns="jabber:x:conference" /></message>

the message is delivered just fine

This surprised be a little.  So something is going on that is resulting in:
1) messages where the to attribute includes the Resource in NOT being delivered 
to 
SPARK clients
2) messages where the to attribute excludes the Resource in NOT being delivered 
to 
my custom client that uses the Jabber-Net library

Original comment by BCaseyHa...@gmail.com on 3 Dec 2008 at 7:06

GoogleCodeExporter commented 9 years ago
Thus . . .

1) messages are delivered to the Spark client only if the to attribute excludes 
the 
Resource

2) messages are delivered to my custom client that uses the Jabber-net libary 
ONLY 
if the to attribute includes the Resource

Original comment by BCaseyHa...@gmail.com on 3 Dec 2008 at 7:09