[ejabberd] how to enable the jingle nodes into ejabberd

cmeng cmeng at dallab.com.sg
Fri Feb 15 10:45:32 MSK 2013


cmeng <cmeng <at> dallab.com.sg> writes:

> 
> Do Nguyen Ha <donguyenha <at> gmail.com> writes:
> 
> > 
> > Hi Cuong Thai
> > 
> > the way you me is used the exmpp component but it is still doesnt work
> > because when i do ./start there is nothing show up in jn_component.log
> > 
> > could you guide me in more details
> > 
> > Thank you
> > Ha`
> > 
> > On Mon, Nov 12, 2012 at 10:56 PM, Cuong Thai <cuong.thai <at> htklabs.com> 
> wrote:
> > > Hi Do Nguyen Ha,
> > >
> > > Just configure as they present in wiki
> > > + in ejebberd config, we declare localhost (127.0.0.1)
> > > + in jn_component.cfg, we declare public ip, public domain.
> > >
> > > I haven't used jinglenodes, but I have solution for 1-1 call and 
conference
> > > call:
> > > + 1-1 call: just peer-2-peer
> > > 
(4.bp.blogspot.com/_KyMCCsOr4Bk/SpU_GLis97I/AAAAAAAAAC8/hTZ88A1FEgs/s1600-
> h/Jingle-ICE.png)
> > > + conference call: I use SIP server (freeswitch)
> > >
> > > Regards,
> > > Cuong Thai.
> > >
> > > On Sat, Nov 10, 2012 at 7:46 AM, Do Nguyen Ha <donguyenha <at> 
gmail.com> 
> wrote:
> > >>
> > >> Hi
> > >>
> > >> i want to install the jingle node into ejabberd server and i edit the
> > >> ejabberd.cfg to add some lines
> > >>   {mod_jinglenodes, [
> > >>                      {host, "jinglenodes. at HOST@"},
> > >>                      {public_ip, "192.168.1.148"},
> > >>                      {purge_period, 5000},
> > >>                      {relay_timeout, 60000}
> > >>
> > >> but it doesnot work :(
> > >>
> > >> could someone help me to make jingle node relay to work
> > >> http://code.google.com/p/jinglenodes
> > >>
> > >>
> > >> Thank you
> > >> _______________________________________________
> > >> ejabberd mailing list
> > >> ejabberd <at> jabber.ru
> > >> http://lists.jabber.ru/mailman/listinfo/ejabberd
> > >
> > >
> > >
> > > _______________________________________________
> > > 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.
> 

=================
Need to modify two other areas to made jinglenodes response to 
jinglenode#channel request:

1. jingle_relay.erl
--------------------
%%-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)).

2. jingle_handler.erl (start line# 137)

get_candidate_elem(Host, A, B, ID) ->
	Raw_Elem = exmpp_xml:element(?NS_CHANNEL,?NAME_CHANNEL),
        Elem_A = exmpp_xml:set_attribute(Raw_Elem, <<"localport">>, A),
	Elem_B = exmpp_xml:set_attribute(Elem_A, <<"remoteport">>, B),
        Elem_C = exmpp_xml:set_attribute(Elem_B, <<"id">>, 
jn_component:prepare_id(ID)),
        exmpp_xml:set_attribute(Elem_C, <<"host">>, Host).


Temporary I also force to return "true" always for (line#44):

%% Create Channel and return details
process_iq("get", IQ, From, ?NS_CHANNEL, _, #state{xmppCom=XmppCom, 
pubIP=PubIP, channelMonitor=ChannelMonitor, whiteDomain=WhiteDomain, 
maxPerPeriod=MaxPerPeriod, periodSeconds=PeriodSeconds, 
portMonitor=PortMonitor}=State) ->
    Permitted = jn_component:is_allowed(From, WhiteDomain) andalso 
mod_monitor:accept(From, MaxPerPeriod, PeriodSeconds),	
%%	if Permitted == true ->
	if true ->
		?INFO_MSG("T: ~p~n", [PortMonitor]),
    		case allocate_relay(ChannelMonitor, From, PortMonitor) of





More information about the ejabberd mailing list