ejabberd - Comments for "message not getting delivered to bare id" https://www.ejabberd.im/node/3248 en Problem Solved https://www.ejabberd.im/node/3248#comment-53822 <p>It turns out that my problems was being cuased by the fact that the Resource was getting changed to -1 in a part of my code. Once I figured out that then the problems went away. </p> <p>Thanks again for the hints.</p> <p>Casey</p> Mon, 08 Dec 2008 13:40:25 +0000 BCaseyHanks comment 53822 at https://www.ejabberd.im priority not the issue https://www.ejabberd.im/node/3248#comment-53815 <p>My application was using a priority of zero<br /> I changed it to a priority of 100 and the behavior remains the same.</p> <p>When I use Spark to generate an invite packet of :</p> <div class="codeblock"><code>&lt;message id=&quot;byy4q-40&quot; to=&quot;room1@conference.v-doc-imchat.infoassure.local&quot;&gt;<br />&nbsp; &lt;x xmlns=&quot;http://jabber.org/protocol/muc#user&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;invite to=&quot;btroxell@v-doc-imchat.infoassure.local&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;reason&gt;Please join me in a conference.&lt;/reason&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/invite&gt;<br />&nbsp; &lt;/x&gt;<br />&lt;/message&gt;</code></div> <p>it never arrives at my client</p> <p>Still puzzled.<br /> Any suggestions would be welcomed</p> <p>Casey</p> Thu, 04 Dec 2008 14:11:31 +0000 BCaseyHanks comment 53815 at https://www.ejabberd.im resource separator is not the issue https://www.ejabberd.im/node/3248#comment-53814 <p>Thanks for the comments.</p> <p>Some of samples I posted did have the "/" the wrong way.<br /> This mistake does not occur in my code and occured only becuase I mistyped the sample during my post.</p> <p>I did not know about the affect of the priority on the delivery of messages and I will investigate that.</p> <p>Thanks for the suggestions.</p> <p>Casey</p> Thu, 04 Dec 2008 13:57:01 +0000 BCaseyHanks comment 53814 at https://www.ejabberd.im resource separator is /, not \ https://www.ejabberd.im/node/3248#comment-53812 <div class="quote-msg"> <div class="quote-author"><em>BCaseyHanks</em> wrote:</div> <p>When I send the message:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_23&quot; from=&quot;source@server\custom&quot; to=&quot;destination@server\spark&quot;&gt;&lt;x jid=&quot;room1@server&quot; xmlns=&quot;jabber:x:conference&quot; /&gt;&lt;/message&gt;</code></div> </div> <p>You already posted that topic in another post. Why did you repeat here?</p> Thu, 04 Dec 2008 12:59:00 +0000 mfoss comment 53812 at https://www.ejabberd.im Destination will receive if priority is not negative https://www.ejabberd.im/node/3248#comment-53811 <div class="quote-msg"> <div class="quote-author"><em>BCaseyHanks</em> wrote:</div> <p>But if #1 sends the following message</p> <div class="codeblock"><code>&lt;message id=&quot;JN_17&quot; to=&quot;destination@server&quot; type=&quot;chat&quot; <br />from=&quot;source@server&quot;&gt;<br />&nbsp; &lt;thread&gt;da19059b-dbdb-48bd-8b2b-8deac4ce58c0&lt;/thread&gt;<br />&nbsp; &lt;body&gt;Test Message 2&lt;/body&gt;<br />&lt;/message&gt;</code></div> <p>The message is NOT delivered to (#2) when it should be</p> <p>This leads me to believe that the issue is not that the message is only being sent to the highest priority user - because there is ONLY one recieving user logged on. </p></div> <p>I tried and the message is delivered if destination@server/custom has a positive priority (zero or higher).</p> <p>If priority of destination is negative, the message is not delivered.</p> <p>This is explained in XMPP-IM:</p> <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>However, the server MUST NOT deliver the stanza to an available resource with a negative priority; if the only available resource has a negative priority, the server SHOULD handle the message as if there were no available resources (defined below). </p></div> <p>In any case, you can try with regular desktop Jabber clients like Psi, Tkabber or Gajim.</p> Thu, 04 Dec 2008 12:53:00 +0000 mfoss comment 53811 at https://www.ejabberd.im Message to bare JID is sent to highest priority session https://www.ejabberd.im/node/3248#comment-53810 <div class="quote-msg"> <div class="quote-author"><em>BCaseyHanks</em> wrote:</div> <p>But if #1 sends the following message</p> <div class="codeblock"><code>&lt;message id=&quot;JN_17&quot; to=&quot;destination@server&quot; type=&quot;chat&quot; from=&quot;source@server&quot;&gt;<br />&nbsp; &lt;thread&gt;da19059b-dbdb-48bd-8b2b-8deac4ce58c0&lt;/thread&gt;<br />&nbsp; &lt;body&gt;Test Message 2&lt;/body&gt;<br />&lt;/message&gt;</code></div> <p>The message is delivered ONLY to the Spark client (#3) when it should be delivered to both (#2) and (#3). </p></div> <p>Where did you read that a message stanza with bare JID destination SHOULD be delivered to all sessions of destination JID? Or did you simply imagine that?</p> <p>The message is delivered to the resource with the highest priority, as explained in <noindex><a href="http://xmpp.org/rfcs/rfc3921.html#rules" rel="nofollow" >XMPP-IM: 11. Server Rules for Handling XML Stanzas</a></noindex></p> <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>11.1. Inbound Stanzas<br /> ...<br /> 4. Else if the JID is of the form &lt;user@domain&gt; and there is at least one available resource available for the user, the recipient's server MUST follow these rules:</p> <p> 1. For message stanzas, the server SHOULD deliver the stanza to the highest-priority available resource [...]. If two or more available resources have the same priority, the server MAY use some other rule [...] </p></div> Thu, 04 Dec 2008 12:35:00 +0000 mfoss comment 53810 at https://www.ejabberd.im related behavior https://www.ejabberd.im/node/3248#comment-53803 <p>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:</p> <p><noindex><a href="http://xmpp.org/extensions/xep-0249.html" title="http://xmpp.org/extensions/xep-0249.html" rel="nofollow" >http://xmpp.org/extensions/xep-0249.html</a></noindex></p> <p>When I did this I got the following unexpected result:</p> <p>Using just 2 clients<br /> 1) IM custom (logged in as source@server\custom)<br /> 2) IM Spark (logged in as destination@server\spark)</p> <p>When I send the message:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_23&quot; from=&quot;source@server\custom&quot; to=&quot;destination@server\spark&quot;&gt;&lt;x jid=&quot;room1@server&quot; xmlns=&quot;jabber:x:conference&quot; /&gt;&lt;/message&gt;</code></div> <p>The response I get is:</p> <div class="codeblock"><code>&lt;message from=&#039;destination@server\spark&#039; to=&#039;source@server/custom&#039; type=&#039;error&#039; id=&#039;JN_23&#039;&gt;&lt;x jid=&#039;room1@server&#039; xmlns=&#039;jabber:x:conference&#039;/&gt;&lt;error code=&#039;404&#039; type=&#039;cancel&#039;&gt;&lt;remote-server-not-found xmlns=&#039;urn:ietf:params:xml:ns:xmpp-stanzas&#039;/&gt;&lt;/error&gt;&lt;/message&gt;</code></div> <p>Using the same two clients when I send the message:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_23&quot; from=&quot;source@server\custom&quot; to=&quot;destination@server&quot;&gt;&lt;x jid=&quot;room1@server&quot; xmlns=&quot;jabber:x:conference&quot; /&gt;&lt;/message&gt;</code></div> <p>the message is delivered just fine</p> <p>This surprised be a little. So something is going on that is resulting in:</p> <p>1) messages are delivered to the Spark client only if the to attribute excludes the Resource<br /> 2) messages are delivered to my custom client that uses the Jabber-net libary ONLY if the to attribute includes the Resource</p> Wed, 03 Dec 2008 19:12:06 +0000 BCaseyHanks comment 53803 at https://www.ejabberd.im a test to clarrify the issue https://www.ejabberd.im/node/3248#comment-53802 <p>I thought the issue might have something to do with</p> <p><noindex><a href="http://xmpp.org/extensions/inbox/mine.html" title="http://xmpp.org/extensions/inbox/mine.html" rel="nofollow" >http://xmpp.org/extensions/inbox/mine.html</a></noindex></p> <p>so I did the following experiment:</p> <p>Using just 2 clients<br /> 1) IM custom (logged in as source@server/custom)<br /> 2) IM custom (logged in as destination@server/custom)</p> <p>if #1 sends the following message</p> <div class="codeblock"><code>&lt;message id=&quot;JN_17&quot; to=&quot;destination@server/custom&quot; type=&quot;chat&quot; <br />from=&quot;source@server/custom&quot;&gt;<br />&nbsp; &lt;thread&gt;da19059b-dbdb-48bd-8b2b-8deac4ce58c0&lt;/thread&gt;<br />&nbsp; &lt;body&gt;Test Message 1&lt;/body&gt;<br />&lt;/message&gt;</code></div> <p>The message is delivered to #2</p> <p>But if #1 sends the following message</p> <div class="codeblock"><code>&lt;message id=&quot;JN_17&quot; to=&quot;destination@server&quot; type=&quot;chat&quot; <br />from=&quot;source@server&quot;&gt;<br />&nbsp; &lt;thread&gt;da19059b-dbdb-48bd-8b2b-8deac4ce58c0&lt;/thread&gt;<br />&nbsp; &lt;body&gt;Test Message 2&lt;/body&gt;<br />&lt;/message&gt;</code></div> <p>The message is NOT delivered to (#2) when it should be</p> <p>This leads me to believe that the issue is not that the message is only being sent to the highest priority user - because there is ONLY one recieving user logged on.</p> <p>Thanks,</p> <p>Casey</p> Wed, 03 Dec 2008 16:04:02 +0000 BCaseyHanks comment 53802 at https://www.ejabberd.im clarification. https://www.ejabberd.im/node/3248#comment-53801 <p>I am using the Jabber-net library to build an IM client that connects to the eJabberd server.</p> <p>The problems that I am encountering is that <code>&lt;message&gt;</code> packers are not getting delivered to my client if they are addressed to the bare JID.</p> <p>For example if I have three clients<br /> 1) IM custom (logged in as source@server/custom)<br /> 2) IM custom (logged in as destination@server/custom)<br /> 3) IM Spark (logged in as destination@server/Spark)</p> <p>if #1 sends the following message</p> <div class="codeblock"><code>&lt;message id=&quot;JN_17&quot; to=&quot;destination@server/custom&quot; type=&quot;chat&quot; from=&quot;source@server/custom&quot;&gt;<br />&nbsp; &lt;thread&gt;da19059b-dbdb-48bd-8b2b-8deac4ce58c0&lt;/thread&gt;<br />&nbsp; &lt;body&gt;Test Message 1&lt;/body&gt;<br />&lt;/message&gt;</code></div> <p>The message is delivered to #2 only as it should be.</p> <p>But if #1 sends the following message</p> <div class="codeblock"><code>&lt;message id=&quot;JN_17&quot; to=&quot;destination@server&quot; type=&quot;chat&quot; from=&quot;source@server&quot;&gt;<br />&nbsp; &lt;thread&gt;da19059b-dbdb-48bd-8b2b-8deac4ce58c0&lt;/thread&gt;<br />&nbsp; &lt;body&gt;Test Message 2&lt;/body&gt;<br />&lt;/message&gt;</code></div> <p>The message is delivered ONLY to the Spark client (#3) when it should be delivered to both (#2) and (#3).</p> <p>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?</p> <p>One difference that I have noticed is that the Spark client is using PLAIN<br /> authentication and the Jabber-Net library is using<br /> <div class="codeblock"><code>&lt;auth mechanism=&quot;DIGEST-MD5&quot; <br />xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot; /&gt;</code></div> </p><p>A second difference that I noticed is that<br /> Spark is establishing a session using:</p> <div class="codeblock"><code>&lt;iq id=&quot;J74ma-1&quot; type=&quot;set&quot;&gt;<br />&nbsp; &lt;session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot;/&gt;<br />&lt;/iq&gt;</code></div> <p>and Jabber-Net is using:</p> <div class="codeblock"><code>&lt;iq id=&quot;JN_2&quot; type=&quot;set&quot; to=&quot;v-doc-imchat.infoassure.local&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot; /&gt;<br />&lt;/iq&gt;</code></div> <p>I don't know if including the 'to' attribute matters or not.</p> <p>Thanks,</p> <p>Casey</p> Wed, 03 Dec 2008 15:46:49 +0000 BCaseyHanks comment 53801 at https://www.ejabberd.im It should work I guess https://www.ejabberd.im/node/3248#comment-53687 <p>I tried and it works for me: ejabberd 2.0.2, using the domain "localhost", users test1 and test2:</p> <p>I send from test1@localhost/Tka:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_19&quot;<br />&nbsp;&nbsp;&nbsp; to=&quot;test2@localhost&quot;<br />&nbsp;&nbsp;&nbsp; type=&quot;chat&quot;<br />&nbsp;&nbsp;&nbsp; from=&quot;test1@localhost/Tka&quot;&gt;<br />&lt;thread&gt;bc5e9512-cfb9-40bc-a168-c34e5ca3bb7e&lt;/thread&gt;<br />&lt;body&gt;hello<br />&lt;/body&gt;<br />&lt;/message&gt;</code></div> <p>test2 receives:</p> <div class="codeblock"><code>&lt;message from=&#039;test1@localhost/Tka&#039;<br /> id=&#039;JN_19&#039;<br /> xml:lang=&#039;es&#039;<br /> type=&#039;chat&#039;<br /> to=&#039;test2@localhost&#039;&gt;<br />&nbsp; &lt;thread&gt;bc5e9512-cfb9-40bc-a168-c34e5ca3bb7e&lt;/thread&gt;<br />&nbsp; &lt;body&gt;hello<br />&lt;/body&gt;<br />&lt;/message&gt;</code></div> Mon, 27 Oct 2008 11:45:16 +0000 mfoss comment 53687 at https://www.ejabberd.im