redsolution / xabber-web

Open source XMPP client for Web
GNU Affero General Public License v3.0
132 stars 52 forks source link

How to make voice call or video call? #39

Open swbus opened 4 years ago

swbus commented 4 years ago

I have 3 machines, one installed openfire-4.5.1, and created several accounts, and also compiled xabber-websocket on it, after that modified the file "_rel/xabber_ws/lib/xabber_ws-0.3.1/priv/client/index.html", change CONNECTION_URL: to (location.protocol == 'https:'? 'wss: 192.168.18.7:7443/ws': 'ws:192.168.18.7:7070/ws'), then execute : _rel/xabber_ws/bin/xabber_ws start, it's very good. then open the chrome browser on both other pc, enter http://192.168.18.7:8080/client, log in with different xmpp accounts, send some Text messages to each other, can also transfer files, it's great, but voice calls or video calls do not work, and there is no response at the other end.

what should I do?

oxoWrk commented 4 years ago

How exactly do calls not work? What are you doing? What happens after that? Did you watch the console log?

swbus commented 4 years ago

ubuntu@ip-172-31-36-234:~/xmpp/xws$ bin/xabber_ws foreground Exec: /home/ubuntu/xmpp/xws/erts-9.2/bin/erlexec -noshell -noinput +Bd -boot /home/ubuntu/xmpp/xws/releases/0.3.1/start -mode embedded -config /home/ubuntu/xmpp/xws/releases/0.3.1/sys.config -boot_var ERTS_LIB_DIR /home/ubuntu/xmpp/xws/erts-9.2/../lib -args_file /home/ubuntu/xmpp/xws/releases/0.3.1/vm.args -- foreground Root: /home/ubuntu/xmpp/xws 08:42:29.056 [info] Application lager started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.056 [info] Application crypto started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.056 [info] Application p1_utils started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.057 [info] Application fast_xml started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.057 [info] Application asn1 started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.057 [info] Application public_key started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.058 [info] Application ssl started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.058 [info] Application ranch started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.058 [info] Application cowlib started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.058 [info] Application cowboy started on node 'xabber_ws@ip-172-31-36-234' 08:42:29.059 [info] Application xabber_ws started on node 'xabber_ws@ip-172-31-36-234'

swbus commented 4 years ago

no other

swbus commented 4 years ago

test:

http://www.xfinfo.com.cn:8080/client/

accounts: leo@xfinfo.com.cn, jerry@xfinfo.com.cn, passwd:111111

you can see what happen?

oxoWrk commented 4 years ago

Browsers block access to media devices If the current document isn't loaded securely. U have to use https or for testing try https://support.google.com/chrome/thread/8602710?hl=en

swbus commented 4 years ago

no, no, no use chrome browser, It's make video conference using "openfire-pade-plugin", it's ok.

oxoWrk commented 4 years ago

I don’t know anything about "openfire-pade-plugin" and how it works. Calls in the Xabber for Web do not work for the reason that I described above. If you open the browser console you will see error that media devices is undefined

swbus commented 4 years ago

thanks for reply. browser console show errors:

image

swbus commented 4 years ago

xabber.min.js?v2.0.2:32 Uncaught TypeError: Cannot read property 'getUserMedia' of undefined at n.createAudioStream (xabber.min.js?v2.0.2:32) at n.startCall (xabber.min.js?v2.0.2:32) at n.initJingleMessage (xabber.min.js?v2.0.2:32) at n.initCall (xabber.min.js?v2.0.2:32) at n.voiceCall (xabber.min.js?v2.0.2:32) at HTMLDivElement.dispatch (xabber.min.js?v2.0.2:13) at HTMLDivElement.d.handle (xabber.min.js?v2.0.2:13)

swbus commented 4 years ago

It's means must use https but https://www.xfinfo.com.cn:8443/client/ not work, show me"ERR_CONNECTION_REFUSED"

my xabber_ws.config: {ssl_cacertfile, "/home/ubuntu/xmpp/xws/fullchain.pem"}, {ssl_certfile, "/home/ubuntu/xmpp/xws/cert.pem"}, {ssl_keyfile, "/home/ubuntu/xmpp/xws/privkey.pem"},

it's right?

oxoWrk commented 4 years ago

ssl_cacertfile is the certificate of CA that issued your certificate and set {ssl, true}

swbus commented 4 years ago

thanks alot. I using "Let's Encrypt", and got the 4 files: cert.pem chain.pem fullchain.pem privkey.pem which is the certificate of CA? not fullchain.pem?

thanks again

swbus commented 4 years ago

help me please! I have no idea

my xabber_ws.config: [ {xabber_ws, [ {ws_path, "/websocket"}, {client_path, "/client"}, {port, 8080}, {ws_timeout, 300000}, {dns_timeout, 3000}, {dns_retries, 3}, {ssl, true}, {ssl_port, 8443}, {ssl_cacertfile, "/home/ubuntu/xmpp/certs/fullchain.pem"}, {ssl_certfile, "/home/ubuntu/xmpp/certs/cert.pem"}, {ssl_keyfile, "/home/ubuntu/xmpp/certs/privkey.pem"}, {allow_all, true} ] }, {lager, [ {handlers, [ {lager_console_backend, [{level, info}]} ]} ]} ].

ubuntu@ip-172-31-36-234:~/xmpp/xws$ sudo bin/xabber_ws foreground Exec: /home/ubuntu/xmpp/xws/erts-9.2/bin/erlexec -noshell -noinput +Bd -boot /home/ubuntu/xmpp/xws/releases/0.3.1/start -mode embedded -config /home/ubuntu/xmpp/xws/releases/0.3.1/sys.config -boot_var ERTS_LIB_DIR /home/ubuntu/xmpp/xws/erts-9.2/../lib -args_file /home/ubuntu/xmpp/xws/releases/0.3.1/vm.args -- foreground Root: /home/ubuntu/xmpp/xws 13:09:37.519 [info] Application lager started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.519 [info] Application crypto started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.519 [info] Application p1_utils started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.520 [info] Application fast_xml started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.520 [info] Application asn1 started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.520 [info] Application public_key started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.521 [info] Application ssl started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.521 [info] Application ranch started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.521 [info] Application cowlib started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.521 [info] Application cowboy started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.523 [info] Application xabber_ws started on node 'xabber_ws@ip-172-31-36-234'

swbus commented 4 years ago

[ {xabber_ws, [ {ws_path, "/websocket"}, {client_path, "/client"}, {port, 8080}, {ws_timeout, 300000}, {dns_timeout, 3000}, {dns_retries, 3}, {ssl, true}, {ssl_port, 8443}, {ssl_cacertfile, "/home/ubuntu/xmpp/certs/fullchain.pem"}, {ssl_certfile, "/home/ubuntu/xmpp/certs/cert.pem"}, {ssl_keyfile, "/home/ubuntu/xmpp/certs/privkey.pem"}, {allow_all, true} ] }, {lager, [ {handlers, [ {lager_console_backend, [{level, info}]} ]} ]} ].

ubuntu@ip-172-31-36-234:~/xmpp/xws$ sudo bin/xabber_ws foreground Exec: /home/ubuntu/xmpp/xws/erts-9.2/bin/erlexec -noshell -noinput +Bd -boot /home/ubuntu/xmpp/xws/releases/0.3.1/start -mode embedded -config /home/ubuntu/xmpp/xws/releases/0.3.1/sys.config -boot_var ERTS_LIB_DIR /home/ubuntu/xmpp/xws/erts-9.2/../lib -args_file /home/ubuntu/xmpp/xws/releases/0.3.1/vm.args -- foreground Root: /home/ubuntu/xmpp/xws 13:09:37.519 [info] Application lager started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.519 [info] Application crypto started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.519 [info] Application p1_utils started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.520 [info] Application fast_xml started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.520 [info] Application asn1 started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.520 [info] Application public_key started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.521 [info] Application ssl started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.521 [info] Application ranch started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.521 [info] Application cowlib started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.521 [info] Application cowboy started on node 'xabber_ws@ip-172-31-36-234' 13:09:37.523 [info] Application xabber_ws started on node 'xabber_ws@ip-172-31-36-234'

andrewnenakhov commented 4 years ago

@swbus btw, did you try connecting to your server and making calls using client deployed by us? Try https://web.xabber.com/develop/ for best results

oxoWrk commented 4 years ago

{ssl_cacertfile, "/etc/ssl/certs/ca-certificates.crt"},

swbus commented 4 years ago

@oxoWrk Thanks for reply. I think i set right ca files.

now question is, https://ip:8443/client, it not work. but i using nginx reflact, point nginx ssl link to https://ip:8443/client, then https://ip, it's ok, browser show me login page.

another question come from openfire, that is xabber connect to wss://ip:7443/ws failed, maybe openfire wss service was wrong.