STUN server configuration

Hi

I have an ejabberd server up and running, serving the domain kim.boldlygoingnowhere.org with Apache

I can use a chat client to connect and chat alright. The problem is I am also trying to get the STUN component working so I can do file/data transfers using the libjingle example code I have here.

I added this to my ejabberd config:

{{3478, udp}, ejabberd_stun, []},

And I forwarded port 3478 on my router. I'm not sure what else I need to do to get it working. Currently I get this error:

Logged in as kim@kim.boldlygoingnowhere.org/pcp
=== DNS RESOLUTION (kim.boldlygoingnowhere.org) ===
kim.boldlygoingnowhere.org resolved to 203.206.51.96
SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Fri Apr 02 13:33:01 2010
   <presence>
     <status/>
     <priority>
       0
     </priority>
     <c xmlns="http://jabber.org/protocol/caps" node="http://www.google.com/xmpp/client/caps" ver="1.0.0.66" e
xt="share-v1"/>
     <x xmlns="jabber:x:delay" stamp="20100402T05:33:01"/>
   </presence>
SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Fri Apr 02 13:33:01 2010
   <iq type="get" id="6">
     <query xmlns="google:jingleinfo"/>
   </iq>
RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Fri Apr 02 13:33:01 2010
   <presence from='kim@kim.boldlygoingnowhere.org/pcp' to='kim@kim.boldlygoingnowhere.org/pcp' xml:lang='*'>
     <status/>
     <priority>
       0
     </priority>
     <c xmlns='http://jabber.org/protocol/caps' node='http://www.google.com/xmpp/client/caps' ver='1.0.0.66' e
xt='share-v1'/>
     <x xmlns='jabber:x:delay' stamp='20100402T05:33:01'/>
   </presence>
RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Fri Apr 02 13:33:01 2010
   <presence from='kim@kim.boldlygoingnowhere.org/Kim-PC' to='kim@kim.boldlygoingnowhere.org/pcp' xml:l
ang='en'>

     <priority>
       5
     </priority>

     <c xmlns='http://jabber.org/protocol/caps' node='http://psi-im.org/caps' ver='caps-b75d8d2b25' ext='ca cs
ep-notify html'/>

     <delay xmlns='urn:xmpp:delay' from='kim@kim.boldlygoingnowhere.org/KimGadecki-PC' stamp='2010-04-02T04:57
:03Z'>
     </delay>
     <x xmlns='jabber:x:delay' stamp='20100402T04:57:03'/>
   </presence>
RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Fri Apr 02 13:33:01 2010
   <iq from='kim@kim.boldlygoingnowhere.org' to='kim@kim.boldlygoingnowhere.org/pcp' type='error' xml:lang='*'
id='6'>
     <query xmlns='google:jingleinfo'/>
     <error code='503' type='cancel'>
       <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
     </error>
   </iq>

Is the stun server meant to be at stun.kim.boldlygoingnowhere.org?

The source code also refers to a relay but I don't know what this component is or what to put in. "relay.l.google.com" is there from when the example program was used to connect to the talk.google server.

  relay_hosts_.push_back("relay.l.google.com");
  stun_hosts_.push_back(talk_base::SocketAddress("kim.boldlygoingnowhere.org",3478));

I would really appreciate some tips about getting this set up, please. I am very new to all of this.

Thank you very much for your time

I don't know how

I don't know how google:jingleinfo works (because this is actually not jingle at all) and I'm not sure if it uses stun or not.
By the way, STUN is not designed to work behind a NAT.

Zinid, the code I am trying

Zinid, the code I am trying to get working with my own server came from http://code.google.com/apis/talk/libjingle/index.html

Quote:

libjingle is a collection of open-source C++ code and sample applications that enables you to build a peer-to-peer application. The code handles creating a network connection (through NAT and firewall devices, relay servers, and proxies), negotiating session details (codecs, formats, etc.), and exchanging data. It also provides helper tasks such as parsing XML, and handling network proxies. You could build the following programs with libjingle:

* A multi-user voice chat application
* A multi-user video conferencing application
* A multi-user live music streaming application
* A peer-to-peer file sharing application

So I guess it will work from behind a NAT?

When you say "this isn't jingle" are you trying to say that this forum/project has no affiliation with jingle so I won't receive any help here?

I would still appreciate knowing how to set up a STUN server if anyone knows how, if this jingle app needs a STUN server then it should still be a step in the right direction.

Thanks

google:jingleinfo seems to be

google:jingleinfo seems to be used to retrieve a list of stun servers so I should be able to bypass that part and manually specify my own server. Is STUN a component of ejabberd or an external server you need to run and then direct ejabberd to?

If the server supports the Jingle information extension, the reply will include the 'google:jingleinfo' feature, as shown here:
Example 2. Client service discovery response

<iq type='result' to='romeo@gmail.com' from='gmail.com'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    ...
    <feature var='google:jingleinfo'/>
    ...
  </query>
</iq>

Requesting Jingle Info Server Addresses

To request the addresses of servers, a client sends an IQ get containing a <query/> element qualified by the 'google:jingleinfo' namespace, as shown here:
Example 3. Client requests list of servers

<iq type='get'
    from='romeo@gmail.com/orchard'
    to='romeo@gmail.com'
    id='ji-request-1'>
  <query xmlns='google:jingleinfo'/>
</iq>

The first time this request is sent, in addition to returning the server addresses, the service will also subscribe the client to receive updates when the servers change as described below.

The server will respond to the request with a <query/> element qualified by the 'google:jingleinfo' namespace. Among other information, this element contains one <stun/> element that contains a list of <server/> elements, each of which describes one STUN server. Each <server/> element has the following two attributes:

    * host  Gives the DNS name or IP address of the STUN server
    * udp   Gives the port on the STUN server

Example 4. Client receives list of STUN servers

<iq type='result'
    from='romeo@gmail.com'
    to='romeo@gmail.com/orchard'
    id='ji-request-1'>
  <query xmlns='google:jingleinfo'>
    <stun>
      <server host='host1' udp='12345'/>  
      <server host='host2' udp='12345'/>  
    </stun>
  </query>
<iq>

Re: STUN server configuration

itekimasu wrote:

Zinid, the code I am trying to get working with my own server came from http://code.google.com/apis/talk/libjingle/index.html

Quote:

libjingle is a collection of open-source C++ code and sample applications that enables you to build a peer-to-peer application. The code handles creating a network connection (through NAT and firewall devices, relay servers, and proxies), negotiating session details (codecs, formats, etc.), and exchanging data. It also provides helper tasks such as parsing XML, and handling network proxies. You could build the following programs with libjingle:

* A multi-user voice chat application
* A multi-user video conferencing application
* A multi-user live music streaming application
* A peer-to-peer file sharing application

libjingle is a neglected library written ages ago by Google, and it doesn't implement current version of jingle as described in XEP-0166

Quote:

So I guess it will work from behind a NAT?

STUN server should reside on public Internet as required by RFC5389.

Quote:

When you say "this isn't jingle" are you trying to say that this forum/project has no affiliation with jingle so I won't receive any help here?

Yes

Quote:

I would still appreciate knowing how to set up a STUN server if anyone knows how, if this jingle app needs a STUN server then it should still be a step in the right direction.

STUN is implemented in ejabberd as described in RFC5389. Currently, there is no way to discover STUN server through XMPP stream, because the corresponding XEP-0215 is not supported by ejabberd since it is still in experimental state.

Syndicate content