ejabberd

mod_log_chat compilation error

Mailing list - Tue, 2015-05-12 09:30
Hello, I am trying to install mod_log_chat module on a ejabberd-15.03 installation using the command ejabberdctl command. But it fails with following error. Can someone help me on this please? root< at >04:/home# /opt/apps/jabber15.03/sbin/ejabberdctl module_install mod_log_chatsrc/mod_log_chat.erl:20: redefining macro 'LAGER'Error: {compilation_failed,"src/mod_log_chat.erl"} ThanksQube_______________________________________________ ejabberd mailing list ejabberd< at >jabber.ru http://lists.jabber.ru/mailman/listinfo/ejabberd
Categories: ejabberd

Re: Custom Erlang Authentication Module, and Client IP Address

Mailing list - Tue, 2015-05-05 12:55
Tue, 5 May 2015 10:16:17 -0400 Richard Hall <richardardrichard< at >gmail.com> wrote: No, ejabberd_auth API doesn't provide user's IP. _______________________________________________ ejabberd mailing list ejabberd< at >jabber.ru http://lists.jabber.ru/mailman/listinfo/ejabberd
Categories: ejabberd

Custom Erlang Authentication Module,and Client IP Address

Mailing list - Tue, 2015-05-05 12:16
Hello, I am currently writing an auth module (ejabberd_auth_…), and am having an issue. While running the auth module is running fine, I need to access the client’s IP address that they are connecting to the Ejabberd server with. Is there an easy way to do this from the auth module? Thanks _______________________________________________ ejabberd mailing list ejabberd< at >jabber.ru http://lists.jabber.ru/mailman/listinfo/ejabberd
Categories: ejabberd

Re: Can someone tell me what am I doing wrong?

Mailing list - Thu, 2015-04-30 12:39
Thanks Christian, that one did the trick! 2015-04-30 11:36 GMT-03:00 Christian Ulrich <christian-ml< at >rechenwerk.net>:
Categories: ejabberd

Re: Can someone tell me what am I doing wrong?

Mailing list - Thu, 2015-04-30 12:36
try replacing {<<"test">>, 1} with {<<"test">>, <<"1">>}. The attribute values must be binaries, not atoms. Christian
Categories: ejabberd

Re: Can someone tell me what am I doing wrong?

Mailing list - Thu, 2015-04-30 12:12
Hi Mathias, With the code you provided, I get: 11:08:33.826 [error] gen_server <0.467.0> terminated with reason: no function clause matching jlib:iq_to_xml({xmlel,<<"iq">>,[{<<"id">>,<<"test1">>},{<<"type">>,<<"result">>}],[{xmlel,<<"query">>,[{<<"xml...">>,...},...],...}]}) line 455 11:08:33.826 [error] CRASH REPORT Process <0.467.0> with 0 neighbours exited with reason: no function clause matching jlib:iq_to_xml({xmlel,<<"iq">>,[{<<"id">>,<<"test1">>},{<<"type">>,<<"result">>}],[{xmlel,<<"query">>,[{<<"xml...">>,...},...],...}]}) line 455 in gen_server:terminate/6 line 737 11:08:33.826 [error] Supervisor ejabberd_iq_sup had child undefined started with {gen_iq_handler,start_link,undefined} at <0.467.0> exit with reason no function clause matching jlib:iq_to_xml({xmlel,<<"iq">>,[{<<"id">>,<<"test1">>},{<<"type">>,<<"result">>}],[{xmlel,<<"query">>,[{<<"xml...">>,...},...],...}]}) line 455 in context child_terminated So I think the function has to return an IQ record, not an XML. It's very weird because I'm comparing my code with other iq handlers (*mod_last *for example) and can't figure out what am I doing wrong Thanks! 2015-04-30 11:05 GMT-03:00 Matthias Rieber <ml-erlang< at >zu-con.org>:
Categories: ejabberd

Re: Can someone tell me what am I doing wrong?

Mailing list - Thu, 2015-04-30 12:05
Hi, Am 2015-04-30 15:09, schrieb Santiago Ignacio Poli: I'm not sure, maybe you need to return an #xmlel{} try: process_local_iq(From,_ ,IQ) -> User = From#jid.luser, error_logger:error_msg("User: ~s", [User]), jlib:iq_to_xml(IQ#iq{type = result, sub_el = [#xmlel{ name = <<"query">>, attrs = [{<<"xmlns">>, ?IQ_CUSTOM}, {<<"test">>,1}], children = [] }] }). Matthias
Categories: ejabberd

Can someone tell me what am I doing wrong?

Mailing list - Thu, 2015-04-30 11:09
Recently I've been trying to implement my own IQ Handlers in ejabberd. I've been using the hook mechanism for some time now but I think IQ Handlers are more suitable for the features I need to implement. I've made a simple IQ handler to learn how to do this and encountered a problem: Every time I send my custom IQ from my client, ejabberd throws this exception (and don't return anything to the client): 09:59:28.135 [error] gen_fsm <0.574.0> in state session_established terminated with reason: bad argument in call to xml:element_to_binary({xmlel,<<"iq">>,[{<<"from">>,<<"localhost">>},{<<"to">>,<<"1< at >localhost/11909950391430398765210138">>},...],...}) in ejabberd_c2s:send_element/2 line 1908 09:59:28.136 [error] CRASH REPORT Process <0.574.0> with 0 neighbours exited with reason: bad argument in call to xml:element_to_binary({xmlel,<<"iq">>,[{<<"from">>,<<"localhost">>},{<<"to">>,<<"1< at >localhost/11909950391430398765210138">>},...],...}) in ejabberd_c2s:send_element/2 line 1908 09:59:28.136 [error] Supervisor ejabberd_c2s_sup had child undefined started with {ejabberd_c2s,start_link,undefined} at <0.574.0> exit with reason bad argument in call to xml:element_to_binary({xmlel,<<"iq">>,[{<<"from">>,<<"localhost">>},{<<"to">>,<<"1< at >localhost/11909950391430398765210138">>},...],...}) in ejabberd_c2s:send_element/2 line 1908 in context child_terminated The code inside the handler is called correctly (I echoed things to test that) but the problem is when the function tries to return the response. Here's my code: -module(mod_iq_test). -author("poli"). -behaviour(gen_mod). -export([start/2, stop/1, process_local_iq/3]). -include("jlib.hrl"). -define(IQ_CUSTOM, <<"test:iq:custom">>). start(Host, _) -> error_logger:error_msg("Started mod_block"), gen_iq_handler:add_iq_handler(ejabberd_local, Host, ?IQ_CUSTOM, ?MODULE, process_local_iq, one_queue), ok. stop(Host) -> gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?IQ_CUSTOM), ok. process_local_iq(From,_ ,IQ) -> User = From#jid.luser, error_logger:error_msg("User: ~s", [User]), IQ#iq{type = result, sub_el = [#xmlel{ name = <<"query">>, attrs = [{<<"xmlns">>, ?IQ_CUSTOM}, {<<"test">>,1}], children = [] }] }. The problem occurs when I send stanzas like this: *<iq id="test1" to="localhost" type="get"><query xmlns="test:iq:custom"/></iq>* Thanks in advance! _______________________________________________ ejabberd mailing list ejabberd< at >jabber.ru http://lists.jabber.ru/mailman/listinfo/ejabberd
Categories: ejabberd
Syndicate content