I used Filtering (mod_filterlatlong) and Broadcasting(mod_broadcastlatlong) modules for handling real-time location data of the transportation units in one of my projects.
-
mod_filterlatlong filters messages by their message body. It checks if the body of the message starts with the predefined string. If it is positive, then it extracts latitude, longitude and id number values. Finally, the module updates corresponding rows in MySQL table using these obtained values.
-
mod_broadcastlatlong again filters messages by their message body. If the body starts with the predefined string, it fetches data from MySQL database and broadcasts in the chat every 20 seconds.
eJabberd Server Version: 16.02 Linux
For detailed eJabberd module information, please visit: https://docs.ejabberd.im/developer/extending-ejabberd/modules/
For summary:
For mod_filterlatlong:
Move the custom module folder to the path:
$HOME/.ejabberd-modules/sources/mod_filterlatlong
Then install the module:
$ ejabberdctl module_install mod_filterlatlong
Check your new module is installed:
$ ejabberdctl modules_installed
The response should contain:
mod_filterlatlong
You can remove the module by using:
ejabberdctl module_uninstall mod_filterlatlong
After installation, you’ll need to restart ejabberd or manually start the module.