vaheeD khoshnouD

linux, mikrotik, macosx

How to install WebRTC Phone on Issabel 2020, Asterisk 16 with Voice, Video, Presentation, Text Chat Over SIP

Written by vaheeD on July 21, 2021
0.00 avg. rating (0% score) - 0 votes

First, we need to install some dependency package on CentOS7

yum install epel-release
yum insall certbot git -y 

Next Step we need to use valid SSL ( try LetsEncrypt )

certbot certonly --standalone -d pbx.example.com
groupadd sslcerts
chgrp sslcerts /etc/letsencrypt/
usermod -a -G sslcerts asterisk

need to edit some asterisk config and reload

vi /etc/asterisk/rtp_custom.conf

and put this config on file

[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)

Save and go next…

vi /etc/asterisk/sip_custom.conf

and put this config on file

websocket_enabled=true
maxcallbitrate=5120
accept_outofcall_message=yes
auth_message_requests=no
outofcall_message_context=messages

vi /etc/asterisk/extention_cusrom.conf

and put this config on the end of line

[messages]
exten => _.,1,NoOp(SMS receiving dialplan invoked)
exten => _.,n,NoOp(To ${MESSAGE(to)})
exten => _.,n,NoOp(From ${MESSAGE(from)})
exten => _.,n,NoOp(Body ${MESSAGE(body)})
exten => _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
exten => _.,n,MessageSend(${ACTUALTO},${MESSAGE(from)})
exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,GotoIf($["${MESSAGE_SEND_STATUS}" != "SUCCESS"]?sendfailedmsg)
exten => _.,n,Hangup()
;exten => h,1,Hangup()
;
; Handle failed messaging
exten => _.,n(sendfailedmsg),Set(MESSAGE(body)="[${STRFTIME(${EPOCH},,
%d%m%Y-%H:%M:%S)}] Your message to ${EXTEN} has failed. Retry later.")
exten => _.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)})
exten => _.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
exten => _.,n,MessageSend(${ACTUALFROM},ServiceCenter)
exten => _.,n,Hangup()
exten => h,1,Hangup()

Install BrowserPhone Project ( very likely to me to use this, but you can use any WebRTC Phone you want )

cd /tmp
git clone https://github.com/InnovateAsterisk/Browser-Phone.git
cp -rfv Browser-Phone/Phone /var/www/html/Phone

better to run this command :)

chown -R asterisk:asterisk /etc/asterisk/
chown -R asterisk:asterisk /var/www/html/Phone
amportal restart

Now Open Web Interface IssabelPBX and PBX Configuration and Advanced Settings

Go to Asterisk Builtin mini-HTTP server Setting and change blow information

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

Next, Go to SIP Asterisk Setting and check this configuration

NAT Settings    Yes
External IP	0.0.0.0

Audio Codecs
Codecs: opus,ulaw,alaw,gsm

Video Support   Enabled
Codecs:  vp8
Max Bit Rate 5120

After save and Setting go to Extensions and create a SIP WebRTC Extention

All Config Default and need one change

enable rtcp_mux

Save and Submit change.

Congratulation, you can now use this amazing project :)

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

Router and firewall configuration as you need for that

Please accept and forward in firewall and router

TCP 8089
TCP 443
UDP 10000-20000

Any Questions or problems?

0.00 avg. rating (0% score) - 0 votes

Posted Under: Linux

About vaheeD

Leave a Reply

Your email address will not be published. Required fields are marked *

Protected by WP Anti Spam