I am trying to write a couple of modules / filter for ejabberd. After successfully implemented external auth in php I was having high hopes, that I will be able to do everything in PHP.
What I am trying to accomplish is the following:
Ejabberd hooks -> Send data to PHP
PHP accessing Ejabberd via shell_exec() / exec() using ejabberdctl
PHP responding to "Hooks".
I found this SO question (How to filter messages in Ejabberd) which almost answered my question, but it misses the part where the data gets passed to PHP.
So my question are:
How I can send the data to php from erlang (ie. the " %% should return modified Packet or atom
drop
to drop the packet" part from the linked question)Where I can find some specification / documentation about ejabberd binary protocol?