elfatah / jinglenodes

Automatically exported from code.google.com/p/jinglenodes
0 stars 0 forks source link

jnsapi_erlang (trunk) with with erlang 14.a and ejabberd 2.1.5 #18

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. set up a ejabberd 2.1.5 (debian stable) server and enter a component 
configuration with port (5571 here) and a secret
2. checkout exmpp from git & compile
3. checkout jnsapi_erlang from trunk & compile
4. adapt jn_component.cfg and try to start.sh (optional: without -detach)

Result:
XXXXX:~/customSoftware/jinglenodes/jinglenodes-read-only/trunk/jnsapi_erlang# 
erl -name JingleNodes -pa deps/*/ebin -pa ebin/ -s app_jn_component -noinput 
-noshell -env ERL_MAX_PORTS 65000

=INFO REPORT==== 25-Aug-2012::13:46:11 ===
    application: app_jn_component
    exited: {shutdown,{app_jn_component,start,[normal,[]]}}
    type: temporary

Also, in the ejabberd logfiles no connection attempt from the component is 
logged. As far as i know, i've tried to follow the guide as best as i could. 
How exactly is this meant to be used? Any hints would be greatly appreciated :P.

Best Regards
- Dario Ernst

Original issue reported on code.google.com by nebukadn...@gmail.com on 25 Aug 2012 at 12:34

GoogleCodeExporter commented 9 years ago
i has the same issue

Original comment by donguye...@gmail.com on 17 Oct 2012 at 1:27

GoogleCodeExporter commented 9 years ago
Jinglenodes service uses 'lager" message loggomg - A logging framework for 
Erlang/OTP.
   https://github.com/basho/lager
And your environment must be 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)).

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

Although jinglenodes(ejabberd?) responses to "discovery service", it fails to 
response to the below <iq> using jitsi: 
<channel xmlns='http://jabber.org/protocol/jinglenodes#channel' protocol='udp'/>

Trace and find out that jn_component always returns false:
is_allowed(Domain, WhiteDomain) -> 
    lists:any(fun(S) -> S == Domain end, WhiteDomain).

Original comment by en...@singnet.com.sg on 15 Feb 2013 at 3:16

GoogleCodeExporter commented 9 years ago
Need also to modify source jingle_relay.erl as follow to bypass lager call:

%%-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)).

Original comment by en...@singnet.com.sg on 15 Feb 2013 at 4:51

GoogleCodeExporter commented 9 years ago
Need to modify two other areas to made jinglenodes response to 
jinglenode#channel request:
1. 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).

2. jingle_handler.erl (start line# 44)
------------------------------------
Temporary I also force to return "true" always for:

%% 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

The above changes allow jinglenodes reply properly to:
<channel xmlns='http://jabber.org/protocol/jinglenodes#channel' protocol='udp'/>

using jitsi clinet.

Original comment by en...@singnet.com.sg on 15 Feb 2013 at 6:50

GoogleCodeExporter commented 9 years ago
Attached are all the modified files - tested working on ejabberd 2.1.11, exmpp 
(trunk version) and ubuntu 12.10.

%% Note: NO space between domains in whitelist in jn_component.cfg 

Original comment by en...@singnet.com.sg on 18 Feb 2013 at 2:11

Attachments:

GoogleCodeExporter commented 9 years ago
fixed jinglenodes#channel reply missing parameter i.e. "protocol" and "expire" 
parameters.

Hopefully should be working fully now.

Original comment by en...@singnet.com.sg on 18 Feb 2013 at 6:35

Attachments:

GoogleCodeExporter commented 9 years ago
And how to make it reply service list event? (following XEP-278)
<iq type="get" to="jn.myhost.com" id="ab71a">
<services xmlns='http://jabber.org/protocol/jinglenodes'/>
</iq>

It replies nothing.

Here is a piece of jmsapi log:
Preparing: {xmlel,'jabber:component:accept',[],iq,
                  [{xmlattr,undefined,<<"from">>,
                            <<"testuser@myhost.com/Psi+">>},
                   {xmlattr,undefined,<<"to">>,<<"jn.myhost.com">>},
                   {xmlattr,'http://www.w3.org/XML/1998/namespace',<<"lang">>,
                            <<"ru">>},
                   {xmlattr,undefined,<<"type">>,<<"get">>},
                   {xmlattr,undefined,<<"id">>,<<"ab71a">>}],
                  [{xmlcdata,<<"\n">>},
                   {xmlel,"http://jabber.org/protocol/jinglenodes",
                          [{"http://jabber.org/protocol/jinglenodes",none}],
                          services,[],[]},
                   {xmlcdata,<<"\n">>}]}
 On State:{state,<0.100.0>,"jn.myhost.com","somepass","localhost",8888,
                 "10.10.10.1",<0.98.0>,
                 [<<"localhost">>],
                 10,6,<0.99.0>,jingle_handler}
NS:'http://jabber.org/protocol/jinglenodes'

=ERROR REPORT==== 23-Mar-2013::18:30:58 ===
Error in process <0.136.0> on node 'JingleNodes@myhost' with exit value: 
{function_clause,[{exmpp_xml,attribute,[policy,"public"]},{jingle_handler,proces
s_iq,6}]}

Original comment by raider...@gmail.com on 23 Mar 2013 at 2:35

GoogleCodeExporter commented 9 years ago
I was installed mod_jinglenodes.erl plugin method in ejabberd.it shown in psi+ 
service discovery option jinglenodes.192.168.1.35 ,but didnot get any correct 
response for iq 

a) send iq:  <iq type="get" to="kumar@192.168.1.35" 
id="ab71a"><servicesxmlns='http://jabber.org/protocol/jinglenodes'/></iq>

receive it: 
<iq from="kumar@192.168.1.35" type="error" xml:lang="en" 
to="babu@192.168.1.35/Psi+" id="ab71a">
<services xmlns="http://jabber.org/protocol/jinglenodes"/>
<error type="cancel" code="503">
<service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>

b)<channel xmlns='http://jabber.org/protocol/jinglenodes#channel'  
protocol='udp'/>

didnot get any result. 

please help me. and how to send voip call IQ example ?

Original comment by itkumar...@gmail.com on 3 Sep 2013 at 3:13