GithubHelp home page GithubHelp logo

ejabberd_mod_confirm_delivery's Introduction

ejabberd_confirm_delivery

Module to sets a message offline if receiver does not respond in 10 seconds

Assuming xep-0184 has been setup client side, this module will wait for a responce from the client. If no responce is received in 10 seconds, the module will resend the message (this might be overkill) and save the message offline.

As long as the client can handle duplicae messages this technique seems to work fine.

This came from a question I posted on stackoverflow: http://stackoverflow.com/questions/17424254/ejabberd-online-status-when-user-loses-connection/22606829#22606829


I have ejabberd setup to be the xmpp server between mobile apps, ie. custom iPhone and Android app.

But I've seemingly run into a limitation of the way ejabberd handles online status's.

Scenario:

User A is messaging User B via their mobiles. User B loses all connectivity, so client can't disconnect from server. ejabberd still lists User B as online. Since ejabberd assumes User B is still online, any message from User A gets passed on to the dead connection. So user B won't get the message, nor does it get saved as an offline message, as ejabberd assumes the user is online. Message lost. Until ejabberd realises that the connection is stale, it treats it as an online user. And throw in data connection changes (wifi to 3G to 4G to...) and you'll find this happening quite a lot.

mod_ping:

I tried to implement mod_ping on a 10 second interval. http://www.process-one.net/docs/ejabberd/guide_en.html#htoc51 But as the documentation states, the ping will wait 32 seconds for a response before disconnecting the user. This means there will be a 42 second window where the user can lose their messages.

Ideal Solution:

Even if the ping wait time could be reduce, it's still not a perfect solution. Is there a way that ejabberd can wait for a 200 response from the client before discarding the message? If no response then save it offline. Is it possible to write a hook to solve this problem? Or is there a simple setting I've missed somewhere?

FYI: I am not using BOSH.

ejabberd_mod_confirm_delivery's People

Contributors

johanvorster avatar

Watchers

James Cloos avatar michael avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.