Quantcast
Viewing all 56 articles
Browse latest View live

Building a module using Java

Hi,
My team has some beginner erlang skills but for the most part we are java developers.
Since erlang supports writing nodes in Java can we just write a little erlang that invokes our java node?
Don't tell me how great erlan is I am already a believer but I need something to take to my bosses.


Dealing With Custom Messages

Hi

I have custom XMPP messages comming from the clients and I want to process them.
Adding a hook I can catch these custom messages, but now I have the following dillema:
The hook is running on the client session process, as I see each client connection have it's own process (am I right?).
Would it be conceptually right to do some computations such as calling external database and composing and sending replies from within this context? Or should I create another per client process to do my custom work?

Thanks
Eylon

Buy the Best Radio Frequency Detector for Camera from Here

New system for keeping your life safe and keep all dangerous elements out of the range you think to be protected. Detect the radio frequency effectively with this Radio Frequency Detector for Camera from www.detectorall.com , you will find the real truth about this useful high rank detector product, cheap price and fast shipping, here is your right choice.

Detailed and proper ejabberd module development tutorials or books?

Hi all,

I am totally a beginner to erlang and ejabberd... I need to implement module/s for extending ejabberd features but i couldnt find any proper tutorials for that (except the on on process-one, about http handlers)

I would like to ask if any of you know any tutorials...

thank you in advance

's War 3 Drive Swayed

Ejabberd's salt (SCRAM) breaks mod_rest

I discovered that passwords were being stored in the clear in postgres and have since moved to 2.1.11 to enable the auth_password_format scram:

{auth_method, internal}.
{auth_password_format, scram}.

this breaks the mod_rest module I'm using for administering users

I tried checking out the ejabberd-modules code from trunk to build the absolute last version of mod_rest:

git clone git://github.com/last/ejabberd-modules.git

read more

General Ejabberd Debug Shell Question

I am trying to test a function in a module ive been making, it works fine when ejabberd is running, but id like to test it directly:

-spec get_acct(#jid{}) -> string() | {error, atom()}.
get_acct(JID) ->
  #jid{luser = User, lserver = Server} = JID,
  ?INFO_MSG("trying to test: ~n user:~p~n server: ~p~n",[User, Server]),
  ok.        

Then when im in connected to 'ejabberdctl debug', in the shell, I can't seem to form the message accurately


(ejabberd@localhost)11> mod_test:get_acct({"user","localhost.com"}).

read more

How to test ejabberd modules (gen_mod + gen_server)

I implemented some ejabberd modules (using both gen_mod and gen_server behaviour).

These modules are loaded into ejabberd supervision tree and seems to work in shell but I would like to test them in a better way (e.g. eunit).

Can you tell me what is the best way to test ejabberd modules?


a few issues in mod_vcard_ldap - photos and phone numbers

mod_vcard_ldap is, somehow, giving my photo types "png" according to debug output, even though I have this code:

ldap_attribute_to_vcard(vCard, {"photo", Value}) ->
    {xmlelement,"PHOTO",[],[
       {xmlelement,"TYPE",[],[{xmlcdata,"image/jpeg"}]},
       {xmlelement,"BINVAL",[],[{xmlcdata, jlib:encode_base64(Value)}]}]};

read more

mod_log_chat

Hello prompt logs may record only specific contacts? or write to a log administrator Jabberd servera?

or may have a different module bolie flexible settings?

start module failed and report opcode failure

Dear Experts,
I have two ejabberd server and want them to be a cluster.
One server has erlang version R15B01 while another is R15B02.
I have a custom module called mod_global_roster_writefile.erl
It works fine in the server with R15B01.
When I use the erl and recompile in another server(R15B02), the error log show that:
=ERROR REPORT==== 2012-10-10 09:54:52 ===
beam/beam_load.c(1365): Error loading module mod_global_roster_writefile:
use of opcode 153; this emulator supports only up to 152

How can I fix this? Thanks.
Regards,
Cato

mod_archive doesn't get messages

pass token for user

Hi I am beginner of ejabberd,

I created a mod_offline_pushnotification module extension to call an external php for users offline. Now I need to pass to this php a token. This token should be passed client jabber to server, and save it into db user table. When user is offline and a message come for it, I will call php and pass token of user offline. What is the best approach ?
What is the best approach client to pass this token to the server, and it save into db ?

thanks

mod_rest doesn't respond

Here is my config:

 {mod_rest, [ {allowed_ips, [ {127,0,0,1} ]} ]},
  {5280, ejabberd_http, [
                         {request_handlers,
                          [
                           {["rest"], mod_rest}
...

when I post

    wget http://127.0.0.1:5280/rest/ --server-response --post-data 'World'
    --2013-02-19 08:27:25--  http://127.0.0.1:5280/rest/
    Connecting to 127.0.0.1:5280... connected.
    HTTP request sent, awaiting response... No data received.

read more

offline_message_hook: does not get called when one sends an offline message

I am developing, chat application for android using ejabberd as XMPP server. I want to send GCM push notification, when user is offline. For that I am creating new module in ejabberd, registerd offline_message_hook, but this function gets called only when somebody starts typing and finishes typing. Below are the only packets passed to this hook. Although, user receive message when he/she comes online.

Packet: {xmlelement,
      "message",
      [{"type",
       "chat"},
      {"id",
       "purple7d4d0773"},
      {"to",
       "xxx@rakshith"}],
      [{xmlelement,

read more


how can I get StateData and replace this value in mod_muc_room

hi!
I need to change StateData of the room in mod_muc_room.erl from ejabberd_c2s.erl.
I mean I have to change StateData of each room this user is connected if he changes his presence,for example.

so, in file mod_muc_room.erl I have a function, that receives all information from ejabberd_c2s.erl.

room_state() ->
receive
Msg -> (any data from ejabberd_c2s.erl about user, his presence or even PID),
room_state()
end.

so room knows that user changed his presence and it should change it's own StateData, but how can I get this value, modify and inject(replace) it to this room?

Kick/ ban module?

Does a kick/ ban module exist for ejabberd? Particularly one where the blacklist can be controlled via an XMPP IQ?

I'd like to limit the number of messages a client can send, and put them on a ban list (but not delete the account) if they misbehave. This sounds sort of like a shaper, but on a per-user basis. Any ideas?

I tried doing a search, but the forum is showing error messages :|

Thanks!

Compile gen_mod (2.1.13) gave error: gen_mod.erl:49: bad attribute

By following guide http://www.ejabberd.im/ejabberd-contrib, I checked out ejabberd modules and when tried to compile a module (any), it gave me error:

~/ejabberd-contrib/mod_admin_extra# ./build.sh
Recompile: ../ejabberd-dev/src/gen_mod
../ejabberd-dev/src/gen_mod.erl:49: bad attribute
../ejabberd-dev/src/gen_mod.erl:50: bad attribute

I don't know about Erlang, here is line 49-50 in gen_mod.erl:

-callback start(binary(), opts()) -> any().
-callback stop(binary()) -> any().

Please help, thank in adv.

Modules not working because of change in logging framework

None of the examples of custom modules like mod_logxml etc work with ejabberd 2.1.13 -- and the issue with the logger change to lager. I tried to use the logger.hrl which encapsulates both types of logging but it still defaults to p1_logger system. If I try to use lager:debug directly, it fails to compile. Is there any documentation of doing a basic module using the new logging system?

Prasanna

Module: mod_logxml not writting /log

We have successfully installed mod_logxml and it is generating an xml file, but the xml file will not rotate when set amount of packets is reached. We have tried setting the mb, but we get the same results. The module will not write the /log to end the file. We have set logxml to check rotation every packet. Rotate days has been set to no.

We are running ejaberd 2.1.8 on Windows Server 2008 R2 Standard.

Any help would be appreciated.

Thank you,

Myles Guinta

Viewing all 56 articles
Browse latest View live