jappix / jappix

:speech_balloon: Jappix, a full-featured XMPP web-client (Jappix Desktop, Jappix Mobile & Jappix Mini).
Other
433 stars 143 forks source link

Need doc for STUN/TURN #573

Open andrey-utkin opened 8 years ago

andrey-utkin commented 8 years ago

What STUN/TURN implementation do you use at jappix.com? Nothing works for me with my prosody-based jabber server. I tried various public STUN and TURN servers, have setup various self-hosted implementations, but seems jappix web stuff doesn't even touch my services - there's no packet flow. Could you please reveal some details about your server setup, especially regarding STUN/TURN? I am willing to enable audio/video calls on my setup. Thanks.

andrey-utkin commented 8 years ago

I use Jappix from git master. Got to set up my own STUN+TURN server and have it used. But still no success. https://gist.github.com/andrey-utkin/9cf91fabbe6929ce0409 caller - some ICE stuff logs https://gist.github.com/andrey-utkin/8b479522b1af78e144b5 callee - no ICE log messages, nothing related. Probably callee misses some action. Would like to compare with jappix.com, but I cannot enable developer mode for jappix.com javascript. Two accounts for tests: test123@decent.im: 123; test987@decent.im: 987 https://decent.im/jappix-test/

valeriansaliou commented 8 years ago

We're using STUNTMAN: https://github.com/jselbie/stunserver for stun.jappix.com

I'll investigate about your issue and keep you posted!

andrey-utkin commented 8 years ago

Still doesn't work on my setup with stuntman 1.2.7-1 from Ubuntu 15.10 standard repos.

valeriansaliou commented 8 years ago

No packet comes in to your STUN?

andrey-utkin commented 8 years ago

Packets come, and it replies to my host, and network analyzers show that there's bidirectional packet flow. But still no call establishment.

andrey-utkin commented 8 years ago

Could you please show how stun server is configured on jappix.com? ps ax | egrep "stun|turn"

valeriansaliou commented 8 years ago

Here you go:

[root@jappix ~]# ps -ax | egrep "stun|turn"
  628 ?        Sl     0:25 /opt/stuntman/stunserver --protocol udp --family 4
  645 ?        Sl     0:00 /opt/stuntman/stunserver --protocol udp --family 6
  656 ?        Sl     0:03 /opt/stuntman/stunserver --protocol tcp --family 4
  670 ?        Sl     0:00 /opt/stuntman/stunserver --protocol tcp --family 6
 2180 pts/0    S+     0:00 grep -E stun|turn
andrey-utkin commented 8 years ago

I wonder why there are so many. Do you have two IP addresses?

andrey-utkin commented 8 years ago

Could you please give contents of /etc/default/stuntman-server ?

valeriansaliou commented 8 years ago

None.

I compiled it from source and launch it directly from command:

        su - $NAME -c "${STUNTMAN} --protocol udp --family 4 >> /dev/null &"
    su - $NAME -c "${STUNTMAN} --protocol udp --family 6 >> /dev/null &"
    su - $NAME -c "${STUNTMAN} --protocol tcp --family 4 >> /dev/null &"
    su - $NAME -c "${STUNTMAN} --protocol tcp --family 6 >> /dev/null &"
andrey-utkin commented 8 years ago

Have tried Digitalocean-based VPS for STUN server (my original one is on Hetzner, they are behind NAT), still no luck. For now, I see that STUN server address in hosts.xml is not effective, it uses only value coded in app/javascripts/jsjac.jingle.js Still trying various things.

What is the revision of Jappix on Jappix.com at the moment? Could it be regression? Currently I am trying git master revision.

valeriansaliou commented 8 years ago

The revision on Jappix.com is latest stable release, so yeah, the GitHub version should always be more recent.

Do audio/video calls work from Jappix.com?

andrey-utkin commented 8 years ago

Yes, always and every time.

andrey-utkin commented 8 years ago

No difference also with 1.1.6 Jappix. WebRTC shows that it doesn't go beyond iceGatheringStateChange for both peers (Jappix.com dialogs go further).

Is your STUN server really restricted only to your users, or can I use it temporarily for different domain, too?

andrey-utkin commented 8 years ago

With stun.jappix.com it's the same: last event is iceGatheringStateChange ICEGatheringStateComplete on both sides.

andrey-utkin commented 8 years ago

I guess "stanza timeout" message in browser console is what matters. What does this mean specifically? I guess the only difference in our setups is server - I have Prosody 0.10 recent nightly build.

[JSJaCJingle:utils] stanza_timeout > Cheking (node: iq, type: result, id: jj_yoFuiR7zLNw0aqwF_1, status: initiating-initiating).
[JSJaCJingle:utils] stanza_timeout > Stanza timeout.
andrey-utkin commented 8 years ago

Switched from BOSH to websocket, still the same.

andrey-utkin commented 8 years ago

Seems there's receival delay on server side. It's in my prosody.log:

Dec 12 12:37:15 mod_websocket   debug   Websocket received frame: opcode=1, 270 bytes
Dec 12 12:37:15 c2s1054e80      debug   Received[c2s]: <message to='andrey.utkin@decent.im'>
Dec 12 12:37:15 decent.im:mam   debug   Not archiving stanza: <message to='andrey.utkin@decent.im' from='test123@decent.im/Jappix (1449920220088)'> (type)
Dec 12 12:37:15 decent.im:mam   debug   Not archiving stanza: <message to='andrey.utkin@decent.im' from='test123@decent.im/Jappix (1449920220088)'> (type)
Dec 12 12:37:18 mod_websocket   debug   Websocket received frame: opcode=1, 134 bytes
Dec 12 12:37:18 mod_websocket   debug   Websocket received frame: opcode=1, 153 bytes
Dec 12 12:37:18 c2s1013c90      debug   Received[c2s]: <message to='andrey.utkin@decent.im'>
Dec 12 12:37:18 decent.im:mam   debug   Not archiving stanza: <message from='andrey.utkin@decent.im/Jappix (1449920203657)'> (type)
Dec 12 12:37:18 decent.im:mam   debug   Not archiving stanza: <message from='andrey.utkin@decent.im/Jappix (1449920203657)'> (type)
Dec 12 12:37:18 c2s1013c90      debug   Received[c2s]: <message to='test123@decent.im/Jappix (1449920220088)'>
Dec 12 12:37:18 decent.im:mam   debug   Not archiving stanza: <message to='test123@decent.im/Jappix (1449920220088)' from='andrey.utkin@decent.im/Jappix (1449920203657)'> (type)
Dec 12 12:37:18 decent.im:mam   debug   Not archiving stanza: <message to='test123@decent.im/Jappix (1449920220088)' from='andrey.utkin@decent.im/Jappix (1449920203657)'> (type)

(see big difference in date, nothing happens until I press cancel for the call)

Dec 12 12:38:01 mod_websocket   debug   Websocket received frame: opcode=1, 7138 bytes
Dec 12 12:38:01 mod_websocket   debug   Websocket received frame: opcode=1, 239 bytes
Dec 12 12:38:01 c2s1054e80      debug   Received[c2s]: <iq id='jj_vSagRa8DBCF8IkVL_1' type='set' to='andrey.utkin@decent.im/Jappix (1449920203657)'>
Dec 12 12:38:01 c2s1054e80      debug   Received[c2s]: <iq id='jj_vSagRa8DBCF8IkVL_2' type='set' to='andrey.utkin@decent.im/Jappix (1449920203657)'>
Dec 12 12:38:01 mod_websocket   debug   Websocket received frame: opcode=1, 114 bytes
Dec 12 12:38:01 c2s1013c90      debug   Received[c2s]: <iq id='jj_vSagRa8DBCF8IkVL_1' type='result' to='test123@decent.im/Jappix (1449920220088)'>
Dec 12 12:38:01 mod_websocket   debug   Websocket received frame: opcode=1, 114 bytes
Dec 12 12:38:01 c2s1013c90      debug   Received[c2s]: <iq id='jj_vSagRa8DBCF8IkVL_2' type='result' to='test123@decent.im/Jappix (1449920220088)'>
andrey-utkin commented 8 years ago

Indeed, the called side processes jingle stuff of call after the caller presses Cancel. This appears in callee log:

[JSJaCJingle:single] handle
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] _handle_session_initiate
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:79723 Jingle._args session_initiate_request
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] _handle_session_initiate_request
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:79706 Jingle._args session_initiate_success
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] _handle_session_initiate_success
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] send
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:79972 Receive call form: test123@decent.im/Jappix (1449921373138)
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:64030 Received a Jingle packet: test123@decent.im/Jappix (1449921373138)
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78527 [JSJaCJingle:main] _route_iq > Routed to Jingle session (sid: 0e3bQUS1IiEwa8DR).
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] handle
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] _handle_session_terminate
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:79372 Call counter stopped
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78971 Call session successfully stopped
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:53696 Sound with name: incoming-call already stopped
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:53696 Sound with name: outgoing-call already stopped
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:56273 Read avatar from cache: test123@decent.im
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:79891 Jingle._args session_terminate_request
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] _handle_session_terminate_request
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:79822 Jingle._args > session_terminate_success Stopped current Jingle call
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:79827 Jingle._args session_terminate_success
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] _handle_session_terminate_success
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] abort
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] _peer_stop
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] send
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78531 [JSJaCJingle:single] _handle_session_terminate_request > (reason: cancel).
get.php?h=da2baaa1607f49784d282932e3684208&l=en&t=js&g=desktop.xml:78529 [JSJaCJingle:single] accept
andrey-utkin commented 8 years ago

Well, after exhaustive trial and error, still no luck. Could you please check this?

andrey-utkin commented 8 years ago

Hi Valerian, any ideas? Can it be something hardcoded assuming jappix.com in the app? Could you please unrestrict Jappix.com BOSH or Websocket server so that I could connect with my self-hosted development version to test it? And/or (better "and") enable developer mode on jappix.com, so that I get debug log in browser console and locate the difference.

andrey-utkin commented 8 years ago

Enabling pubsub prosody module doesn't help.

volga629 commented 8 years ago

Hello Everyone, Another opened issue is related to this issue.

Multiple issues with Websockets and TURN #541