SlideShare une entreprise Scribd logo
1  sur  47
1
11/19/2013
Signaling Workshop
Tsahi Levent-Levi
tsahil@bloggeek.me
@tsahil
2
11/19/2013
Speakers
• Peter Dunkley
– Technical Director
– Crocodile RCS Ltd

• Kevin Wiseman
– Chief Architect
– CafeX

• Rod Apeldoorn
– EasyRTC Server Lead
– Priologic
3
11/19/2013
Peter Dunkley
Technical Director
Crocodile RCS Ltd

SIP OVER WEBSOCKETS
4
11/19/2013
What is SIP over WebSockets
• It is exactly the same SIP as SIP over TCP, SIP over
TLS, and SIP over UDP – just over WebSockets
instead
• It can be secure by using Secure WebSockets
• It is about to become an RFC – currently in the IETF
editors queue
• It is widely supported by many open-source projects
5
11/19/2013
A quick comparison
Standards Based
SIP over WebSockets XMPP (BOSH/WebSockets)
Open-source support
High
Medium
Vendor tie-in prevention
High
Medium
Ease of use
High
Medium
Client performance
Medium
Medium
Network performance
High
Medium
Ease of interoperability
High
Medium
Standalone applications
High
High
Use existing media servers High
Low

Proprietary
Low
Low
High*
High*
Medium*
Low*
High*
Low

* Dependent on the proprietary option chosen – could be made better or worse depending on
what you chose!
6
11/19/2013
Open source support and vendor tiein prevention
• SIP over WebSockets
– At least four well tested open-source Javascript client stacks
– At least six well tested open-source server stacks

• XMPP (BOSH/WebSockets)
– At least two well tested open-source Javascript client stacks
– At least three open-source server stacks

• Proprietary
– Many options (even open-source options) but all different
and incompatible - many are vendor specific
7
11/19/2013
Ease of use
• SIP over WebSockets
– It is not hard – you are not implementing the signalling yourself
– Many client library choices with different APIs and complexities
– Many SDK vendors working to make it even easier for you

• XMPP (BOSH/WebSockets)
– It is not hard – you are not implementing the signalling yourself
– Limited client library choices mean that it is harder than it should be

• Proprietary
– Might well be very easy (but might not be) – it depends on your
technology choices
– No easier than SIP if you choose the right SIP client library
8
11/19/2013
Client and network performance
• SIP over WebSockets
– Javascript client libraries can be large, but minification and app-cache use mitigate
this almost completely
– The network can have very high performance while making use of years of
developments in real-time signalling and scaling

• XMPP (BOSH/WebSockets)
– Javascript client libraries can be large, but minification and app-cache use mitigate
this almost completely
– The network will be high performance as long as you do not require
interoperability

• Proprietary
– The client library may be small (depending on your vendor choice)
– The network may be high performance (depending on your vendor choice) as you
do not require interoperability
9
11/19/2013
Interoperable and standalone
• The triangle vs the trapezoid
• All options are equally suitable for use with the
“triangle”
• SIP over WebSockets is better for use with the
“trapezoid”
• Avoid gateways whenever you can (they add network
cost and complexity)
• Using SIP makes your application compatible with most
existing media servers (commercial and open-source)
11/19/2013

10
The Triangle
Server

UA

Media

UA

11
11/19/2013
The Trapezoid
Server

UA

Signalling

Media

Server

UA

12
11/19/2013
Use cases for SIP over WebSockets
• SIP is well suited for anything requiring interoperability
– Conferencing – do you really want to exclude the guy travelling
who can’t get (or afford) a mobile data connection?
– Online education – why shouldn’t I be able to listen to lectures
through other routes?
– Telemedicine – a huge boon for people living in remote areas
(aren’t those the ones who struggle to get online?)
– Call centres – can I afford to exclude customers who can’t use
(or don’t want to use) WebRTC?
Many of the applications that need to interoperate are high-value
11/19/2013

13
Kamailio: WebSocket Handshake
...
tcp_accept_no_cl=yes
...
event_route[xhttp:request] {
set_reply_close();
set_reply_no_connect();
if ($hdr(Upgrade)=~"websocket"
&& $hdr(Connection)=~"Upgrade"
&& $rm=~"GET") {

# Validate as required (Host:, Origin:,
Cookie:)
if (ws_handle_handshake())
exit;
}
xhttp_reply("404", "Not Found", "", "");
}
14
11/19/2013
Kamailio: Request Handling
modparam(“nathelper|registrar”, “received_avp”, “$avp(RECEIVED)”)
...
request_route {
route(REQINIT);
route(WSDETECT);
...
route[WSDETECT] {
if (proto == WS || proto == WSS) {
force_rport();
if (is_method(“REGISTER”)) {
fix_nated_register();
} else if
(is_method(“INVITE|NOTIFY|SUBSCRIBE”)) {
add_contact_alias();
}
}
}
...
route[WITHINDLG] {
if (has_totag()) {
if (loose_route()) {
if (!isdsturiset()) {
handle_ruri_alias();
}
...

11/19/2013

15
Kamailio: Response Handling
onreply_route {
if ((proto == WS || proto == WSS)
&& status =~ “[12][0-9][0-9]”) {
add_contact_alias();
}
}

16
11/19/2013
Kamailio: RTP Profile Conversion (1)
modparam(“rtpproxy-ng”, “rtpproxy_sock”, “udp:localhost:22223”)
...
route[LOCATION] {
...
t_on_failure(“UA_FAILURE”);
}
...
failure_route[UA_FAILURE] {
if (t_check_status(“488”) && sdp_content()) {
if (sdp_get_line_startswith(“$avp(mline)”, “m=”)) {
if ($avp(mline) =~ “SAVPF”)) {
$avp(rtpproxy_offer_flags) = “froc-sp”;
$avp(rtpproxy_answer_flags) = “froc+SP”;
} else {
$avp(rtpproxy_offer_flags) = “froc+SP”;
$avp(rtpproxy_answer_flags) = “froc-sp”;
}
# In a production system you probably need to catch
# “RTP/SAVP” and “RTP/AVPF” and handle them correctly
# too
}
append_branch();
rtpproxy_offer($avp(rtpproxy_offer_flags));
t_on_reply(“RTPPROXY_REPLY”);
route(RELAY);
}
}
...

17
11/19/2013
Kamailio: RTP Profile Conversion (2)
modparam(“rtpproxy-ng”, “rtpproxy_sock”, “udp:localhost:22223”)
...
failure_route[UA_FAILURE] {
...
t_on_reply(“RTPPROXY_REPLY”);
route(RELAY);
}

onreply_route[RTPPROXY_REPLY] {
if (status =~ “18[03]”) {
# mediaproxy-ng currently only supports SRTP/SDES – early media
# won't work so strip it out now to avoid problems
change_reply_status(180, “Ringing”);
remove_body();
} else if (status =~ “2[0-9][0-9]” && sdp_content()) {
rtpproxy_answer($avp(rtpproxy_answer_flags));
}
}
...

18
11/19/2013
Authentication (1)
• You do not need accounts on the SIP network
• You can federate with existing identity providers
(Facebook, Google+, LinkedIn, Twitter, your own)
• There is a Kamailio module designed for this (and
implementing it elsewhere is easy)

19
11/19/2013
Authentication (2)
Web
Service
Calling
UA

OAuth2

Shared secret –
communication
link not
required

SIP
Proxy
You don’t have to
create or manage
accounts on the
SIP
Proxy/registrar

Called
UA

20
11/19/2013
Kamailio: Authentication (1)
...
tcp_accept_no_cl=yes
...
modparam(“auth_ephemeral”, “secret”, “kamailio_rules”)
...
modparam(“htable”, “htable”, “wsconn=>size=8;”)
...
event_route[xhttp:request] {
...
# URI format is /?username=foo&password=bar
$var(uri_params) = $(hu{url.querystring});
$var(username) = $(var(uri_params){param.name,username,&});
$var(password) = $(var(uri_params){param.name,password,&});
# Note: username and password could also have been in a Cookie: header
if (!autheph_authenticate(“$var(username)”, “$var(password)”)) {
xhttp_reply(“403”, “Forbidden”, “”, “”);
exit;
}
if (ws_handle_handshake()) {
$sht(wsconn=>$si:$sp::username) = $var(username)
exit;
}
...
event_route[websocket:closed] {
$var(regex) = $si + “:” $sp + “.*”;
sht_rm_name_re(“wsconn=>$var(regex)”);
}

11/19/2013

21
Kamailio: Authentication (2)
...
request_route {
route(REQINIT);
route(WSDETECT);
...
if (!(proto == WS || proto == WSS))
route(AUTH);
...
route[WSDETECT] {
if (proto == WS || proto == WSS) {
$var(username) = (str) $sht(wsconn=>$si:$sp::username);
if ($var(username) == $null || $var(username) == “”) {
send_reply(“403”, “Forbidden”);
ws_close(1008, “Policy Violation”);
exit;
}
if (!autheph_check_timestamp(“$var(username)”)
|| (is_method(“REGISTER|PUBLISH”)
&& !autheph_check_to(“$var(username)”))
|| (!has_totag() && !autheph_check_from(“$var(username)”))) {
send_reply(“403”, “Forbidden”);
ws_close(1008, “Policy Violation”);
exit;
}
force_rport();
...

11/19/2013

22
Questions?
Code:

https://github.com/crocodilertc

Email:

peter.dunkley@crocodilertc.net

Twitter:

@pdunkley
23

11/19/2013
Kevin Wiseman
Chief Architect
CaféX

WHAT IS SIGNALLING
24
11/19/2013
The Basics…
• WebRTC Spec does not define the signalling
– It leaves that open to the implementer

• It does define the media descriptor exchange
– Utilises the Session Description Protocol

25
11/19/2013
What is signalling
• Communications session control from one party to
another party
• Typically via some location service
– E.g. SIP Registrar, social network, games service

• Describes the requests and responses
– Make call, end call, hold, resume, transfer etc
– Ringing, answer, rejected, established etc

• Mechanism for exchanging media description
– SDP offer/answer exchange
11/19/2013

26
Session Description Protocol
• Used to negotiate media between parties
– Media (audio, video), Ports, Codecs, ICE etc
– offer/answer exchange

• The good news:
– Browser generates and consumes SDP offers & answers

• The bad news:
– WebRTC SDP places specific requirements on SDP that
most existing telecom entities do not support
27
11/19/2013
Signalling isn't the hard piece with WebRTC
Media and media description are

28
11/19/2013
Closed Systems
• Real time coms within Games, Social Networks etc
• No compelling reason to adopt any one approach
over another
– Already know who is who and how to communicate
– No integration into existing telcoms system
– Extend existing control channel for SDP offer/answer, or
– Utilise 3rd party services to provide real time coms
29
11/19/2013
WebRTC Gateway
•
•

Proprietary signalling over HTTP or WebSocket between
browser and gateway
Gateway makes sense if:
– The call scenarios you need to support are standard well
defined UC features
• Voice & video: Make call, answer call, end call, transfer call, N-way
call
• IM&P: Send message, receive message, set presence
• Application Event Distribution

– You want to embed UC features as part of a service
– Your SIP infrastructure has limited support for ICE/STUN and
Multiplexing RTP etc

•

Client
SDK

Browser

JSON call control
over WebSocket

SRTP

Fusion
Web
Gateway

Fusion
Media
Broker
De-ICEd,
de-STUNned &
de-multiplexed
RTP

SIP

This is the use case we are seeing almost exclusively
– Customers wanting to embed UC features as part of an overall
service

•

CaféX Implementation

SIP Network

Challenges
– Dependency on gateway exposing features
30
11/19/2013
SIP over Websockets
• SIP over web sockets makes sense if:
– The call scenarios you need to support to the browser
require all the features of SIP
– You have developers that can make full use of SIP features on
the browser
– Your SIP end points already support ICE/STUN and
Multiplexing RTP etc

• Challenges
– SIP stack/UA in the browser (dependency on large and
complex JS in Browser)
– SIP interworking with yet another 3rd party SIP stack
– Security – opening up all the features (and potential security
holes) of SIP to the public internet is dangerous
– No benefit to most existing SIP systems – still have to add
web sockets support, still have to add SDP and Media
translation

If Café X had used
SIP over WebSockets
JS SIP
Stack

JS SIP
UA

SIP over
Websocket

Browser

RTP

Fusion
Web
Gateway

Fusion
Media
Broker
De-ICEd,
de-STUNned &
de-multiplexed
RTP

SIP

SIP Network

31
11/19/2013
Web Dev & Signalling
• Most Web Devs don’t know or even need to know the
signalling protocol
– Busy enough already

• Web Devs expect a rich functional high level API
– Efficiency & ease of use

• Don’t want to reinvent the wheel every time they want
to add RTC to a web app
– If no API provided the first thing a web dev will do is write one
and re-use next time they need to use the service
32
11/19/2013
API Example – Initialisation
<script src="https://<gateway_address>:<8080>/gateway/fusion-client-sdk.js"></script>
//Get hold of the sessionID however your app needs to
var sessionID = getMySessionID();
//Google provide a stun server which you can use or you can use your own.
//Providing any empty array will result in no stun messages being sent.
var stunServers=["stun.l.google.com:19302"];
//Set up initialization success callback before calling start
UC.onInitialised = function() {
//perform tasks associated with successful initialization such as registering listeners on UC objects
};
//Set up initialization failure callback before calling start
UC.onInitialisedFailed = function() {
//perform tasks associated with initialization failure};

//Start my UC session using the Session ID and stun server list
UC.start(sessionID, stunServers);

33
11/19/2013
API Example – Media Streams
window.webkitURL.createObjectURL.UC.phone.onRemoteMediaStream = function(remoteMediaStream) {
//Configure the streams, this can be used to set up visibility of elements and
//set the elements src to that of the remote stream, the remoteMediaStream must be
//added to the page in order to receive audio or and video.
video.src = window.webkitURL.createObjectURL(remoteMediaStream);
};
UC.phone.onLocalMediaStream = function(localMediaStream) {
//As with the remote media stream, you should add the localMediaStream to the page
//in order to allow the framework to playback local (ie, webcam) feedback
preview.src = window.webkitURL.createObjectURL(localMediaStream);
};

34
11/19/2013
API Example – Make Call
var call;
//A method to call from the UI to make a call
function makeCall(addressToCall) {
//Create a call object from the framework and save it somewhere
call = UC.phone.createCall(addressToCall);
//Set what to do when the remote party ends the call
call.onEnded = function() { alert("Call Ended"); };
//Set up what to do if the callee is busy, inform your user etc
call.onBusy = function() { alert("The callee was busy"); };
//Dial the call
call.dial();
};
//A method to call from the UI to end a current call
function endCall() { call.end(); };

35
11/19/2013
Rod Apeldoorn
EasyRTC Server Lead
Priologic

CUSTOM SIGNALING
36
11/19/2013
Benefits Over SIP
• Faster on the client side
• Easier for developers to understand
• Less restrictive

37
11/19/2013
Example Custom Message Types
(from EasyRTC)
WebRTC Core

•
•
•
•

candidate
offer
answer
reject

Application Level
• authenticate
• hangup
• getIceConfig
• roomJoin
• roomData
• setPresence
• filesOffer
• Many more…
38

11/19/2013
Why Combine WebRTC Signaling with
Application Servers?

•
•
•
•
•

Authentication
Call logging
Call control
Combine with application logic
Client connects to just one server
– Why SIP + Presence + Application servers?

• Will SIP Gateways offer JSON signaling? Yes!
39
11/19/2013
Transports
Websockets

XHR Polling

•
•
•
•

• AKA “HTTP Long Polling”
• Easy + Securable
• To use:

Available in all modern browsers
Fast + Responsive + Securable
Maintains open socket
Servers have to deal with
concurrent socket limits

– XMLHttpRequest API
– jquery.ajax()

• Used by Google AppRTC Demo

40
11/19/2013
Transports
JSONP + CORS

Other

• The original popular method for
DHTML
• Cross site scripting issues
• “Cross-Origin Resource Sharing”
can be setup
• Still a valid fallback

• XMPP (Jabber)

– Especially for older browsers

– Instant messengers

• Local
– Bluetooth
– USB / Serial

• WebRTC Data Channels
– Example coming!
41

11/19/2013
Cisco Jabber + EasyRTC
• Cisco DX650 chat with Cisco
or Non-Cisco web user
• WebRTC Across Devices and
Transports
• Built using
– Cisco Jabber SDK
– EasyRTC Opensource

42
11/19/2013
Using a Websocket Library
General Benefits

Why EasyRTC uses Socket.io

• Cross browser support
• Easy message sending
• Easy event handling

• Most popular for Node.js
• Client API’s in many languages

– Connect / Disconnect / Message

• Fallbacks to XHR or JSONP

– JavaScript / C++ / ObjC / Java …

• Message Acknowledgments
• Why recode what’s done well?

43
11/19/2013
Private WebRTC Signaling
1.
2.

3.

Connect users to
servers via
Websockets
Establish
DataChannels
between users on
same servers
Establish WebRTC
Peer Connection
between User 1 and 3
–
–
–

Signals sent via
DataChannel
User 2 acts as a relay
Neither server aware
of final connection
44
11/19/2013
Private WebRTC Signaling
1.
2.

3.

Connect users to
servers via
Websockets
Establish
DataChannels
between users on
same servers
Establish WebRTC
Peer Connection
between User 1 and 3
–
–
–

Signals sent via
DataChannel
User 2 acts as a relay
Neither server aware
of final connection
45
11/19/2013
Private WebRTC Signaling
1.
2.

3.

Connect users to
servers via
Websockets
Establish
DataChannels
between users on
same servers
Establish WebRTC
Peer Connection
between User 1 and 3
–
–
–

http://bit.ly/1iq6v8D

Signals sent via
DataChannel
User 2 acts as a relay
Neither server aware
of final connection
46
11/19/2013
Q&A
47
11/19/2013

Contenu connexe

En vedette

Workshop web rtc customers and use cases
Workshop web rtc customers and use casesWorkshop web rtc customers and use cases
Workshop web rtc customers and use casesDouglas Tait
 
WebRTC Expo | Is Your Business Ready For WebRTC?
WebRTC Expo | Is Your Business Ready For WebRTC?WebRTC Expo | Is Your Business Ready For WebRTC?
WebRTC Expo | Is Your Business Ready For WebRTC?Bruce Marler
 
D1-3-Signaling
D1-3-SignalingD1-3-Signaling
D1-3-SignalingOleg Levy
 
WebRTC Business Use Cases | WebRTC Conference & Expo III
WebRTC Business Use Cases  |  WebRTC Conference & Expo IIIWebRTC Business Use Cases  |  WebRTC Conference & Expo III
WebRTC Business Use Cases | WebRTC Conference & Expo IIILawrence Byrd
 
WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016Dan Jenkins
 
Ramu droid for swach bharat abhiyaan
Ramu droid for swach bharat abhiyaanRamu droid for swach bharat abhiyaan
Ramu droid for swach bharat abhiyaanALTANAI BISHT
 

En vedette (11)

Workshop web rtc customers and use cases
Workshop web rtc customers and use casesWorkshop web rtc customers and use cases
Workshop web rtc customers and use cases
 
WebRTC Expo | Is Your Business Ready For WebRTC?
WebRTC Expo | Is Your Business Ready For WebRTC?WebRTC Expo | Is Your Business Ready For WebRTC?
WebRTC Expo | Is Your Business Ready For WebRTC?
 
Kamailio World 2014 - Kamailio - The Platform for Interoperable WebRTC
Kamailio World 2014 - Kamailio - The Platform for Interoperable WebRTCKamailio World 2014 - Kamailio - The Platform for Interoperable WebRTC
Kamailio World 2014 - Kamailio - The Platform for Interoperable WebRTC
 
D1-3-Signaling
D1-3-SignalingD1-3-Signaling
D1-3-Signaling
 
Ramu droid
Ramu droidRamu droid
Ramu droid
 
Kamailio & IMS
Kamailio & IMSKamailio & IMS
Kamailio & IMS
 
WebRTC Business Use Cases | WebRTC Conference & Expo III
WebRTC Business Use Cases  |  WebRTC Conference & Expo IIIWebRTC Business Use Cases  |  WebRTC Conference & Expo III
WebRTC Business Use Cases | WebRTC Conference & Expo III
 
WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016
 
DevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDKDevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDK
 
Ramu droid for swach bharat abhiyaan
Ramu droid for swach bharat abhiyaanRamu droid for swach bharat abhiyaan
Ramu droid for swach bharat abhiyaan
 
RCS vs OTT Messengers
RCS vs OTT MessengersRCS vs OTT Messengers
RCS vs OTT Messengers
 

Similaire à SIP over WebSockets Signaling Workshop

Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioReal-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioRick Copeland
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...APNIC
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...Aman Kohli
 
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTWebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTFrank Greco
 
20181215 introduction to graph databases
20181215   introduction to graph databases20181215   introduction to graph databases
20181215 introduction to graph databasesTimothy Findlay
 
The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016Frank Lyaruu
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketbrent bucci
 
nuclio Overview October 2017
nuclio Overview October 2017nuclio Overview October 2017
nuclio Overview October 2017iguazio
 
iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)Eran Duchan
 
ONOS SDN Controller - Introduction
ONOS SDN Controller - IntroductionONOS SDN Controller - Introduction
ONOS SDN Controller - IntroductionEueung Mulyana
 
Webservices
WebservicesWebservices
Webservicess4al_com
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortalJennifer Bourey
 
Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017Giacomo Vacca
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applicationsDevnology
 
Kamailio - Surfing Big Waves Of SIP With Style
Kamailio - Surfing Big Waves Of SIP With StyleKamailio - Surfing Big Waves Of SIP With Style
Kamailio - Surfing Big Waves Of SIP With StyleDaniel-Constantin Mierla
 

Similaire à SIP over WebSockets Signaling Workshop (20)

Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioReal-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.io
 
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on KamailioAstricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
 
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTWebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
 
20181215 introduction to graph databases
20181215   introduction to graph databases20181215   introduction to graph databases
20181215 introduction to graph databases
 
Camel as a_glue
Camel as a_glueCamel as a_glue
Camel as a_glue
 
The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket
 
nuclio Overview October 2017
nuclio Overview October 2017nuclio Overview October 2017
nuclio Overview October 2017
 
iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)
 
WebRTC Summit November 2013 - WebRTC Interoperability (and why it is important)
WebRTC Summit November 2013 - WebRTC Interoperability (and why it is important)WebRTC Summit November 2013 - WebRTC Interoperability (and why it is important)
WebRTC Summit November 2013 - WebRTC Interoperability (and why it is important)
 
ONOS SDN Controller - Introduction
ONOS SDN Controller - IntroductionONOS SDN Controller - Introduction
ONOS SDN Controller - Introduction
 
Webservices
WebservicesWebservices
Webservices
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortal
 
Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
Kamailio - Surfing Big Waves Of SIP With Style
Kamailio - Surfing Big Waves Of SIP With StyleKamailio - Surfing Big Waves Of SIP With Style
Kamailio - Surfing Big Waves Of SIP With Style
 

Plus de Crocodile WebRTC SDK and Cloud Signalling Network

Plus de Crocodile WebRTC SDK and Cloud Signalling Network (10)

DevCon5 (July 2014) - Intro to WebRTC
DevCon5 (July 2014) - Intro to WebRTCDevCon5 (July 2014) - Intro to WebRTC
DevCon5 (July 2014) - Intro to WebRTC
 
WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)
WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)
WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)
 
Asterisk World (January 2014) - Taking Enterprise Telephony into the Web World
Asterisk World (January 2014) - Taking Enterprise Telephony into the Web WorldAsterisk World (January 2014) - Taking Enterprise Telephony into the Web World
Asterisk World (January 2014) - Taking Enterprise Telephony into the Web World
 
DevCon 5 (December 2013) - WebRTC & WebSockets
DevCon 5 (December 2013) - WebRTC & WebSocketsDevCon 5 (December 2013) - WebRTC & WebSockets
DevCon 5 (December 2013) - WebRTC & WebSockets
 
DevCon 5 (July 2013) - WebSockets
DevCon 5 (July 2013) - WebSocketsDevCon 5 (July 2013) - WebSockets
DevCon 5 (July 2013) - WebSockets
 
VUC 24-May-2013 - Crocodile
VUC 24-May-2013 - CrocodileVUC 24-May-2013 - Crocodile
VUC 24-May-2013 - Crocodile
 
ITSPA May 2013 - WebRTC, TURN, and WebSocket
ITSPA May 2013 - WebRTC, TURN, and WebSocketITSPA May 2013 - WebRTC, TURN, and WebSocket
ITSPA May 2013 - WebRTC, TURN, and WebSocket
 
Kamailio World 2013 - SIP and MSRP over WebSocket
Kamailio World 2013 - SIP and MSRP over WebSocketKamailio World 2013 - SIP and MSRP over WebSocket
Kamailio World 2013 - SIP and MSRP over WebSocket
 
FOSDEM 2013 - SIP and MSRP over WebSocket in Kamailio
FOSDEM 2013 - SIP and MSRP over WebSocket in KamailioFOSDEM 2013 - SIP and MSRP over WebSocket in Kamailio
FOSDEM 2013 - SIP and MSRP over WebSocket in Kamailio
 
Crocodile RTC Launch (Google Campus) - 1: Introduction
Crocodile RTC Launch (Google Campus) - 1: IntroductionCrocodile RTC Launch (Google Campus) - 1: Introduction
Crocodile RTC Launch (Google Campus) - 1: Introduction
 

Dernier

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Dernier (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

SIP over WebSockets Signaling Workshop

  • 3. Speakers • Peter Dunkley – Technical Director – Crocodile RCS Ltd • Kevin Wiseman – Chief Architect – CafeX • Rod Apeldoorn – EasyRTC Server Lead – Priologic 3 11/19/2013
  • 4. Peter Dunkley Technical Director Crocodile RCS Ltd SIP OVER WEBSOCKETS 4 11/19/2013
  • 5. What is SIP over WebSockets • It is exactly the same SIP as SIP over TCP, SIP over TLS, and SIP over UDP – just over WebSockets instead • It can be secure by using Secure WebSockets • It is about to become an RFC – currently in the IETF editors queue • It is widely supported by many open-source projects 5 11/19/2013
  • 6. A quick comparison Standards Based SIP over WebSockets XMPP (BOSH/WebSockets) Open-source support High Medium Vendor tie-in prevention High Medium Ease of use High Medium Client performance Medium Medium Network performance High Medium Ease of interoperability High Medium Standalone applications High High Use existing media servers High Low Proprietary Low Low High* High* Medium* Low* High* Low * Dependent on the proprietary option chosen – could be made better or worse depending on what you chose! 6 11/19/2013
  • 7. Open source support and vendor tiein prevention • SIP over WebSockets – At least four well tested open-source Javascript client stacks – At least six well tested open-source server stacks • XMPP (BOSH/WebSockets) – At least two well tested open-source Javascript client stacks – At least three open-source server stacks • Proprietary – Many options (even open-source options) but all different and incompatible - many are vendor specific 7 11/19/2013
  • 8. Ease of use • SIP over WebSockets – It is not hard – you are not implementing the signalling yourself – Many client library choices with different APIs and complexities – Many SDK vendors working to make it even easier for you • XMPP (BOSH/WebSockets) – It is not hard – you are not implementing the signalling yourself – Limited client library choices mean that it is harder than it should be • Proprietary – Might well be very easy (but might not be) – it depends on your technology choices – No easier than SIP if you choose the right SIP client library 8 11/19/2013
  • 9. Client and network performance • SIP over WebSockets – Javascript client libraries can be large, but minification and app-cache use mitigate this almost completely – The network can have very high performance while making use of years of developments in real-time signalling and scaling • XMPP (BOSH/WebSockets) – Javascript client libraries can be large, but minification and app-cache use mitigate this almost completely – The network will be high performance as long as you do not require interoperability • Proprietary – The client library may be small (depending on your vendor choice) – The network may be high performance (depending on your vendor choice) as you do not require interoperability 9 11/19/2013
  • 10. Interoperable and standalone • The triangle vs the trapezoid • All options are equally suitable for use with the “triangle” • SIP over WebSockets is better for use with the “trapezoid” • Avoid gateways whenever you can (they add network cost and complexity) • Using SIP makes your application compatible with most existing media servers (commercial and open-source) 11/19/2013 10
  • 13. Use cases for SIP over WebSockets • SIP is well suited for anything requiring interoperability – Conferencing – do you really want to exclude the guy travelling who can’t get (or afford) a mobile data connection? – Online education – why shouldn’t I be able to listen to lectures through other routes? – Telemedicine – a huge boon for people living in remote areas (aren’t those the ones who struggle to get online?) – Call centres – can I afford to exclude customers who can’t use (or don’t want to use) WebRTC? Many of the applications that need to interoperate are high-value 11/19/2013 13
  • 14. Kamailio: WebSocket Handshake ... tcp_accept_no_cl=yes ... event_route[xhttp:request] { set_reply_close(); set_reply_no_connect(); if ($hdr(Upgrade)=~"websocket" && $hdr(Connection)=~"Upgrade" && $rm=~"GET") { # Validate as required (Host:, Origin:, Cookie:) if (ws_handle_handshake()) exit; } xhttp_reply("404", "Not Found", "", ""); } 14 11/19/2013
  • 15. Kamailio: Request Handling modparam(“nathelper|registrar”, “received_avp”, “$avp(RECEIVED)”) ... request_route { route(REQINIT); route(WSDETECT); ... route[WSDETECT] { if (proto == WS || proto == WSS) { force_rport(); if (is_method(“REGISTER”)) { fix_nated_register(); } else if (is_method(“INVITE|NOTIFY|SUBSCRIBE”)) { add_contact_alias(); } } } ... route[WITHINDLG] { if (has_totag()) { if (loose_route()) { if (!isdsturiset()) { handle_ruri_alias(); } ... 11/19/2013 15
  • 16. Kamailio: Response Handling onreply_route { if ((proto == WS || proto == WSS) && status =~ “[12][0-9][0-9]”) { add_contact_alias(); } } 16 11/19/2013
  • 17. Kamailio: RTP Profile Conversion (1) modparam(“rtpproxy-ng”, “rtpproxy_sock”, “udp:localhost:22223”) ... route[LOCATION] { ... t_on_failure(“UA_FAILURE”); } ... failure_route[UA_FAILURE] { if (t_check_status(“488”) && sdp_content()) { if (sdp_get_line_startswith(“$avp(mline)”, “m=”)) { if ($avp(mline) =~ “SAVPF”)) { $avp(rtpproxy_offer_flags) = “froc-sp”; $avp(rtpproxy_answer_flags) = “froc+SP”; } else { $avp(rtpproxy_offer_flags) = “froc+SP”; $avp(rtpproxy_answer_flags) = “froc-sp”; } # In a production system you probably need to catch # “RTP/SAVP” and “RTP/AVPF” and handle them correctly # too } append_branch(); rtpproxy_offer($avp(rtpproxy_offer_flags)); t_on_reply(“RTPPROXY_REPLY”); route(RELAY); } } ... 17 11/19/2013
  • 18. Kamailio: RTP Profile Conversion (2) modparam(“rtpproxy-ng”, “rtpproxy_sock”, “udp:localhost:22223”) ... failure_route[UA_FAILURE] { ... t_on_reply(“RTPPROXY_REPLY”); route(RELAY); } onreply_route[RTPPROXY_REPLY] { if (status =~ “18[03]”) { # mediaproxy-ng currently only supports SRTP/SDES – early media # won't work so strip it out now to avoid problems change_reply_status(180, “Ringing”); remove_body(); } else if (status =~ “2[0-9][0-9]” && sdp_content()) { rtpproxy_answer($avp(rtpproxy_answer_flags)); } } ... 18 11/19/2013
  • 19. Authentication (1) • You do not need accounts on the SIP network • You can federate with existing identity providers (Facebook, Google+, LinkedIn, Twitter, your own) • There is a Kamailio module designed for this (and implementing it elsewhere is easy) 19 11/19/2013
  • 20. Authentication (2) Web Service Calling UA OAuth2 Shared secret – communication link not required SIP Proxy You don’t have to create or manage accounts on the SIP Proxy/registrar Called UA 20 11/19/2013
  • 21. Kamailio: Authentication (1) ... tcp_accept_no_cl=yes ... modparam(“auth_ephemeral”, “secret”, “kamailio_rules”) ... modparam(“htable”, “htable”, “wsconn=>size=8;”) ... event_route[xhttp:request] { ... # URI format is /?username=foo&password=bar $var(uri_params) = $(hu{url.querystring}); $var(username) = $(var(uri_params){param.name,username,&}); $var(password) = $(var(uri_params){param.name,password,&}); # Note: username and password could also have been in a Cookie: header if (!autheph_authenticate(“$var(username)”, “$var(password)”)) { xhttp_reply(“403”, “Forbidden”, “”, “”); exit; } if (ws_handle_handshake()) { $sht(wsconn=>$si:$sp::username) = $var(username) exit; } ... event_route[websocket:closed] { $var(regex) = $si + “:” $sp + “.*”; sht_rm_name_re(“wsconn=>$var(regex)”); } 11/19/2013 21
  • 22. Kamailio: Authentication (2) ... request_route { route(REQINIT); route(WSDETECT); ... if (!(proto == WS || proto == WSS)) route(AUTH); ... route[WSDETECT] { if (proto == WS || proto == WSS) { $var(username) = (str) $sht(wsconn=>$si:$sp::username); if ($var(username) == $null || $var(username) == “”) { send_reply(“403”, “Forbidden”); ws_close(1008, “Policy Violation”); exit; } if (!autheph_check_timestamp(“$var(username)”) || (is_method(“REGISTER|PUBLISH”) && !autheph_check_to(“$var(username)”)) || (!has_totag() && !autheph_check_from(“$var(username)”))) { send_reply(“403”, “Forbidden”); ws_close(1008, “Policy Violation”); exit; } force_rport(); ... 11/19/2013 22
  • 24. Kevin Wiseman Chief Architect CaféX WHAT IS SIGNALLING 24 11/19/2013
  • 25. The Basics… • WebRTC Spec does not define the signalling – It leaves that open to the implementer • It does define the media descriptor exchange – Utilises the Session Description Protocol 25 11/19/2013
  • 26. What is signalling • Communications session control from one party to another party • Typically via some location service – E.g. SIP Registrar, social network, games service • Describes the requests and responses – Make call, end call, hold, resume, transfer etc – Ringing, answer, rejected, established etc • Mechanism for exchanging media description – SDP offer/answer exchange 11/19/2013 26
  • 27. Session Description Protocol • Used to negotiate media between parties – Media (audio, video), Ports, Codecs, ICE etc – offer/answer exchange • The good news: – Browser generates and consumes SDP offers & answers • The bad news: – WebRTC SDP places specific requirements on SDP that most existing telecom entities do not support 27 11/19/2013
  • 28. Signalling isn't the hard piece with WebRTC Media and media description are 28 11/19/2013
  • 29. Closed Systems • Real time coms within Games, Social Networks etc • No compelling reason to adopt any one approach over another – Already know who is who and how to communicate – No integration into existing telcoms system – Extend existing control channel for SDP offer/answer, or – Utilise 3rd party services to provide real time coms 29 11/19/2013
  • 30. WebRTC Gateway • • Proprietary signalling over HTTP or WebSocket between browser and gateway Gateway makes sense if: – The call scenarios you need to support are standard well defined UC features • Voice & video: Make call, answer call, end call, transfer call, N-way call • IM&P: Send message, receive message, set presence • Application Event Distribution – You want to embed UC features as part of a service – Your SIP infrastructure has limited support for ICE/STUN and Multiplexing RTP etc • Client SDK Browser JSON call control over WebSocket SRTP Fusion Web Gateway Fusion Media Broker De-ICEd, de-STUNned & de-multiplexed RTP SIP This is the use case we are seeing almost exclusively – Customers wanting to embed UC features as part of an overall service • CaféX Implementation SIP Network Challenges – Dependency on gateway exposing features 30 11/19/2013
  • 31. SIP over Websockets • SIP over web sockets makes sense if: – The call scenarios you need to support to the browser require all the features of SIP – You have developers that can make full use of SIP features on the browser – Your SIP end points already support ICE/STUN and Multiplexing RTP etc • Challenges – SIP stack/UA in the browser (dependency on large and complex JS in Browser) – SIP interworking with yet another 3rd party SIP stack – Security – opening up all the features (and potential security holes) of SIP to the public internet is dangerous – No benefit to most existing SIP systems – still have to add web sockets support, still have to add SDP and Media translation If Café X had used SIP over WebSockets JS SIP Stack JS SIP UA SIP over Websocket Browser RTP Fusion Web Gateway Fusion Media Broker De-ICEd, de-STUNned & de-multiplexed RTP SIP SIP Network 31 11/19/2013
  • 32. Web Dev & Signalling • Most Web Devs don’t know or even need to know the signalling protocol – Busy enough already • Web Devs expect a rich functional high level API – Efficiency & ease of use • Don’t want to reinvent the wheel every time they want to add RTC to a web app – If no API provided the first thing a web dev will do is write one and re-use next time they need to use the service 32 11/19/2013
  • 33. API Example – Initialisation <script src="https://<gateway_address>:<8080>/gateway/fusion-client-sdk.js"></script> //Get hold of the sessionID however your app needs to var sessionID = getMySessionID(); //Google provide a stun server which you can use or you can use your own. //Providing any empty array will result in no stun messages being sent. var stunServers=["stun.l.google.com:19302"]; //Set up initialization success callback before calling start UC.onInitialised = function() { //perform tasks associated with successful initialization such as registering listeners on UC objects }; //Set up initialization failure callback before calling start UC.onInitialisedFailed = function() { //perform tasks associated with initialization failure}; //Start my UC session using the Session ID and stun server list UC.start(sessionID, stunServers); 33 11/19/2013
  • 34. API Example – Media Streams window.webkitURL.createObjectURL.UC.phone.onRemoteMediaStream = function(remoteMediaStream) { //Configure the streams, this can be used to set up visibility of elements and //set the elements src to that of the remote stream, the remoteMediaStream must be //added to the page in order to receive audio or and video. video.src = window.webkitURL.createObjectURL(remoteMediaStream); }; UC.phone.onLocalMediaStream = function(localMediaStream) { //As with the remote media stream, you should add the localMediaStream to the page //in order to allow the framework to playback local (ie, webcam) feedback preview.src = window.webkitURL.createObjectURL(localMediaStream); }; 34 11/19/2013
  • 35. API Example – Make Call var call; //A method to call from the UI to make a call function makeCall(addressToCall) { //Create a call object from the framework and save it somewhere call = UC.phone.createCall(addressToCall); //Set what to do when the remote party ends the call call.onEnded = function() { alert("Call Ended"); }; //Set up what to do if the callee is busy, inform your user etc call.onBusy = function() { alert("The callee was busy"); }; //Dial the call call.dial(); }; //A method to call from the UI to end a current call function endCall() { call.end(); }; 35 11/19/2013
  • 36. Rod Apeldoorn EasyRTC Server Lead Priologic CUSTOM SIGNALING 36 11/19/2013
  • 37. Benefits Over SIP • Faster on the client side • Easier for developers to understand • Less restrictive 37 11/19/2013
  • 38. Example Custom Message Types (from EasyRTC) WebRTC Core • • • • candidate offer answer reject Application Level • authenticate • hangup • getIceConfig • roomJoin • roomData • setPresence • filesOffer • Many more… 38 11/19/2013
  • 39. Why Combine WebRTC Signaling with Application Servers? • • • • • Authentication Call logging Call control Combine with application logic Client connects to just one server – Why SIP + Presence + Application servers? • Will SIP Gateways offer JSON signaling? Yes! 39 11/19/2013
  • 40. Transports Websockets XHR Polling • • • • • AKA “HTTP Long Polling” • Easy + Securable • To use: Available in all modern browsers Fast + Responsive + Securable Maintains open socket Servers have to deal with concurrent socket limits – XMLHttpRequest API – jquery.ajax() • Used by Google AppRTC Demo 40 11/19/2013
  • 41. Transports JSONP + CORS Other • The original popular method for DHTML • Cross site scripting issues • “Cross-Origin Resource Sharing” can be setup • Still a valid fallback • XMPP (Jabber) – Especially for older browsers – Instant messengers • Local – Bluetooth – USB / Serial • WebRTC Data Channels – Example coming! 41 11/19/2013
  • 42. Cisco Jabber + EasyRTC • Cisco DX650 chat with Cisco or Non-Cisco web user • WebRTC Across Devices and Transports • Built using – Cisco Jabber SDK – EasyRTC Opensource 42 11/19/2013
  • 43. Using a Websocket Library General Benefits Why EasyRTC uses Socket.io • Cross browser support • Easy message sending • Easy event handling • Most popular for Node.js • Client API’s in many languages – Connect / Disconnect / Message • Fallbacks to XHR or JSONP – JavaScript / C++ / ObjC / Java … • Message Acknowledgments • Why recode what’s done well? 43 11/19/2013
  • 44. Private WebRTC Signaling 1. 2. 3. Connect users to servers via Websockets Establish DataChannels between users on same servers Establish WebRTC Peer Connection between User 1 and 3 – – – Signals sent via DataChannel User 2 acts as a relay Neither server aware of final connection 44 11/19/2013
  • 45. Private WebRTC Signaling 1. 2. 3. Connect users to servers via Websockets Establish DataChannels between users on same servers Establish WebRTC Peer Connection between User 1 and 3 – – – Signals sent via DataChannel User 2 acts as a relay Neither server aware of final connection 45 11/19/2013
  • 46. Private WebRTC Signaling 1. 2. 3. Connect users to servers via Websockets Establish DataChannels between users on same servers Establish WebRTC Peer Connection between User 1 and 3 – – – http://bit.ly/1iq6v8D Signals sent via DataChannel User 2 acts as a relay Neither server aware of final connection 46 11/19/2013