Vicibox webpone with Self-signed SSL certificate
Topic: how to configure vicibox webphone with self-signed ssl
Overview:
In this blog , i am going to provide step by step guide to integrate, enable and configure the viciphone(a webrtc phone) in vicibox (also applicable to any vicidial based system) using the Self Signed SSL Certificate ,ie without a public-ip and FQDN or accessing the vicidial with internal LAN IP.
But same steps can also used with FQDN .
As part of this Tutorial i am using vicibox 9,
Prerequisites
Steps : Vicidial webphone Configuration
1. Generate Self Signed Certificate in linux
2. address the self signed certificate and key in apache
3. Asterisk configuration to support webrtc
4. download the viciphone to the agent web directory
5. Vicidial configuration to enable the viciphone as webphone.
6. Final workaround to support webrtc with selfsigned certificate.
STEP 1: Generate Self Signed Certificate using openssl
Login to your linux console as root and run the below command to generate the selfsigned SSL certificate and key. check this link
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl.key/viciphone.key -out /etc/apache2/ssl.crt/viciphone.crt
Note: the default path of ssl in vicibox is /etc/apache2/ssl.crt and /etc/apache2/ssl.key
I used viciphone name, you can use your own specific name.
If you have Trusted certificate, you can place the certificate in /etc/apache2/ssl.crt/ and key in /etc/apache2/ssl.key/
STEP 2 : Apache configuration.
edit the vicibox vhost file.
vi /etc/apache2/vhost.d/1111-default-ssl.conf
edit the below line with your certificate name
SSLEngine onSSLCertificateFile /etc/apache2/ssl.crt/viciphone.crtSSLCertificateKeyFile /etc/apache2/ssl.key/viciphone.key
Edit the below mentioned file
vi /etc/apache2/vhost.d/1111.default.conf
DocumentRoot /srv/www/htdocsRedirect permanent / https://yourserverip/
Restart apachesystemctl restart apache2
STEP 3: Asterisk configuration to support webrtc
vi /etc/asterisk/http.conf
enabled=yesbindaddr=0.0.0.0bindport=8088tlsenable=yestlsbindaddr=0.0.0.0:8089tlscertfile=/etc/apache2/ssl.crt/viciphone.crttlsprivatekey=/etc/apache2/ssl.key/viciphone.key
vi /etc/asterisk/modules.conf
add the below entry if not enabled before.
load => res_http_websocket.so
Reboot the server once, so the asterisk startup with http_websocket loaded,
to confirm websocket is loaded, run the below command
asterisk -rx 'http show status'
“HTTPS Server Enabled and Bound to 0.0.0.0:8089”
STEP 4: Downloading the viciphone
SSH to your vicibox and run below commands
cd /var/tmp
git clone https://github.com/vicimikec/ViciPhone.git
cd Viciphonecp -r Source /srv/www/htdocs/agc/viciphonechmod -R 755 /srv/www/htdocs/agc/viciphone
Step 5 : Vicidial configuration
Make sure the vicidial admin interface is accessible via https
https://192.168.29.99/vicidial/admin.php
Wephone URL: https://192.168.29.99/agc/viciphone/viciphone.php
Web Socket URL : wss://192.168.29.99:8089/ws
Step 5.3 :vicidial websocket template.
type=friendhost=dynamicencryption=yesavpf=yesicesupport=yesdirectmedia=notransport=wssforce_avp=yesdtlsenable=yesdtlsverify=nodtlscertfile=/etc/apache2/ssl.crt/viciphone.crtdtlsprivatekey=/etc/apache2/ssl.key/viciphone.keydtlssetup=actpassrtcp_mux=yes
Step 5.4 : Creating Phone as webphone.
1. Set As Webphone: Y2. Webphone Auto-Answer: Y3. Use External Server IP : N
4. Template : select the template created in Step 5.3 above
STEP 6: Browser workaround
https://serverip/ie : https://192.168.29.99/https://serverip:8089/ie : https://192.168.29.99:8089
once the certificate accepted
login to agent portal with username and passwords.
https://serverip/agc/vicidial.php
Note: you need to press Call Agent Webphone to get connected.
Also you need Press Allow for Mic and Speaker permission .