SIP and MSRP over WebSocket in
Kamailio

SIP and MSRP over WebSocket in Kamailio
Peter Dunkley, Technical Director, Crocodile RCS Ltd
But first...
ā—

Daniel-Constantin Mierla (@miconda) on what
is new in Kamailio
What is WebRTC?
ā—

WebRTC is about media
–

–

SDP

–

RTP/SAVPF

–

ICE

–
ā—

PeerConnection, GetUserMedia, MediaStreams,
and DataChannel

Codecs (G.711, OPUS, H.264 vs VP8)

It doesn't help with the signalling part of the
trapezoid/triangle
The Trapezoid/Triangle
What is WebSocket?
ā—
ā—

Safe, client-originated, connection to servers
Often used from web-browsers - but does not
have to be

ā—

It is an asynchronous protocol

ā—

Traffic from the client is masked

ā—

ā—

Although carried over TCP WebSocket is a
frame based protocol
RFC 6455, ā€œThe WebSocket Protocolā€
SIP over WebSocket
(draft-ietf-sipcore-sip-websocket)
ā—

Why use SIP?
–

It's the ā€œSession Initiation Protocolā€

–

Islands are good but you don't want to be marooned

–

Many regulatory issues already dealt with
ā—
ā—
ā—

–

Billing
CALEA/LI
Privacy

It's taken almost 10 years to sort out the SIP issues.
Why start from scratch and make the same
mistakes all over again?
SIP over WebSocket
(draft-ietf-sipcore-sip-websocket)
ā—

WebSocket has limitations
–

ā—

You can't know your local IP address

Use SIP Outbound (RFC 5626)
–

Sorts out NAT traversal issues

–

Separates Edge Proxy (client connection and
network protection) from Registrar and dynamic
routing logic

–

SIP Outbound uses GRUU (RFC 5627) to identify
User Agents and Path (RFC 3327) to enable clients
to use Registrars that are not their first-hop
SIP over WebSocket
(draft-ietf-sipcore-sip-websocket)
ā—

Open-source server implementations
–
–

ā—

Asterisk, Kamailio, OverSIP
Resiprocate (with Doubango patch)

Open-source client implementations
–

JAIN SIP JavaScript

–

JsSIP

–

QoffeeSIP

–

sipML5
MSRP over WebSocket
(draft-pd-dispatch-msrp-websocket)
ā—

Why use MSRP?
–

It's a natural companion to SIP

–

DataChannel can only be used with other WebRTC
end-points (unlike the MediaStream which is almost
compatible)

–

Can be used for IM, file transfer, or any other data
streaming you need
MSRP over WebSocket
(draft-pd-dispatch-msrp-websocket)
ā—

WebSocket limitations
–

ā—

Same as SIP

Use an MSRP Relay (RFC 4976)
–

Sorts out NAT traversal issues

–

Enables authorisation of traffic
MSRP over WebSocket
(draft-pd-dispatch-msrp-websocket)
ā—

Open-source server implementations
–

ā—

Kamailio

Open-source client implementations
–

Crocodile MSRP
Demo
Crocodile SDK Principles
ā—

ā—

ā—

ā—

Basic real-time communications should be
trivial
Web-developers shouldn't have to understand
real-time communications or SIP
Being easy for web-developers shouldn't mean
advanced things aren't possible
Being easy for web-developers shouldn't mean
interworking isn't possible
Crocodile SDK (simple example)
<html>
<scriptĀ src="http://www.example.com/jquery.crocsdk.js"></script>
<script>
$(document).ready(function(){
Ā Ā varĀ crocĀ =Ā $.croc({
Ā Ā Ā Ā apiKey:Ā "1dsku21#4598Ā­21wks8=",
Ā Ā });
Ā Ā varĀ sessionĀ =Ā croc.media.connect("sip:bob@example.com");
Ā Ā session.remoteAudioElementĀ =Ā $('#audio');
})
</script>
<body>
Ā Ā <audioĀ id="audio"Ā />
</body>
</html>
Crocodile SDK Components
ā—

JsSIP (Javascript stack)
–
–

ā—

Best-of-breed
Easily extendable (good object model)

Crocodile JsSIP extensions
–

Overridden JsSIP.Session

–

JSEP ICE Trickling

–

JSEP Session Rehydration
Crocodile SDK Components
ā—

Crocodile MSRP Client (Javascript stack)
–

Similar object model to JsSIP

–

Known to work with JsSIP (with JsSIP.Session
overridden)

ā—

Crocodile XCAP Client (Javascript stack)

ā—

Crocodile NAB Helper (Javascript stack)
–

Manages pres-rules and resource-list documents
stored in XCAP

–

Uses Crocodile XCAP Client
Crocodile SDK
Crocodile Network
ā—

Kamailio core
–
–

SIP Proxy/Registrar

–
ā—

SIP Outbound Edge Proxy (SIP over WebSocket)
MSRP Relay (MSRP over WebSocket)

Other open-source platforms used for
–

STUN/TURN servers

–

Accounting

–

Media gateway and server

–

XCAP server
Thank You
ā—

Any questions?

FOSDEM 2013 - SIP and MSRP over WebSocket in Kamailio

  • 1.
    SIP and MSRPover WebSocket in Kamailio SIP and MSRP over WebSocket in Kamailio Peter Dunkley, Technical Director, Crocodile RCS Ltd
  • 2.
    But first... ā— Daniel-Constantin Mierla(@miconda) on what is new in Kamailio
  • 3.
    What is WebRTC? ā— WebRTCis about media – – SDP – RTP/SAVPF – ICE – ā— PeerConnection, GetUserMedia, MediaStreams, and DataChannel Codecs (G.711, OPUS, H.264 vs VP8) It doesn't help with the signalling part of the trapezoid/triangle
  • 4.
  • 5.
    What is WebSocket? ā— ā— Safe,client-originated, connection to servers Often used from web-browsers - but does not have to be ā— It is an asynchronous protocol ā— Traffic from the client is masked ā— ā— Although carried over TCP WebSocket is a frame based protocol RFC 6455, ā€œThe WebSocket Protocolā€
  • 6.
    SIP over WebSocket (draft-ietf-sipcore-sip-websocket) ā— Whyuse SIP? – It's the ā€œSession Initiation Protocolā€ – Islands are good but you don't want to be marooned – Many regulatory issues already dealt with ā— ā— ā— – Billing CALEA/LI Privacy It's taken almost 10 years to sort out the SIP issues. Why start from scratch and make the same mistakes all over again?
  • 7.
    SIP over WebSocket (draft-ietf-sipcore-sip-websocket) ā— WebSockethas limitations – ā— You can't know your local IP address Use SIP Outbound (RFC 5626) – Sorts out NAT traversal issues – Separates Edge Proxy (client connection and network protection) from Registrar and dynamic routing logic – SIP Outbound uses GRUU (RFC 5627) to identify User Agents and Path (RFC 3327) to enable clients to use Registrars that are not their first-hop
  • 8.
    SIP over WebSocket (draft-ietf-sipcore-sip-websocket) ā— Open-sourceserver implementations – – ā— Asterisk, Kamailio, OverSIP Resiprocate (with Doubango patch) Open-source client implementations – JAIN SIP JavaScript – JsSIP – QoffeeSIP – sipML5
  • 9.
    MSRP over WebSocket (draft-pd-dispatch-msrp-websocket) ā— Whyuse MSRP? – It's a natural companion to SIP – DataChannel can only be used with other WebRTC end-points (unlike the MediaStream which is almost compatible) – Can be used for IM, file transfer, or any other data streaming you need
  • 10.
    MSRP over WebSocket (draft-pd-dispatch-msrp-websocket) ā— WebSocketlimitations – ā— Same as SIP Use an MSRP Relay (RFC 4976) – Sorts out NAT traversal issues – Enables authorisation of traffic
  • 11.
    MSRP over WebSocket (draft-pd-dispatch-msrp-websocket) ā— Open-sourceserver implementations – ā— Kamailio Open-source client implementations – Crocodile MSRP
  • 12.
  • 13.
    Crocodile SDK Principles ā— ā— ā— ā— Basicreal-time communications should be trivial Web-developers shouldn't have to understand real-time communications or SIP Being easy for web-developers shouldn't mean advanced things aren't possible Being easy for web-developers shouldn't mean interworking isn't possible
  • 14.
    Crocodile SDK (simpleexample) <html> <scriptĀ src="http://www.example.com/jquery.crocsdk.js"></script> <script> $(document).ready(function(){ Ā Ā varĀ crocĀ =Ā $.croc({ Ā Ā Ā Ā apiKey:Ā "1dsku21#4598Ā­21wks8=", Ā Ā }); Ā Ā varĀ sessionĀ =Ā croc.media.connect("sip:bob@example.com"); Ā Ā session.remoteAudioElementĀ =Ā $('#audio'); }) </script> <body> Ā Ā <audioĀ id="audio"Ā /> </body> </html>
  • 15.
    Crocodile SDK Components ā— JsSIP(Javascript stack) – – ā— Best-of-breed Easily extendable (good object model) Crocodile JsSIP extensions – Overridden JsSIP.Session – JSEP ICE Trickling – JSEP Session Rehydration
  • 16.
    Crocodile SDK Components ā— CrocodileMSRP Client (Javascript stack) – Similar object model to JsSIP – Known to work with JsSIP (with JsSIP.Session overridden) ā— Crocodile XCAP Client (Javascript stack) ā— Crocodile NAB Helper (Javascript stack) – Manages pres-rules and resource-list documents stored in XCAP – Uses Crocodile XCAP Client
  • 17.
  • 18.
    Crocodile Network ā— Kamailio core – – SIPProxy/Registrar – ā— SIP Outbound Edge Proxy (SIP over WebSocket) MSRP Relay (MSRP over WebSocket) Other open-source platforms used for – STUN/TURN servers – Accounting – Media gateway and server – XCAP server
  • 19.