0
votes

I'm trying to implement mod_http_offline from here to send POST request when destination client is offline, but always get the following error message :

2018-06-25 11:16:19.202 [error] <0.542.0>@ejabberd_hooks:safe_apply:383 Hook offline_message_hook crashed when running mod_http_offline_post:create_message/1: ** Reason = {error,undef,[{mod_http_offline_post,create_message,[],[{bounce,{message,<<"1529900178124">>,chat,<<"en">>,{jid,<<"10000537_agent">>,<<"metachat.release">>,<<"862193039807052">>,<<"10000537_agent">>,<<"metachat.release">>,<<"862193039807052">>},{jid,<<"10000091_agent">>,<<"metachat.release">>,<<>>,<<"10000091_agent">>,<<"metachat.release">>,<<>>},[],[{text,<<>>,<<"{\"data\":{\"contactData\":[],\"content\":\"Asdfg\"},\"type\":\"chat\"}">>}],undefined,[{xmlel,<<"request">>,[{<<"xmlns">>,<<"urn:xmpp:receipts">>}],[]}],#{ip => {192,168,100,222}}}}]},{ejabberd_hooks,safe_apply,[{file,"src/ejabberd_hooks.erl"},{line,380}],4},{ejabberd_hooks,run_fold1,[{file,"src/ejabberd_hooks.erl"},{line,364}],4},{ejabberd_sm,route,[{file,"src/ejabberd_sm.erl"},{line,146}],1},{ejabberd_local,route,[{file,"src/ejabberd_local.erl"},{line,101}],1},{ejabberd_router,do_route,[{file,"src/ejabberd_router.erl"},{line,372}],1},{ejabberd_router,route,[{file,"src/ejabberd_router.erl"},{line,93}],1},{ejabberd_c2s,check_privacy_then_route,[{file,"src/ejabberd_c2s.erl"},{line,823}],2}]}

I'm using 18.04, so maybe some of the syntax were outdated, but as I'm new to ejabberd and Erlang in common, I'm unable to find the root of problems. Please help, any answer will be really appreciated.

1

1 Answers

1
votes

mod_http_offline.erl was last modified four years ago. You installed that module in a recent ejabberd. The calls that ejabberd makes to the hooks have changed a lot since then, and that module is not compatible as it is.