InnovateAsterisk / Browser-Phone

A fully featured browser based WebRTC SIP phone for Asterisk
https://www.innovateasterisk.com
GNU Affero General Public License v3.0
472 stars 240 forks source link

register ok, call accepted ok but no sound #148

Open vaheed opened 3 years ago

vaheed commented 3 years ago

hey dear and thanks for a great job :)

I try test WebPhone on issabel behind the whitelist firewall and nat and no sound on both side

I try to accept 8089 and 443 TCP and 10000-20000 UDP and forward this port to my issablePBX, can you tell me what exactly needs to forward and accept behind the firewall or any guide for my problem :)

InnovateAsterisk commented 3 years ago

If ports are open and working then ICE probably failed. Is ICE configured on Asterisk? Is NAT correctly set on Asterisk? are regular IP/mobile phones able to work? In your INVITE, does the SIP message advertise the correct IP for audio, on the client and for the corresponding server?

vaheed commented 3 years ago

I try to test in the local network and everything works fine, but when I use behind the nat no sound I try to DMZ(all public ports nat to local PBX) for the test but no sound again

InnovateAsterisk commented 3 years ago

It's not necessary to put your server in the DNZ, and actually i'm not sure it will help in any case.

Make sure your websocket transport is well defined.

[wss_transport]
type=transport
protocol=wss
bind=0.0.0.0
external_media_address = YOUR.LIVE.IP.ADDRESS
external_signaling_address = YOUR.LIVE.IP.ADDRESS
tos = cs3
cos = 3
local_net = YOUR.LOCAL.LAN.NETWORK/24

Then make sure you use the wss_transport in your endpoint.

...
transport = wss_transport
...
vaheed commented 3 years ago

I know this is not necessary, but when working in my local nat and not work when behind nat, I try to test, and yes will NOT help :(

as I know this configuration using PjSIP, but in my project, I try to lunch WebRTC for my SIP clients, not PjSIP clients

InnovateAsterisk commented 3 years ago

Well, you could rule out RTP as the issue if you enable RTP debug... then you could see packets being sent/received etc.

If you are getting packets, and it's not a NAT issue, then it could be something like the microphone or speakers... and lastly, it could be the opus codec. In same cases opus gets corrupted in Asterisk, and appears to be working but is just transmitting silence.

InnovateAsterisk commented 3 years ago

chan_sip also has nat configuration https://github.com/asterisk/asterisk/blob/master/configs/samples/sip.conf.sample

vaheed commented 3 years ago

thanks, dear, my problem is now solved.

for your time to help me, I share the steps to run your WebRTC phone on issabel 2020 - asterisk 16 if anyone needs to start an amazing WEBPhone on issablePBX :)

ISSABEL Configuration :

  1. if you want real HTTPS install certbot with this command and get it
    yum install epel-release ``yum insall certbot -y ``certbot certonly --standalone -d pbx.example.com

  2. IssabelPBX Advanced Settings Webinterface Certificate file: /etc/letsencrypt/live/pbx.example.com/fullchain.pem Enable HTTPS support for the mini-HTTP Server: True Enable Static Content: False Enable the mini-HTTP Server: False HTTP Bind Address: 0.0.0.0 HTTP Bind Port: 8088 HTTPS Bind Address/Port: 0.0.0.0:8089 Private key file: /etc/letsencrypt/live/pbx.example.com/privkey.pem

  3. Create a SIP WebRTC extention in Webinterface (all defualt) + enable rtcp_mux

  4. Edit RTP in Terminal vi /etc/asterisk/rtp_custom.conf

    [general]
    rtpstart=10000
    rtpend=20000
    rtpchecksums=no
    dtmftimeout=3000
    rtcpinterval=5000
    strictrtp=no
    icesupport=yes
    stunaddr=stun.l.google.com:19302
    [ice_host_candidates]
    xx.xx.xx.xx (local ip) => xx.xx.xx.xx (public ip)

Reload Asterisk in web or terminal :)

  1. Install BroswerPhone

yum install git -y ``git clone https://github.com/InnovateAsterisk/Browser-Phone.git cp -rfv Browser-Phone/Phone /var/www/html/Phone

  1. Open this address https://pbx.example.com/Phone Asterisk Server: pbx.example.com WebSocket Port: 8089 WebsocketPath: /ws and put your SIP Extention and password

Router Configuration: Forward port TCP 8089 TCP 443 UDP 10000-20000