Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Implementation Lessons Using WebRTC in Asterisk
Search
Moises Silva
October 10, 2013
Technology
1
310
Implementation Lessons Using WebRTC in Asterisk
Understanding WebRTC and the Asterisk implementation for this new technology
Moises Silva
October 10, 2013
Tweet
Share
More Decks by Moises Silva
See All by Moises Silva
FreeSWITCH Performance Scaling
moy
0
510
Other Decks in Technology
See All in Technology
KubeCon + CloudNativeCon Japan 2025 に行ってきた! & containerd の新機能紹介
honahuku
0
120
本が全く読めなかった過去の自分へ
genshun9
0
900
モバイル界のMCPを考える
naoto33
0
420
整頓のジレンマとの戦い〜Tidy First?で振り返る事業とキャリアの歩み〜/Fighting the tidiness dilemma〜Business and Career Milestones Reflected on in Tidy First?〜
bitkey
2
14k
MUITにおける開発プロセスモダナイズの取り組みと開発生産性可視化の取り組みについて / Modernize the Development Process and Visualize Development Productivity at MUIT
muit
1
14k
SmartNewsにおける 1000+ノード規模 K8s基盤 でのコスト最適化 – Spot・Gravitonの大規模導入への挑戦
vsanna2
0
120
生成AI時代の開発組織・技術・プロセス 〜 ログラスの挑戦と考察 〜
itohiro73
1
430
ビズリーチが挑む メトリクスを活用した技術的負債の解消 / dev-productivity-con2025
visional_engineering_and_design
3
6.6k
LangSmith×Webhook連携で実現するプロンプトドリブンCI/CD
sergicalsix
1
200
Tech-Verse 2025 Global CTO Session
lycorptech_jp
PRO
0
1.7k
ネットワーク保護はどう変わるのか?re:Inforce 2025最新アップデート解説
tokushun
0
180
「クラウドコスト絶対削減」を支える技術—FinOpsを超えた徹底的なクラウドコスト削減の実践論
delta_tech
4
140
Featured
See All Featured
Thoughts on Productivity
jonyablonski
69
4.7k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Agile that works and the tools we love
rasmusluckow
329
21k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
What's in a price? How to price your products and services
michaelherold
246
12k
Optimizing for Happiness
mojombo
379
70k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
Navigating Team Friction
lara
187
15k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
680
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
960
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Transcript
Implementa)on Lessons using WebRTC in Asterisk Astricon, October
2013 Moisés Silva <
[email protected]
> Manager, So?ware Engineering
Agenda • WebRTC Intro • WebRTC Asterisk Architecture
• Install & Config • TroubleshooLng 2 Sangoma Technologies -‐ © 2013
WebRTC Intro • It is not a phone in
the browser! 3 Sangoma Technologies -‐ © 2013
WebRTC Intro • It is a full RTC engine
in the browser! 4 Sangoma Technologies -‐ © 2013
WebRTC Intro • Yes, it can be used for
a phone in the browser J 5 Sangoma Technologies -‐ © 2013
WebRTC Intro • Full media engine API in the
web browser • No “call” or “session” signaling defined • Generic data interchange between browsers, peer to peer • State of the art NAT traversal techniques 6 Sangoma Technologies -‐ © 2013
WebRTC Intro • WebRTC comes with mulLple APIs, ie:
• Peer-‐to-‐Peer ConnecLons (RTCPeerConnecLon) • Peer-‐to-‐Peer Data API (RTCDataChannel) • StaLsLcs (RTCStats) • Media Stream (getUserMedia) 7 Sangoma Technologies -‐ © 2013
WebRTC Intro • WebRTC uses established protocols:
• SRTP/SRTCP for media exchange (secure RTP) • SDP (its use is controversial and currently challenged) • ICE, STUN, TURN for NAT Traversal • DTLS for key exchange • G.711, Opus, VP8/H.264 etc; for voice and video 8 Sangoma Technologies -‐ © 2013
WebRTC Intro • What signaling to use is up
to you: • SIP • XMPP/Jingle • RESTful API (json) • OpenPeer …. 9 Sangoma Technologies -‐ © 2013
WebRTC Intro • ApplicaLons • A phone,
video calls, conferencing etc! • Video games • P2P Video Streaming (Chromecast) • MoLon-‐detecLng Baby Monitor ( hops://github.com/webrtcHacks/ webrtc_baby_monitor) 10 Sangoma Technologies -‐ © 2013
WebRTC Intro • WebRTC Web Triangle 11
Sangoma Technologies -‐ © 2013 Alice’s Browser Bob’s Browser Encrypted Media Web Signaling Signaling
WebRTC in Asterisk 12 Sangoma Technologies
-‐ © 2013 Alice’s Browser Bob’s Browser Encrypted Media SIP over WS SIP over WS Encrypted Media
WebRTC in Asterisk • WebRTC Gateway 13
Sangoma Technologies -‐ © 2013 Alice’s Browser SIP/RTP, Jingle, FXO/FXS, PRI, SS7 etc … Encrypted Media SIP over WS
WebRTC in Asterisk 14 Sangoma Technologies
-‐ © 2013 Javascript SIP WebRTC chan_sip res_hop_websocket res_rtp_asterisk res_srtp
WebRTC in Asterisk 15 Sangoma Technologies
-‐ © 2013 sipml5 Chrome 30 Asterisk 11
Installing WebRTC Support • Make sure you have:
• libuuid-‐devel (required by res_rtp_asterisk) • OpenSSL w/ DTLS support (1.0.1e has SSL_CTX_set_tlsext_use_srtp) • libsrtp-‐devel 16 Sangoma Technologies -‐ © 2013
Installing WebRTC Support • Easy usual steps …
• ./configure • make menuselect: • res_hop_websocket • res_rtp_asterisk • make install 17 Sangoma Technologies -‐ © 2013
Configuring WebRTC Support • Enable the websockets server (hop.conf)
• enabled=yes • bindaddr=0.0.0.0 • bindport=8088 18 Sangoma Technologies -‐ © 2013
Configuring WebRTC Support • Good idea to use secure
websockets (hop.conf) • tlsenable=yes • tlsbindaddr=0.0.0.0:8089 • tlsceruile=localhost.crt • tlsprivatekey=localhost.key 19 Sangoma Technologies -‐ © 2013
Configuring WebRTC Support • But … Asterisk currently seems
to have issues with secure WebSockets, patches available to fix them • hops://issues.asterisk.org/jira/browse/ ASTERISK-‐21930 • hop://svnview.digium.com/svn/asterisk/team/moy/ webrtc-‐11/ 20 Sangoma Technologies -‐ © 2013
Configuring WebRTC Support • Verify the HTTP server status
21 Sangoma Technologies -‐ © 2013
Configuring WebRTC Support • Test websockets connecLvity •
npm install –g ws • wscat –s echo –c ws://<host>:<port>/ws wscat –s echo –c wss://<host>:<port>/ws 22 Sangoma Technologies -‐ © 2013
Configuring WebRTC Support • Test websockets connecLvity 23
Sangoma Technologies -‐ © 2013
Configuring WebRTC Support 24 Sangoma Technologies -‐ ©
2013
Configuring WebRTC Support • Enable SIP over websockets (sip.conf)
• transport=ws,wss • Make sure you use the /ws URL when connecLng from JavaScript • Create a SIP account to receive ws/wss calls 25 Sangoma Technologies -‐ © 2013
Configuring WebRTC Support • TesLng using sipml5.org/call.htm
26 Sangoma Technologies -‐ © 2013
Configuring WebRTC Support 27 Sangoma Technologies -‐ ©
2013
Troubleshoo)ng • TroubleshooLng Toolkit • javascript console
• chrome://webrtc-‐internals • Node ws (test websockets) • Wireshark! 28 Sangoma Technologies -‐ © 2013
Troubleshoo)ng • The javascript console is your friend
29 Sangoma Technologies -‐ © 2013
Troubleshoo)ng • Checking out chrome://webrtc-‐internals 30
Sangoma Technologies -‐ © 2013
Troubleshoo)ng • Checking out chrome://webrtc-‐internals 31
Sangoma Technologies -‐ © 2013
Troubleshoo)ng • Note that Wireshark VoIP calls menu won’t
work for calls over websockets • You can however use “Follow TCP stream” and see the enLre SIP signaling flow • RTP decoding will not work either (rtcp-‐mux) 32 Sangoma Technologies -‐ © 2013
Troubleshoo)ng • TLS decrypLon can be achieved by installing
the private key on Wireshark • Preferences -‐> Protocols -‐> SSL -‐> RSA Key List 33 Sangoma Technologies -‐ © 2013
Troubleshoo)ng • Wireshark decrypted secure WebSocket payload 34
Sangoma Technologies -‐ © 2013
Things to test in the near Future • Trickle
Ice • Use of other codecs (ie Opus, iSAC) • Video (VP8) • Use libwebsockets in res_hop_websocket? 35 Sangoma Technologies -‐ © 2013
Conclusion • Asterisk + WebRTC gateway is easy to
setup! • Know your debugging tools • Understand the protocols involved • Have fun and hack away! 36 Sangoma Technologies -‐ © 2013
QUESTIONS
Contact Us • Sangoma Technologies 100 Renfrew Drive,
Suite 100 Markham, Ontario L3R 9R6 Canada • Website hop://www.sangoma.com/ • Telephone +1 905 474 1990 x2 (for Sales) • Email
[email protected]
Sangoma Technologies -‐ © 2013 38
THANK YOU