FAQ Database Discussion Community


implement group chat using ejabberd

ejabberd,chatroom,groupchat
I want to implement group chat like What's App MUC(room chat) has some limitations: 1. user can not get the history of which rooms he has joined. 2. if the invited user is not online, then the user can not join the room and get the message. Multi cast XEP-0033,...

Getting SSL related error against my request to Ejabberd

android,sockets,ssl,erlang,ejabberd
Following is the code snippet where i open a socket to write APNS notifications on: get_socket()-> %%Options Options = [{certfile, ?Cert}, {keyfile, ?Key}, {mode, binary}], %%ssl connection ssl:connect(?Address, ?Port, Options, infinity) . close_socket(Socket)-> ssl:close(Socket). I am getting the following crash in my ejabberd.log file 2015-06-05 12:33:17.112 [error] <0.3134.0> gen_fsm <0.3134.0>...

Architecture for cross platform messaging app

android,google-app-engine,backend,ejabberd,google-cloud-messaging
i am looking to build a mobile messaging app firstly in android and then ios later, and am struggling with the backend architecture and need some advice on what would be best in my circumstance. Basically i am used to just developing apps through a basic web server and using...

Get packet type in module (ejabberd 15.02)

module,erlang,xmpp,ejabberd
I have this code for an ejabberd module. I am trying to filter messages in order to add meta-tags inside some of them but I am getting an error when I try to get the type of the Packet to filter only 'message' packets. This is my code so far:...

'from' attribute in delay element of MUC history message has jid of occupant instead of room

ejabberd
I am observing that from attribute of delay element in MUC history message has JID of the occupant instead of room. As per xmpp.org/extensions/xep-0045.html#enter-history: Discussion history messages MUST be stamped with Delayed Delivery (XEP-0203) [14] information qualified by the 'urn:xmpp:delay' namespace to indicate that they are sent with delayed delivery...

ejabberd behavior b/w user disconnected vs user unavailable

ejabberd,xmppframework
What is the ejabbered behavior for user who is un-expectedly disconnected from internet vs user who explicitly sent an 'unavailable' presence? Would they both be considered offline (for both single user chat or MUC)? I want a behavior where if a user is disconnected from internet, offline messages to be...

How to fetch multiple rows in mnesia

erlang,ejabberd,mnesia
{atomic,[R]}={atomic,[{ios,2,"hhh"},{ios,1,"hhh"}]} this produces an error.What am trying to do is basicaaly fetch multiple rows from mnesia table and use case statement to handle any error(if there does not exist a record for which i am searching).Whenever there is one or zero tuple corresponding to the item searched it works fine...

ejabberd mod_multicast won't allow relaying

ejabberd
I am using the latest (commit 9574e71e8db595ce7b2fa2f8fbfc38deec2ad74b) version of ejabberd and tries to make the mod_multicast module work, but I'm failing. I have this: modules: mod_multicast: host: "multicast.cego.dk" allow: all which I believe should work, however I get this response when sending a massage: <message from="multicast.cego.dk" to="[email protected]/13809541201432712492488165" type="error"> <addresses xmlns="http://jabber.org/protocol/address">...

Trying to register for XMPP

java,android,xmpp,ejabberd
I am trying to create an account and then login into my XMPP server. I have gotten this far: try { System.out.println("trying to register for XMPP"); XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder() .setServiceName("jabber.org") .setHost(AppConfig.XMPP_HOST) .setPort(Integer.parseInt(AppConfig.XMPP_PORT)) .build(); XMPPTCPConnection connection = new XMPPTCPConnection(config); connection.connect(); AccountManager accountManager = AccountManager.getInstance(connection); accountManager.createAccount(name,...

ejabberd server broadcast message

android,ios,xmpp,broadcast,ejabberd
In short, I want ejabberd server to send some messages to a group of user clients. the group of users may change. For example, the server send message to group 1, and then send different message to group 2. In other words, how to make ejabberd server send messages to...

Strophejs get roster success callback response

javascript,xmpp,ejabberd,strophe
I have these functions that allow me to get the roster on ejabberd server. function callback(){ alert('hi'); } function getInfo(){ var iq = $iq({type: 'get'}).c('query', { xmlns: Strophe.NS.ROSTER }); conn.sendIQ(iq, callback); } The request is a success since I have an alert. My question is how can I handle the...

How does ejabberd handle really high number of requests

erlang,xmpp,ejabberd
How does ejabberd handle really high number of requests. For eg. I have only 1 instance running. I am assuming: Lets take mod_offline.erl for example This module gets started by ejabberd_admin when server is started Using gen_server callbacks. -- Is there only a single instance of this module running or...

Need help in configuring the ejabberd

java,ejabberd
I am new to ejabberd server and i am using ejabberd-15.04. Now for that I downloaded the code(erlang setup was done already) and i followed all the steps to build it. 1). ./configure 2). make 3). sudo make install and now after going to "/etc/ejabberd/" i could start it or...

Rebar Jiffy dependency not available

ejabberd,rebar,jiffy
I'm trying to add davisp/jiffy as a rebar dependency in Ejabberd so I can do some JSON parsing in my modules. I found this tutorial, where they add Jiffy as a dependency for a different project, but it didn't work. I tweaked it a little to match how they import...

Extracting multiple row corresponding to a value in mnesia

erlang,ejabberd,mnesia
Situation is:- i have mnesia tuples like {"Groupid(Primary key)","groupname","grouptype","creatorid","adminid","Member_list"}. Member_list="[email protected],[email protected],[email protected]".Now i want to extract all those rows in which [email protected] exists.How to apply guard while selecting from mnesisa for this??Any pointers Now after going through the approach given by sherif following error is appearing in function checktable1:getRecords/1 (checktable1.erl, line 201)...

Ejabberd SASL external authentication for client SSL Authentication using certificates

ssl,ejabberd,sasl
So is there a module that supports SASL EXTERNAL for client SSL authentication using certificates in ejabberd. My search so far has resulted in dead links and forum discussions and also this http://xmpp.org/extensions/xep-0178.html. Wondering did someone implement this?

MongooseIM module not getting variables from Packet

php,xmpp,ejabberd,mongoose-im
I wrote the following module for MongooseIM but nothing is posted to the PHP file. start(_Host, _Opt) -> inets:start(), ejabberd_hooks:add(user_send_packet, _Host, ?MODULE, fetchPacketData, 50). stop (_Host) -> ejabberd_hooks:delete(user_send_packet, _Host, ?MODULE, fetchPacketData, 50). fetchPacketData(_From, _To, Packet) -> To = xml:get_tag_attr_s(<<"to">>, Packet), httpc:request(post, {"http://example.com/receiver.php",[], "application/x-www-form-urlencoded",...

Exception handling in Erlang to Continue execution

exception,error-handling,exception-handling,erlang,ejabberd
What I am trying to do is mochijson2:decode(Ccode) generates any exception or error, program execution should not stop and case branch {error, Reason} should get executed. But when I am trying to get it implemented, it generates error at first line while checking and code doesn't continue execution for lines...

xmpp messages are lost when client connection lost suddently

xmpp,message,ejabberd,xmppframework
I am using ejabberd server and ios xmppframework. there are two clients, A and B. When A and B are online, A can send message to B successfully. If B is offline, B can receive the message when B is online again. But when B is suddenly/unexpectedly lost connection, such...

Connection Timeout at “./rebar get-deps” / compiling EJabberd

ejabberd,rebar
I am trying to compile eJabberd on CentOS6. I am following the steps mentioned @ [https://www.process-one.net/docs/ejabberd/guide_en.html#htoc12][1] However, this aborts with connection-timeout error while executing "make". Following is the error snipet from command prompt: * [[email protected] ejabberd-15.04]# make rm -rf deps/.got rm -rf deps/.built /usr/lib64/erlang/bin/escript rebar get-deps && :> deps/.got ==>...

Formulating json array

json,post,erlang,ejabberd
I am trying to fire a httpc request. httpc:request(post, {Baseurl,[{"Authorization",ApiKey2}],<<"application/json">>,Body},[],[]). But when i pass try to formulate Body Which is given below :- Body = lists:flatten(mochijson2:encode({struct,[{"registration_ids",[{array, "APA91bE445JOlMvdShgQAJIxuDcBQos7olZi82lWQ82W9HHTR0uxOILvDYo9F5827BhU0qpBi9xpBqN1BNciWogiWxenI7_au7Z42o6eqcFSkoAs-0tVJzVG3lju54PXRyVS1tmZNhjsQDCYwnHJH6m6j6h1vSPBZl6lt3j8tu44Euq3PyISKBM"}]}, {"data",[{array,[{struct, [{"message","HGHJG"}]}]}]}...

WebSocket support for Ejabberd

websocket,xmpp,ejabberd
I am looking to implement WebSocket communication via ejabberd xmpp server... The only module that I have found so far is this repository: ejabberd-websockets This repository has not been updated for 4 year so I do not feel very comfortable using it. Any alternatives or reviews on above mentioned repository?...

How to fetch module value in ejabberd

ejabberd
How to fetch the value of module in ejabberd.I mean the current module in which my control is.Secondly will it be fetched in string or binary.Any pointers?

Jabber user going offline: Why the two different scenarios?

android,erlang,xmpp,ejabberd,user-presence
I have an Android client working in tandem with ejabberd XMPP server. Observations: Scenario 1: When I swipe-right the app (kill the app), the user goes offline on the server immediately. Its status is changed to offline at that very instant. Scenario 2: However, when I simply shut-down the Wi-fi...

Creating composite key in mnesia

erlang,ejabberd,mnesia
How to create a composite key(key with combination of two attributes) in mnesia table.As far as i know is that the first element in record which we use to create mnesia table is primary key.Please expain with simple example

Is it possible to set up an ejabberd cluster in master-slave mode where data is not being replicated?

xmpp,ejabberd,master-slave
I am trying to setup a very simple cluster of 2 ejabberd nodes. However, while trying to go through the official ejabberd documentation and using the join_cluster argument that comes along with the ejabberdctl script, I always end up with a multi-master cluster where both the mnesia databases have replicated...

Connect to an ejabberd server from another machine

installation,ejabberd
I have ejabberd installed on my windows 7 machine .I created users using the web admin and clients are connecting fine.(I am using psi). I want for the users on other machines to be able to connect and even users with android clients. I have modified the hosts file in...

Storing messages in Ejabberd

mysql,xmpp,ejabberd
I am trying to setup simple XMPP server (Ejabberd) which will save messages exchanged by users in MySql database. This really seems like a basic stuff for a chat server. Does anyone have any experience or documentation on how to setup message storing? I am using Ejabberd 15.04...

XMPP: count of unread messages

xmpp,openfire,ejabberd,mongoose-im
I'm trying to implement chat for my webapp with following features: When user logs in he should see a number of unread messages (which is both offline messages and "unseen", I will explain "unseen" in next step). When user is anywhere in the app but on chat window he should...

Ejabberd with Stream management (XEP-198) not using offline message hook

xmpp,ejabberd,xep-0198
We are developing an app with a chat feature. We have an ejabberd (15.02) configured to use mod_offline_post to use the offline message hook and forward all messages for offline clients to an url of our own which then forwards to the GCM. However as we are developing an app,...

ejabberd offline users can not receive announce message

offline,broadcast,ejabberd
I use a xmpp client to send announce message, such as Psi or Gajim. All the online users can receive the announce message, except the offline users. I do send the announce to all the users not online users. The offline user can not receive the announce message when it...

Manipulating XML element to get value from Sub-element in Erlang

xml,erlang,ejabberd
I have this in Packet: {xmlelement,"message", [{"from", "[email protected]/26526129921433241378891365"}, {"to", "[email protected]/30014432481433242528199830"}], [{xmlelement,"received", [{"xmlns", "urn:xmpp:receipts"}, {"id", "018A12FB-0718-4304-87FD-430C59EDB4F9"}], []}]} I just need to get the value of the id attribute under the received XML element....

Running PHP code from erlang [closed]

php,erlang,ejabberd
I am trying to run PHP script from erlang code.Can anybody explain with a simple example? I am basically trying put some data on google server via this php script.

Ejabberd error while xml,append_subtags

erlang,ejabberd,mongoose-im
I am new in erlang and ejabbered/mongooseIM. I am trying to write a very simple mongoose module that will add an extra child element to the packets before sending. Below is my code: -module(mod_test). -behavior(gen_mod). -export([start/2, stop/1]). -export([add_child/1]). -include("ejabberd.hrl"). start(Host, Opts) -> ejabberd_hooks:add(filter_packet, Host, ?MODULE, add_child, 0), ?DEBUG(" MOD_TEST Started",[]),...