[ejabberd] howto setup jingle node service for ejabberd

cmeng cmeng at dallab.com.sg
Fri Feb 15 07:00:09 MSK 2013


Buddy Butterfly <buddy.butterfly <at> web.de> writes:

> 
> Hi,
> 
> I am focusing on the ejabberd_mod_jinglenodes at the moment.
> I have seen that there is also a udp_relay.erl module.
> For the jingle nodes mod to work, do I have to add the udp_relay module
> also to the modules in the ejabberd.cfg?
> 
> Best regards,
> Matt
> 
> Am 17.12.2012 15:43, schrieb Buddy Butterfly:
> > Hi there,
> >
> > I am having troubles setting up a Jingle Nodes and Jingle Node Relay.
> > Code used from: http://jinglenodes.googlecode.com/svn/trunk/
> >
> > Setup:
> > OS: Debian Squeeze
> > Ejabberd: 2.1.5
> > Client: Jitsi 1.0
> >
> > Compiled and installed exmpp, ejabberd_mod_jinglenodes
> >
> > I am confused what to use. jnsapi_erlang or ejabberd_mod_jinglenodes.
> > Does the module provide a full Jingle Node Service on its own?
> > Or does it have to be used together with the service described in
> > jnsapi_erlang?
> >
> > I configured the module like:
> >
> > {mod_jinglenodes,
> > 
[                                                                              
                                                                               
           
> >
> >   {host, "jinglenodes. at HOST@"},
> >   {public_ip, "pub.ip.ad.dr"},
> >   {purge_period, 5000},
> >   {relay_timeout, 60000}
> > ]}                     
> >
> > Ejabberd does not respond requests like:
> >
> > <iq
> >     id="4d0vU-18"
> >     to="jinglenodes.virthost"
> >     from="user <at> virthost/jitsi-2b2itl9"
> >     type="get">
> >     <services xmlns='http://jabber.org/protocol/jinglenodes'></services>
> > </iq>
> >
> > So my question is how to properly set this up?
> > Also, what ports do I have to open in the firewall for the Jingle Nodes
> > Relay to work?
> >
> > Best regards,
> > Matt
> >
> > _______________________________________________
> > ejabberd mailing list
> > ejabberd <at> jabber.ru
> > http://lists.jabber.ru/mailman/listinfo/ejabberd
> 
==================================
Hi,

Jinglenodes actually implements two different methods to offer Jingle Relay 
Nodes services for ejabberd.

a. as ejabberd module plugi (ejabberd_mod_jinglenodes)
b. as ejabberd service using port 8888(jnsapi_erlang)

The one described in the following site is for (b) installation.
   https://code.google.com/p/jinglenodes/wiki/Erlang_Jingle_Nodes_Service

Just follow the instruction and install. However this jinglenodes service 
uses 'lager" messaging log - A logging framework for Erlang/OTP.
   https://github.com/basho/lager
And your environment must setup to support this.

I have tried but still unable to get lager to work, so instead I modified the 
include file i.e. jn_component.hrl as below and forget about lager.

%%-define(INFO_MSG(M, P), lager:info(M, P)).
%%-define(ERROR_MSG(M, P), lager:error(M, P)). 
-define(INFO_MSG(Format, Args), io:format(Format, Args)).
-define(ERROR_MSG(Format, Args),io:format(Format, Args)).

You need to do a "make" after the changes.
Also I need to make some changes in start.sh as below:
erl -sname JingleNodes -pa deps/*/ebin -pa ebin/ -s app_jn_component -
detached -noinput -noshell -env ERL_MAX_PORTS 65000
i.e. hange -name to -sname.

you can then start the jinglenodes serve by execute ./start.sh
or alternative issue the command as below to view message log on terminal.
$ erl -sname JingleNodes -pa deps/*/ebin/ -pa ebin/ -s app_jn_component

You can use PSI+ to do a service discovery and jn.localhost should be listed 
as one of the service.

If you intend to use ejabberd module method (a) to install, then check out the 
code:

svn checkout 
http://jinglenodes.googlecode.com/svn/trunk/ejabberd_mod_jinglenodes 
ejabberd_mod_jinglenodes 

Then refer to the sub-directory file ./etc/ejabberd.cfg on how to configure 
the ejabberd ejabberd.cfg i.e.

  {mod_jinglenodes, [
		     {host, "jinglenodes. at HOST@"},
		     {public_ip, "192.168.1.148"},
		     {purge_period, 5000},
		     {relay_timeout, 60000}
		    ]},

Then restart ejabberd, similarly you can use PSI+ for service discovery to 
verify the module is working.

However what I find out for both (a) and (b) installation, the jinglenodes 
failed to response to the below <iq>: 
<channel xmlns='http://jabber.org/protocol/jinglenodes#channel' 
protocol='udp'/>

This needs jinglenodes team to help investigate.

Hopefully the above instruction help.






More information about the ejabberd mailing list