Asterisk en Español Introducción a Asterisk Astricon Europe 2005.
Getting the Best Out Of WebRTC - Astricon 2014
-
Upload
dan-jenkins -
Category
Technology
-
view
493 -
download
1
description
Transcript of Getting the Best Out Of WebRTC - Astricon 2014
![Page 1: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/1.jpg)
Getting the Best out of WebRTC
Tim Panton - Protocol Droid - Westhawk Ltd Dan Jenkins - Chief Ape - nimblea.pe & Respoke
![Page 2: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/2.jpg)
Simple 1 for 1 replacement ?
No!Bandwidth / CPU use are different
![Page 3: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/3.jpg)
How to plan a deployment
A talk in two parts
![Page 4: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/4.jpg)
Architecture and Choices
![Page 5: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/5.jpg)
Practical numbers and graphs
![Page 6: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/6.jpg)
Assumptions
If you are here you are probably
Doing this commercially - Quality matters
Using Asterisk - Hybrid model with some PSTN
Have Asymmetric calls - agents and users
Are on a tight bandwidth and CPU budget
Video not top priority (yet)
Have a clue
![Page 7: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/7.jpg)
WebRTC Topologies
![Page 8: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/8.jpg)
Video Peer Calls
WebserviceAsterisk
AgentUser
Internet
SIP
Video
Audio
HTML
Context
![Page 9: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/9.jpg)
Internal Audio Agents
Asterisk
L A N
App Server
UserP S T N
Agent
Agent
Agent
Agent
Agent
![Page 10: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/10.jpg)
External Audio Agents
I N T E R N E T
UserP S T N
Agent
Agent
Agent
Agent
Agent
WebRTC
Asterisk
App Server
![Page 11: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/11.jpg)
External Audio Users
L A N
User
I N T E R N E T
Agent
Agent
Agent
Agent
Agent
DeskPhones
WebRTC Audio
HTML
Asterisk
App Server
SIP Phones
![Page 12: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/12.jpg)
Hybrid
L A N
UserI N T E R N E T
Agent
Agent
Agent
Agent
Agent
DeskPhones
WebRTCAudio
HTML
Asterisk
App Server
Agent
WebRTC
SIP Phones
User
PSTN
Audio FAX SMS
Chat
EmailFacebook
Skype
![Page 13: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/13.jpg)
WebRTC issues
How webRTC differs from plain old SIP
ICE - can penetrate NAT at cost of setup time
DTLS - encrypted traffic but call setup costs CPU
Web service - may expose your Asterisk
SRTP - encrypted media costs some CPU too.
![Page 14: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/14.jpg)
Codecs
Codecs implemented in browsers today:
ULAW - old favourite - high bandwidth/ low cpu2 quality modes - landline or incomprehensible
Opus - new comer - low bandwidth / high cpuflexible quality and error correction settings
VP8 - free video codec - High but variable bandwidth
H264 - licensed video codec - free if < 100k (IANAL)
![Page 15: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/15.jpg)
Codecs - ideal choices(audio only)
Codec Setting Reasoning
P2P video Opus None The browser knows best
IntAgents ulaw None low loss on LAN +
will end up on PSTNExt
Agent Opus High BW / low loss Can set minimum DSL standards for staff
Ext User Opus Low BW / high loss Users share DSL with
web/games etc
Note - Digium does not support opus on Asterisk
![Page 16: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/16.jpg)
DTLS - crypto selection
![Page 17: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/17.jpg)
WebRTC uses DTLS to generate SRTP key
Different Cypher suites
Different key lengths
Multiple certificate sources
All impacts CPU usage at call setup.
![Page 18: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/18.jpg)
ICE - Tricks
![Page 19: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/19.jpg)
Assume your asterisk has a public IP
Probably don’t need a TURN server
Avoid offering candidates for internal IPs
Don’t offer VPN candidates
Can probably get away with setting ice-lite
![Page 20: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/20.jpg)
Architecture - Asymmetry
![Page 21: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/21.jpg)
In future we expect more asymmetric cases
Mayday - they see your screen not you
Baby monitor - 1 way video but 2 way audio ?
Security cameras
![Page 22: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/22.jpg)
What does that all mean in practice
Probably:
Higher CPU use (especially with Opus)
Longer call setup times
Very high bandwidth with Video (if enabled)
![Page 23: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/23.jpg)
Tools to monitor
Probably:
WebRTC stats (Respoke Stats)
www.npmjs.org/package/getstats
chrome://webrtc-internals
CollectD / Graphite
![Page 24: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/24.jpg)
Some Numbers
Test scenario:
Asterisk: 11.8.1
on machine: Centos Intel(R) Core(TM) i3-4010U CPU @ 1.70GHz
Chrome 38
Ramp up 24 calls
Play back intermittent audio (IVR usage)
Graph - bandwidth / CPU / calls / time
![Page 25: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/25.jpg)
24 ulaw audio calls
Graph
![Page 26: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/26.jpg)
24 opus audio calls - No settings
Graph
![Page 27: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/27.jpg)
24 opus audio calls Low BW high loss
Graph
![Page 28: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/28.jpg)
Some MORE “Numbers”
Test scenario:
Digital Ocean
Medium Droplet
San Francisco
![Page 31: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/31.jpg)
Live demo using respoke Chrome (android too) browse here!
URL:
http://bit.ly/dt-asterisk
![Page 32: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/32.jpg)
Thank you!
Questions?
More info at:
github.com/danjenkins/web-examples
@dan_jenkins
@steely_glint
www.respoke.io
![Page 33: Getting the Best Out Of WebRTC - Astricon 2014](https://reader033.fdocuments.us/reader033/viewer/2022051212/558e671c1a28ab92218b46e1/html5/thumbnails/33.jpg)
http://upload.wikimedia.org/wikipedia/commons/c/ca/Padlock_2010.JPG http://upload.wikimedia.org/wikipedia/commons/8/8e/Ice_road_in_the_Northwest_Territories_-a.jpg http://upload.wikimedia.org/wikipedia/commons/4/41/Asymmetric_%28PSF%29.png
Images Used