DevEX - reference for building teams, processes, and platforms
FOSS Sthlm: Realtime Communication Update
1. FOSS STHLM
5 December 2012
REALTIME
COMMUNICATION
UPDATE
Olle E. Johansson * oej@edvina.net * Twitter oej
Copyright Edvina AB, Sollentuna, Sweden 2012. All rights reserved.
8. WebRTC
THE NEW KID
ON THE BLOCK
• Cooperation between the W3C and IETF
• Bidirectional media between browsers
• Audio, video, text
• The platform for new services
• SIP in the browser
9. WebRTC THE VISION
• An open service where we can communicate freely with each
other from any device and any network
• First wave probably just between users of the same web service
• Many of us wants open federation - it requires a shared address
space and protocol
10. WebRTC NEW APPLICATIONS
• WebRTC is so much more than personal communication
• Games, video manipulation, virtual reality...
• First wave:
• Skype replacements
• Video conferences
11. WebRTC DEPENDENCIES
• The architecture is still discussed
• Depends on ICE for NAT traversal, which means dependencies
on TURN/STUN as well
• SDP or not SDP, that’s the question?
• Opus and G711 for audio
• VP8 or H.264 for video *** WARS ***
12. WebRTC WEBRTC
• Platform for new cool • We’ll still have NAT
applications and firewall issues
• Built into the web • Will it be standardized
browser enough
• Security-enabled from • Will we need SBCs to
start handle the connections?
+ -
14. A SIP PBX
PBX
You Me
Everyone talks with the PBX!
15. A SIP PROXY
We find each other with
the proxy.
SIP
You Me
Communication is peer2peer
16. FINDING YOU
DNS
SIP
You Me
Communication is peer2peer sip:alice@example.com
17. THE PROXY
SIP SIP SIP SIP SIP SIP
Proxy
Outbound proxy
Location server/registrar
Presence server
Call routing (LCR)
Application server
18. KAMAILIO
Open Source SIP Proxy
SIP Server Application server
Presence server
A lot of activity!
19. THE KAMAILIO PROJECT
• Project leader:
Daniel Constatin Mierla (Asipto)
• Management board with community members
• Many developers, active community
• Renamed to Kamailio in 2008
• Merged with the original
Sip Express Router for version 3 in 2008
20. KAMAILIO TECHNOLOGY
• Written in ANSI C and optimized for speed
• Modular design
• Flexible configuration and routing language
• Supports MySQL, PostgreSQL, LDAP, RADIUS, Sqlite , radius, UnixODBC
• Standard (RFC3261) compliant
• Web based administration interface: SIREMIS
• Management port (TCP, UDP, XML)
• Embedded HTTP server for Xcap (Presence)
• Python, Perl, LUA development interfaces
• NAT traversal capable
• Portable, runs on POSIX compliant systems
21. KAMAILIO PHILOSOPHY
• Over 100 modules - build anything!
• Many modules overlap
• Especially in carrier-business-related stuff, like least cost routing
• As long as we have maintainers, we’re fine with that.
23. KAMAILIO DEVELOPMENT
MODEL
• Development base code is named ”SIP-router”
• Licensed under GPL. Contributions may be under BSD.
• Currently about 20 developers
• Anyone can freely contribute extensions and modules
• Changes to existing modules are subject to approval
Kamailo releases SER releases Tekelec products
SIP-router.org
24. OVERVIEW OF
KAMAILIO
SER and OpenSER and Kamailio and...
What’s in a name?
KAMAILIO
THE OPENSER SIP SERVER & THE SIP ROUTER PROJECT
25. REMEMBER
• A SIP proxy is not a PBX
• Anything you learned from Asterisk or similar PBXs does not
apply
• The SIP Proxy does not bother with CALLS, it bothers with SIP
requests and replies - transactions
• You need to understand SIP to configure Kamailio
The PBX is an
Old telco architecture
26. KAMAILIO FUNCTIONALITY
SIP proxy
• It is a SIP server originally designed as a SIP proxy
Presence
server • Can be configured as an
• SIP Outbound Proxy
SIP load
• Location server/registrar
SIP application and Presence server
•
server • Development API for SIP servlets and UserAgent functionality
• LUA interface for advanced functionality
SIP Session Border
Controller • Runs on many operating systems
27. ADDITIONAL FEATURES
• IPv4-IPv6 gateway
IPv4/IPv6 • UDP/TCP/SCTP translator
UDP/TCP/SCTP • NAT traversal support
TLS
NAT • anti-DOS functions (pike, blacklists)
Languages: • Gateway to SMS, XMPP (Jabber)
Java, Python, Lua, Perl
Databases: • Accounting
Mysql
PostgreSQL • Java SIP servlet programming interface
UnixODBC • Interface to LUA and Perl (3.1)
Berkeley DB
Oracle • Database support MySQL, PostgreSQL, UnixODBC, Berkeley DB and Oracle
• ...much more
28. A MODULAR ARCHITECTURE
Core provides
Transport managements
Memory management
SIP Server core Module interface
Shared memory
Locking
Configuration
Modules Modules Modules Modules
Modules provide
Script functions
Module parameters
Special variables
NAT
MySQL Radius TM Management functions
Support
29. ADDITIONAL HELPERS
Management interface (MI) functions
Start/stop
KAMCTL Shared variables
Statistics
Database installation helper
KAMDBCTL
RPC Interface and MI functions
Statistics
SERCMD Select/Config variables
(Arrived from SER)
Web application
Statistics
SIREMIS Database management
Separate project
30. ARCHITECTURE
Modules
Module interface
Proxy Core
Transport interface
Operating system
31. KAMAILIO IS THE HEART OF YOUR SIP NETWORK
Admin PSTN RTP Feature 3rd IM/SMS
(WEB) DB gw
gw relay server party
Internal network
Kamailio
Public network
Users
34. MEMORY HANDLING
Unix memory
PKG - Kamailio memory manager manager
Allocated at start.
Shared memory Per process memory
(core)
32 MB per Kamailio 4 MB per process
Transactions SIP message
Shared variables Script variables
35. ABOUT KEEPING STATE:
Stateless forwarding • Kamailio keeps transaction,
and responses user and location data in
shared memory (RAM) at
Transaction states runtime
• Some of this can be cached to
Dialog - ”call” - states database, but in-memory is the
default
• This statelessness delivers
scalability and resilience in the
network
36. GENERAL ADVICE:
• Try to keep proxy processing as simple as possible
• Be very careful on where you add states
• In larger networks, separate
• Ingress/Egress proxys (Session Border Controllers)
• Registrar/location server
• Core proxy
Compare with
Feature proxy
•
IP routers!
38. SMALL CARRIER
SER
Registrar/Location server
Asterisk
SER SER PSTN Gateway
Session Border Asterisk
Core proxy
controller
Voicemail Server
Asterisk
Feature/IVR Server
39. UNIVERSITY IP TRANSITION
Asterisk
Asterisk
PBX
Media gateway ISDN
.com SER
Old PBX
Session Border
Core proxy
controller
40. FAILOVER
Asterisk
SER
PBX
SER
Asterisk
PBX backup
Core proxy
41. MULTI-FEATURE SERVICE
Audio
Asterisk
SER
IVR, Queues, prompts
Video
SER
Core proxy Chat
Presence
Telephony
43. KAMAILIO 3.4 WITH
SIP OVER WEBSOCKETS
WS
Javascript SIP
app
sip/tcp
sip/websockets
Media over SRTP
Me
WWWyou
44. KAMAILIO AND ASTERISK WITH
SIP OVER WEBSOCKETS
WS
Javascript SIP AST
SIP app
sip/websockets
RTP
Media over SRTP
Me
WWWyou
45. JSSIP: OPEN SOURCE SIPSTACK
IN JAVASCRIPT
• Available for download at jssip.net
• Written by the authors of the IETF draft on SIP over websockets
• Reference implementation
• MIT license
46. COMPONENTS NEEDED
• SIP over WS servers: Kamailio, OverSIP, Asterisk
• Audio media server RTP gateway: Asterisk
• SIP/Javascript: SIPml5, JSSIP