Page 1 of 2

Webrtc for Vicidial

PostPosted: Tue Oct 07, 2014 9:08 pm
by Noah
Image
Updated ssl now required by browsers section has been added to the install walk through on GitHub.

Preface:
---------------------------------------------------------------------------------------------------------------------------------------------------
Needed and Wanted html 5 webphone / WebRTC, not java, not active x, not flash based phone.
Wanted to keep 1.8.29.0-vici asterisk unchanged for performance and stability.
The main purpose for us was to get to a web phone app where agents could nail up voice on login, and not necessarily to use the web phone for general outbound calling, again to use it for the purpose of nailed up voice on agent login.

(since this is a javascript implementation and html 5 this should work theoretically on any device and browser that supports html5 and WebRTC)


Summary of findings and some narrative:
---------------------------------------------------------------------------------------------------------------------------------------------------
Webrtc2sip will act as a gateway to asterisk converting websocket connections and handing off SDP instruction to any version of asterisk.
Asterisk does not need to be modified patched or otherwise changed from a source code perspective. Some adjustments to .conf are helpful.
Upon testing, have not seen an increase in load on the server, no voice degradation.
The key here is don't trans-code. No trans-coding = low load / no load. Use ulaw or you can compile the gateway with g729 if you need to and have g729 compiled and loaded our your vici asterisk flavor.

With the advent of DTLS and SRTP (Forced in the new versions of Chrome and Firefox) - the gateway handshakes these secure protocols with the WEBRTC request, and hands off the SDP to asterisk for a connection and voice delivery.

The settings for the webphone are instructions to let the gateway know where to hand off the SDP.
Again the gateway doesn't need to be installed with any codecs if you are using ulaw, just ssl and srtp

**********************************************************************************************************************************
Version installed and tested with:
ViciBox Redux v.5.0.2-130821 (zypper up && zypper refresh to grab the latest svn during vicibox-install)
1.8.29.0-vici asterisk
(Standard Install)
Install and testing was done to an external ip vicibox with 1 to 1 natting and appropriate iptables firewalling
Tested with latest version of chrome on WinXP
Tested with a Chromebook (fantastic)
***********************************************************************************************************************************

******************************************************************************Ok Enough let's get to the install part******************************
Instructions to setup gateway:

https://github.com/noahseis/webrtc2sip.git

readme_install_walkthrough.txt

Re: Webrtc for Vicidial

PostPosted: Tue Oct 07, 2014 9:40 pm
by mflorell
In our experience, webRTC is getting better, but ZoiperWeb is still easier and more reliable to adopt across our current client base. I'm sure that within a few years WebRTC phones will be the better option across the board.

Thank you very much for posting your experience in setting this up!

Re: Webrtc for Vicidial

PostPosted: Thu Oct 16, 2014 1:20 pm
by Noah
Just a quick update on the progress with this project.

Here's a TOP with Webrtc2sip gateway with 1 agent connected
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17814 root 20 0 2575m 26m 5652 S 2.7 0.3 23:18.43 webrtc2sip

With 4 agents connected
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17814 root 20 0 2575m 26m 5652 S 2.3 0.3 23:21.50 webrtc2sip

With 8 agents
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17814 root 20 0 3015m 28m 5652 S 3.0 0.4 23:58.37 webrtc2sip

Re: Webrtc for Vicidial

PostPosted: Mon Apr 06, 2015 12:43 pm
by omarrodriguezt
Thank you!

Re: Webrtc for Vicidial

PostPosted: Tue Apr 28, 2015 2:35 pm
by mcargile
So I have done some testing with this as Chrome is going to stop supporting the Zoiper Webphone. I am not sure if this is just my configuration, but I can get it work in Chrome, but there seems to be about a five second delay between when I click answer and when the call connects in Asterisk. The audio passes nicely though. In Firefox the reverse is true. The call seems to answer immediately but there is no audio. IE just doesn't seem to work at all and after trying it in IE i cannot get it to work in any other browser without rebooting.

@Noah. Have you run into these issues? Also is there a way to get the webrtc2sip service to actually log its output somewhere?

Re: Webrtc for Vicidial

PostPosted: Tue Apr 28, 2015 2:48 pm
by mcargile
Okay found the log. God I hate systemd

Re: Webrtc for Vicidial

PostPosted: Tue Apr 28, 2015 5:09 pm
by williamconley
Anybody mind if I move this to Support where it appears to belong now?

Re: Webrtc for Vicidial

PostPosted: Wed Sep 09, 2015 3:02 pm
by omarrodriguezt
I'm still unable to make it works. I've tried a few times. I'm able to do the outbound call but no audio.
Have anyone else installed webrtc successfully?
@William, I don't mind if you move this to support.

Re: Webrtc for Vicidial

PostPosted: Wed Sep 09, 2015 6:25 pm
by mflorell
We got it to the point where it worked most of the time in Chrome, but it was not very reliable and often required reloading Chrome or even rebooting the workstation to get it to work again.

Re: Webrtc for Vicidial

PostPosted: Thu Sep 10, 2015 7:45 am
by omarrodriguezt
Thank you @mflorell

Re: Webrtc for Vicidial

PostPosted: Mon Oct 12, 2015 11:26 pm
by nandotech
Happy to report that we have a full live implementation of this working, and extremely reliably--currently supporting close to 100 agents across multiple ViciDial systems without any known issues or problems to report.

Little copypasta:

We now have it implemented where there is a single central web phone for several dialer clients and is currently supporting over 100 concurrent users at any given time
and still maintains great call quality and minimal issues with it being laggy and/or registration. Requires significant tinkering and in 3 or 4 separate implementations we've run into issues and the final stages of setting up are always spent reconfiguring the final pieces.
Our webphone is implemented vertically across the vicidial (screenshot below) where the agent is able to show/hide it. The agent does need to click the "answer" button on the webphone in order to complete registration, but otherwise it can then be hidden (forcefully, if you wish). We notice a lot of agents hide it on their own anyway.

So currently we have the below webphone installed on a single virtual machine (8 vCores, 4GB RAM) and about 4 or 5 different ViciDial installations that point to it to register their extensions & pass the calls.

Image

Let us know if you have any questions! More than happy to help out.
Shameless plug: We provide many Vici implementation and hosting solutions to several clients. Feel free to reach out.

Re: Webrtc for Vicidial

PostPosted: Sat Oct 24, 2015 4:36 pm
by areon
nandotech, hello!
How it works?
Share this solution! This is very curious, really! =)

Re: Webrtc for Vicidial

PostPosted: Sun Oct 25, 2015 8:32 am
by omarrodriguezt
I tried several times with not luck. I'm waiting for someone else to share, or maybe an add on in the new svn

Re: Webrtc for Vicidial

PostPosted: Wed May 25, 2016 9:35 pm
by Noah
Anyone try direct connect from sipml5 to the new version of Asterisk 11.22.0-vici?

Re: Webrtc for Vicidial

PostPosted: Thu May 26, 2016 6:27 am
by mflorell
We've been working on our own WebRTC phone that works natively with Asterisk 11. It's pretty much done at this point, we are just setting up the SSL infrastructure so it can be used publicly(WebRTC has to have SSL on it's web server, SSL on the dialers and SSL on any associated web resources within the same browser page).

Here's a screenshot,
Image

Re: Webrtc for Vicidial

PostPosted: Thu May 26, 2016 8:35 am
by williamconley
OK: That's cool. 8-)

Re: Webrtc for Vicidial

PostPosted: Mon Jun 06, 2016 9:54 am
by iboam
WOW that's awesome ... when it's gonna be available to use ??

Re: Webrtc for Vicidial

PostPosted: Mon Jun 06, 2016 10:05 am
by mflorell
We don't have a date yet for public beta users, but we are preparing one of our larger VICIhost clients to try it out later this week.

Re: Webrtc for Vicidial

PostPosted: Mon Jun 13, 2016 2:19 pm
by iboam
i bought an ssl certificate for my server but can't find any help on how to install it ... can provide me some help to install my ssl certificate ??

Re: Webrtc for Vicidial

PostPosted: Mon Jun 13, 2016 2:48 pm
by williamconley
iboam wrote:i bought an ssl certificate for my server but can't find any help on how to install it ... can provide me some help to install my ssl certificate ??

Please do not hijack posts for your own nefarious purposes. This post is about "WebRTC for Vicidial" which is categorically NOT "ssl certificate installation". Besides, that's a simple apache question, unrelated to Vicidial. But at least create a new post for it after checking to see if one already exists.

Later, someone else may require this information. It's doubtful that they would find it in "WebRTC for Vicidial". Make a new post. Put in a suitable subject line. Someone else may benefit from whatever information you get.

Re: Webrtc for Vicidial

PostPosted: Tue Jun 14, 2016 4:21 pm
by chornyi_taras
Update: Changed project name

I've developed webrtc based webfone and successfully integrated it with latest vicidial.
Code is placed on github https://github.com/chornyitaras/PBXWebPhone
This is ui-less webphone. Phone is based on SIPjs and works in Chrome, Firefox.
Installation steps will be uploaded within next few days.

Re: Webrtc for Vicidial

PostPosted: Tue Jun 14, 2016 4:35 pm
by williamconley
chornyi_taras wrote:I've developed webrtc based webfone and successfully integrated it with latest vicidial. Code is placed on github https://github.com/chornyitaras/viciphone
This is ui-less webphone. Phone is based on SIPjs and works in Chrome, Firefox. Installation steps will be uploaded within next few days.

Probably a good idea to change the readme.md file to show the full version of Vicibox and Vicidial with which you tested it. Stating "latest" is poor form. LOL
Wouldn't the instructions basically be "copy this to a web folder"? (Probably plus "include phone_login&phone_pass&server_ip in the URL when calling the index.php page)

Re: Webrtc for Vicidial

PostPosted: Tue Jun 14, 2016 4:50 pm
by chornyi_taras
I'm going to describe full setup including Apache and asterisk SSL config as well as Vicidial system/phones config

Re: Webrtc for Vicidial

PostPosted: Tue Jun 14, 2016 5:32 pm
by iboam
I just Installed ... but it does not work ... i already have ssl williamconley helped me, but how may i enable ws ???

Re: Webrtc for Vicidial

PostPosted: Tue Jun 14, 2016 6:13 pm
by mflorell
Thank you for posting chornyi_taras. But we would request that you change the name of your project to not be confused with the WebRTC phone that we will be releasing shortly. We also have already registered the domains for "viciphone".

Re: Webrtc for Vicidial

PostPosted: Tue Jun 14, 2016 7:11 pm
by williamconley
Probably best to change it to "DialerWebPhone" which is more generic and avoids the "Vicidial" confusion for "viciphone". Especially since you're not selling it. And I'm pretty sure you'll be able to link it to other dialer systems. You may even want "PBXWebPhone" which is actually available if you want to purchase it. 8-)

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 1:39 am
by chornyi_taras
Ok I'll rename it.

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 1:47 am
by chornyi_taras
iboam wrote:I just Installed ... but it does not work ... i already have ssl williamconley helped me, but how may i enable ws ???

Check this example https://github.com/chornyitaras/PBXWebPhone/wiki/Asterisk-configuration

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 1:54 pm
by iboam
Thanks chornyi_taras for your help
chornyi_taras wrote:
iboam wrote:I just Installed ... but it does not work ... i already have ssl williamconley helped me, but how may i enable ws ???

Check this example https://github.com/chornyitaras/PBXWebPhone/wiki/Asterisk-configuration


It's working now but when webphone ring i have no option to take the call ...

i will suggest to add in your tutorial:

If your system requires the certificate and RSA Private key files in .pem format, you can do the following:

1) Download the certificate files (.crt and CA bundle) in your SSL provider account and rename them from .crt and .ca-bundle to .pem ones.

2) As for RSA Private key, it is generated in pair with a CSR. Nor Certificate Authorities have access to your private key. It is generated locally on your server and is never transmitted to anyone.

You can locate it on your server and also rename it from .key to .pem

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 2:32 pm
by chornyi_taras
phone should answer automatically
did you hear standard welcome message(you are the only person ...)?

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 2:38 pm
by iboam
No, just the ring

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 2:38 pm
by williamconley
I'll just toss a guess in here: He could not answer the phone, no method to do so. Thus there was no sound on the unanswered phone.

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 2:55 pm
by chornyi_taras
Can you please provide asterisk logs ?

Or you can try to check your asterisk configuration using https://www.doubango.org/sipml5/call.htm or https://tryit.jssip.net/

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 3:21 pm
by iboam
Code: Select all
[Jun 15 16:20:04]        > Saved useragent "IM-client/OMA1.0 sipML5-v1.2016.03.04" for peer 2000
[Jun 15 16:20:04] NOTICE[1533]: chan_sip.c:23832 handle_response_peerpoke: Peer '2000' is now Reachable. (247ms / 2000ms)
[Jun 15 16:20:06]   == Manager 'sendcron' logged on from 127.0.0.1
[Jun 15 16:20:06]   == Manager 'sendcron' logged off from 127.0.0.1
[Jun 15 16:20:17]   == Using SIP RTP CoS mark 5
[Jun 15 16:20:17] NOTICE[1533][C-00001932]: chan_sip.c:10117 process_sdp: Received AVP profile in audio answer but AVPF is enabled, disabling: audio 38528 RTP/AVP 111 8 0 101
[Jun 15 16:20:17] WARNING[1533][C-00001932]: chan_sip.c:10511 process_sdp: Failed to receive SDP offer/answer with required SRTP crypto attributes for audio

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 3:29 pm
by chornyi_taras
you need to configure your phone
see https://github.com/chornyitaras/PBXWebP ... figuration

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 3:49 pm
by iboam
i did it before test ...
chornyi_taras wrote:you need to configure your phone
see https://github.com/chornyitaras/PBXWebP ... figuration


by the way i'm getting this error

SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 4:13 pm
by chornyi_taras
can you please provide browser log(press F12 ans select console)?
As I can see from logs you were trying to use sipml5. Did you configure correct WebSocket Server URL in expert mode.? It should look like wss://<your domain>:8089/ws

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 4:18 pm
by chornyi_taras
iboam wrote:SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.


you see this error because you are connecting to ws but not wss.
check your sipml5 configuration in exper mode

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 4:20 pm
by iboam
This appears to be Chrome
SIPml-api.js?svn=250:1 SIPML5 API version = 2.0.3
call.htm:161 location=https://www.doubango.org/sipml5/call.htm
SIPml-api.js?svn=250:1 'webkitURL' is deprecated. Please use 'URL' instead.


Disable Video: Checked
Enable RTCWeb Breaker: Checked
WebSocket Server URL: wss://domain:8089/ws
Disable 3GPP Early IMS: Checked
Disable debug messages: Checked
Cache the media stream: Checked

Re: Webrtc for Vicidial

PostPosted: Wed Jun 15, 2016 4:26 pm
by chornyi_taras
uncheck Disable debug messages