Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get acknowledgment for send/receive message in ejabbered/XMPP?

Tags:

xmpp

ejabberd

How to know that message is deliver to other user using XMPP framework and ejabberd, we are using XEP-0184 class for Message Delivery Receipts , we send the receipts request while sending with the message but didn’t get any response.

My Query is should i need to configure anything on server (or any changes in ejabberd.cfg file) for that or any client side code we need to do.

like image 862
Purushottam Avatar asked Dec 17 '13 09:12

Purushottam


1 Answers

No, XEP-0184 is a purely client protocol, so there's nothing to set up on the server.

Among the reasons you're not receiving any acknowledges there might be:

  • Your clients just do not have XEP-0184 enabled.
  • Depending on the XMPP libraries you're using (on both clients — the sender and the receiver), the sender might decide to not even request receipts if it discovers (by querying the peer's capabilities) that it has XEP-0184 turned off.

    To be may be more clear: XEPs usually suggest the implementations to check if the feature defined by the XEP is supported, and to not attempt to use it if it isn't. Not all libraries and client do this, but some do. This means that some implementations might go like this: OK, I was requested to send delivery receipt requests, so

    1. Do service discovery on the peer I'm about to contact.
    2. Check to see if it has XEP-0184 enabled.
    3. If not, I'll just silently not attach any receipt requests.

    Whether a particular XMPP library does this by itself depends on how "smart" is was made.

If by XMPP Framework you mean this library, please try to read its source code to see if it's "smart" and asks the peer for its caps and then checks to see if XEP-0184 is enabled.

Also check to see if you can enable logging of XML streams exchanged by your client. Inspecting them is the best way to debug XMPP-related issues.

like image 171
kostix Avatar answered Sep 29 '22 10:09

kostix