Top Banner

of 39

Astricon Webrtc Lessons Learned

Oct 15, 2015

Download

Documents

Rafael Nize

Astricon
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 5/25/2018 Astricon Webrtc Lessons Learned

    1/39

    Implementation Lessons using

    WebRTC in AsteriskAstricon, October 2013

    Moiss Silva Manager, Software Engineering

    mailto:[email protected]:[email protected]
  • 5/25/2018 Astricon Webrtc Lessons Learned

    2/39

    Agenda

    WebRTC Intro

    WebRTC Asterisk Architecture

    Install & Config

    Troubleshooting

    2

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    3/39

    WebRTC Intro

    It is not a phone in the browser!

    3

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    4/39

    WebRTC Intro

    It is a full RTC engine in the browser!

    4

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    5/39

    WebRTC Intro

    Yes, it can be used for a phone in the browser

    5

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    6/39

    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

  • 5/25/2018 Astricon Webrtc Lessons Learned

    7/39

    WebRTC Intro

    WebRTC comes with multiple APIs, ie:

    Peer-to-Peer Connections (RTCPeerConnection)

    Peer-to-Peer Data API (RTCDataChannel)

    Statistics (RTCStats)

    Media Stream (getUserMedia)

    7

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    8/39

    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

  • 5/25/2018 Astricon Webrtc Lessons Learned

    9/39

    WebRTC Intro

    What signaling to use is up to you:

    SIP

    XMPP/Jingle

    RESTful API (json)

    OpenPeer .

    9

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    10/39

    WebRTC Intro

    Applications

    A phone, video calls, conferencing etc!

    Video games P2P Video Streaming (Chromecast)

    Motion-detecting Baby Monitor

    (https://github.com/webrtcHacks/webrtc_baby_mon

    itor)

    10

    Sangoma Technologies - 2013

    https://github.com/webrtcHacks/webrtc_baby_monitorhttps://github.com/webrtcHacks/webrtc_baby_monitorhttps://github.com/webrtcHacks/webrtc_baby_monitorhttps://github.com/webrtcHacks/webrtc_baby_monitorhttps://github.com/webrtcHacks/webrtc_baby_monitorhttps://github.com/webrtcHacks/webrtc_baby_monitorhttps://github.com/webrtcHacks/webrtc_baby_monitorhttps://github.com/webrtcHacks/webrtc_baby_monitorhttps://github.com/webrtcHacks/webrtc_baby_monitor
  • 5/25/2018 Astricon Webrtc Lessons Learned

    11/39

    WebRTC Intro

    WebRTC Web Triangle

    11

    Sangoma Technologies - 2013

    Alices Browser Bobs Browser

    Encrypted Media

    Web

    Signaling Signaling

  • 5/25/2018 Astricon Webrtc Lessons Learned

    12/39

    WebRTC in Asterisk

    12

    Sangoma Technologies - 2013

    Alices Browser Bobs Browser

    Encrypted Media

    SIP over WS SIP over WS

    Encrypted Media

  • 5/25/2018 Astricon Webrtc Lessons Learned

    13/39

    WebRTC in Asterisk

    WebRTC Gateway

    13

    Sangoma Technologies - 2013

    Alices Browser

    SIP/RTP, Jingle, FXO/FXS,

    PRI, SS7 etc

    Encrypted Media

    SIP over WS

  • 5/25/2018 Astricon Webrtc Lessons Learned

    14/39

    WebRTC in Asterisk

    14

    Sangoma Technologies - 2013

    Javascript SIP

    WebRTC

    chan_sipres_http_websocket

    res_rtp_asterisk res_srtp

  • 5/25/2018 Astricon Webrtc Lessons Learned

    15/39

    WebRTC in Asterisk

    15

    Sangoma Technologies - 2013

    sipml5

    Chrome 30

    Asterisk 11

  • 5/25/2018 Astricon Webrtc Lessons Learned

    16/39

    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

  • 5/25/2018 Astricon Webrtc Lessons Learned

    17/39

    Installing WebRTC Support

    Easy usual steps

    ./configure

    make menuselect:

    res_http_websocket

    res_rtp_asterisk

    make install

    17

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    18/39

    Configuring WebRTC Support

    Enable the websockets server (http.conf)

    enabled=yes

    bindaddr=0.0.0.0

    bindport=8088

    18

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    19/39

    Configuring WebRTC Support

    Good idea to use secure websockets (http.conf)

    tlsenable=yes

    tlsbindaddr=0.0.0.0:8089

    tlscertfile=localhost.crt

    tlsprivatekey=localhost.key

    19

    Sangoma Technologies - 2013

    h l i

  • 5/25/2018 Astricon Webrtc Lessons Learned

    20/39

    Configuring WebRTC Support

    But Asterisk currently seems to have issues

    with secure WebSockets, patches available to fix

    them

    https://issues.asterisk.org/jira/browse/ASTERISK-

    21930

    http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/

    20

    Sangoma Technologies - 2013

    S T h l i 2013

    https://issues.asterisk.org/jira/browse/ASTERISK-21930https://issues.asterisk.org/jira/browse/ASTERISK-21930http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/https://issues.asterisk.org/jira/browse/ASTERISK-21930https://issues.asterisk.org/jira/browse/ASTERISK-21930https://issues.asterisk.org/jira/browse/ASTERISK-21930
  • 5/25/2018 Astricon Webrtc Lessons Learned

    21/39

    Configuring WebRTC Support

    Verify the HTTP server status

    21

    Sangoma Technologies - 2013

    S T h l i 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    22/39

    Configuring WebRTC Support

    Test websockets connectivity

    npm installg ws

    wscats echoc ws://:/ws

    wscats echoc wss://:/ws

    22

    Sangoma Technologies - 2013

    Sangoma Technologies 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    23/39

    Configuring WebRTC Support

    Test websockets connectivity

    23

    Sangoma Technologies - 2013

    Sangoma Technologies 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    24/39

    Configuring WebRTC Support

    24

    Sangoma Technologies - 2013

    Sangoma Technologies 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    25/39

    Configuring WebRTC Support

    Enable SIP over websockets (sip.conf)

    transport=udp,ws,wss

    Make sure you use the /ws URL when connecting

    from JavaScript

    25

    Sangoma Technologies - 2013

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    26/39

    Configuring WebRTC Support

    Testing using sipml5.org/call.htm

    26

    Sangoma Technologies 2013

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    27/39

    Configuring WebRTC Support

    27

    Sangoma Technologies 2013

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    28/39

    Troubleshooting

    Troubleshooting Toolkit

    javascript console

    chrome://webrtc-internals

    Node ws (test websockets)

    Wireshark!

    28

    Sangoma Technologies 2013

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    29/39

    Troubleshooting

    The javascript console is your friend

    29

    Sa go a ec o og es 0 3

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    30/39

    Troubleshooting

    Checking out chrome://webrtc-internals

    30

    g g

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    31/39

    Troubleshooting

    Checking out chrome://webrtc-internals

    31

    g g

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    32/39

    Troubleshooting

    Note that Wireshark VoIP calls menu wont work

    for calls over websockets

    You can however use Follow TCP stream andsee the entire SIP signaling flow

    RTP decoding will not work either (rtcp-mux)

    32

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    33/39

    Troubleshooting

    TLS decryption can be achieved by installing the

    private key on Wireshark

    Preferences -> Protocols -> SSL -> RSA Key List

    33

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    34/39

    Troubleshooting

    Wireshark decrypted secure WebSocket payload

    34

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    35/39

    Future

    Trickle Ice

    Use of other codecs (ie Opus, iSAC)

    Video (VP8)

    Use libwebsockets in res_http_websocket?

    35

    lSangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    36/39

    Conclusion

    Asterisk + WebRTC gateway is easy to setup!

    Know your debugging tools

    Understand the protocols involved

    Have fun and hack away!

    36

  • 5/25/2018 Astricon Webrtc Lessons Learned

    37/39

    QUESTIONS

    Sangoma Technologies - 2013

  • 5/25/2018 Astricon Webrtc Lessons Learned

    38/39

    Contact Us

    Sangoma Technologies100 Renfrew Drive, Suite 100

    Markham, Ontario L3R 9R6

    Canada

    Websitehttp://www.sangoma.com/

    Telephone+1 905 474 1990 x2 (for Sales)

    [email protected]

    38

    http://www.sangoma.com/mailto:[email protected]:[email protected]://www.sangoma.com/
  • 5/25/2018 Astricon Webrtc Lessons Learned

    39/39

    THANK YOU