erlang - ejabberd: get users (version & os) when connect to the server -
i'm trying read users os "windows xp, windows 7, linux .... etc"
when connected i'm working on ejabberd 2.1.x nothing shown me.
what i'm doing :
-module(mod_test). -behaviour(gen_mod). %% gen_mod callbacks -export([start/2, stop/1]). %% hook handlers -export([user_send_packet/3, filter_packet/1]). -include("ejabberd.hrl"). -include("jlib.hrl"). -define(procname, ejabberd_mod_filter). start(host, _opts) -> ejabberd_hooks:add(user_send_packet, host, ?module, user_send_packet, 75), ejabberd_hooks:add(filter_packet, global, ?module, filter_packet, 75), ok. stop(host) -> ejabberd_hooks:delete(filter_packet, global, ?module, filter_packet, 75), ejabberd_hooks:delete(user_send_packet, host, ?module, user_send_packet, 75), ok. user_send_packet(_from, _to, _packet) -> ok. filter_packet({from, to, packet}) -> io:format("~p", [packet]), filter_packet(arg) -> arg.
it's return users data (status, resource, caps ... etc) else (version, os, client name) there way ?
i belive there away cuz in (muc chat) there many bot if type :
version some_user
return me msg :
name : psi+ version : 1.1 os : windows xp
but don't know how this.
you can information sending "software version" request client described in xep-0092. ejabberd doesn't do, may have write code tracking responses yourself. (the basic idea server sends request id, , needs check responses same id, taking timeouts , errors account.)
Comments
Post a Comment