Reputation: 11
Then I have created a sample helloworld program using Erlang language in Intellij with rebar3 as a build tool. Now my main intention is to connect this project to Ejabberd. So I need to know what libraries and packages are required for connecting XMPP Ejabberd Connection in the Erlang project. How to get those packages? How to write a code that connects to the Ejabberd server?
I tried to connect my Erlang project to Ejabberd, but I am not able to get the proper output:
-module(hello).
-author("Mubin Nandavar").
-include_lib("package/exmpp/include/exmpp.hrl").
%% API
-export([ start/0]).
-import(ejabberd_client, []).
start() ->
io:fwrite("hello").
What should I add to this code in order to get connected to the Ejabberd server?
Upvotes: 0
Views: 48
Reputation: 123
It would help if you provide an example of what you are trying to achieve.
In most cases for integrating your custom business logic with Ejabberd you shouldn't look further than modules. There are a bunch of existing modules in Ejabberd which may help to solve your problem, for example mod_offline_post allows you to send messages to an external HTTP endpoint etc.
Also, you can write your own module: https://docs.ejabberd.im/developer/extending-ejabberd/modules/
You can also try working with Ejabberd database directly. By default the DB is Mnesia but most people change it to MySQL or Postgres.
Upvotes: 0