This document discusses best practices for deploying WebRTC to replace or augment existing SIP-based phone systems. It covers choosing appropriate codecs to balance bandwidth usage and call quality for different use cases. It also addresses WebRTC-specific considerations like ICE, DTLS, and asymmetric call patterns. Performance metrics are provided from test calls using different codecs on an Asterisk server. The presentation includes diagrams of common WebRTC deployment architectures and links to live demos.
6. 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
8. Video Peer Calls
Video
User Agent
Internet
SIP
Audio
HTML
Context
Asterisk Webservice
9. Internal Audio Agents
Asterisk
L
A
N
App
Server
User
P
S
T
N
Agent
Agent
Agent
Agent
Agent
10. External Audio Agents
I
N
T
E
R
N
E
T
User
P
S
T
N
Agent
Agent
Agent
Agent
Agent
WebRTC
App
Server
Asterisk
11. External Audio Users
L
A
N
User
I
N
T
E
R
N
E
T
Agent
Agent
Agent
Agent
Agent
DeskPhones
HTML
WebRTC Audio
App
Server
Asterisk
SIP Phones
12. Hybrid
L
A
N
User
I
N
T
E
R
N
E
T
Agent
Agent
Agent
Agent
Agent
DeskPhones
WebRTC
Audio
HTML
App
Server
Asterisk
Agent
WebRTC
SIP Phones
PSTN
Audio FAX SMS
User
Skype
Twitter
Chat
Email
Facebook
13. 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.
14. Codecs
Codecs implemented in browsers today:
ULAW - old favourite - high bandwidth/ low cpu
2 quality modes - landline or incomprehensible
Opus - new comer - low bandwidth / high cpu
flexible quality and error correction settings
VP8 - free video codec - High but variable bandwidth
H264 - licensed video codec - free if < 100k (IANAL)
15. Codecs - ideal choices
(audio only)
Codec Setting Reasoning
P2P
video Opus None The browser knows best
Int
Agents ulaw None low loss on LAN +
will end up on PSTN
Ext
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
17. WebRTC uses DTLS to generate SRTP key
Different Cypher suites
Different key lengths
Multiple certificate sources
All impacts CPU usage at call setup.
19. 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
21. 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
22. 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)
24. 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