SlideShare a Scribd company logo
A QUICK INTRODUCTION
TO KAMAILIO
Olle E. Johansson * oej@edvina.net * Twitter oej
Copyright Edvina AB, Sollentuna, Sweden 2013-205 .All rights reserved.V4.2
FIRST:
What is a proxy compared with a PBX?
A SIP PBX
You Me
PBX
Everyone talks with the PBX!
This is called a SIP b2bua
A SIP PROXY
You Me
SIP
We find each other using

the proxy.
Multimedia Communication is
peer2peer
Media
FINDINGYOU
You Me
SIP
DNS is used, like e-mail.
DNS
sip:alice@example.com
THE PROXY ANDTHE PBX
WORKS WELLTOGETHER.
You
Me
PBX
SIP
Services like	

IVR	

Conference
THE PROXY HAS MANY ROLES
SIP SIP SIP SIP
Proxy
Outbound proxy
Location server/registrar
Presence server
Call routing (LCR)
SIP
Application server
SIP
WHAT DOESN’T IT DO?
GW HOLD CONF REC
Gateway

to other protocols
Mix calls in a conference
Put calls on hold
Record

calls
Listen to DTMF
IVR
Handle media
RTP
INTRODUCING KAMAILIO
KAMAILIO
Open Source
SIP Server
Presence server
SIP Proxy
Application server
A lot of activity!
WebSocket SIP
server
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
kamailio.org
KAMAILIOTECHNOLOGY
• 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
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.
KAMAILIO EVOLUTION
From http://sip-router.org/wiki/history/ser-9-years
Notice 

That we merged!
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
SIP-router.org
Kamailo releases SER releases Tekelec products
WHERETO GET IT?
Linux packages

http://www.kamailio.org/wiki/
packages/rpms
FreeBSD/OpenBSD

Ports
Source code

www.kamailio.org Just download and run!
KAMAILIO FUNCTIONALITY
• It is a SIP server originally designed as a SIP proxy
• Can be configured as an
• SIP Outbound Proxy
• Location server/registrar
• Presence server
• Application server
• …and much more
• Development API for SIP servlets and UserAgent
functionality
• LUA, Java, Python module integration for
advanced functionality
• Runs on many operating systems
SIP proxy
Presence

server
SIP application

server
SIP load

balancer
SIP Session Border
Controller
ADDITIONAL FEATURES
• IPv4-IPv6 gateway
• UDP/TCP/SCTP/WS translator
• NAT traversal support
• anti-DOS functions (pike, blacklists)
• Gateway to SMS, XMPP (Jabber)
• Accounting
• Interface to LUA, Python, Mono/C# and Perl
• Database support MongoDB, Redis, Radius,
MySQL, PostgreSQL, UnixODBC, Berkeley DB
and Oracle
• ...much more
IPv4/IPv6

UDP/TCP/SCTP/WS

TLS	

NAT	

!
Languages:
Java, Python, Lua, Perl,
Mono, C#	

!
Databases:
Mysql	

PostgreSQL	

UnixODBC	

Berkeley DB	

Oracle

Redis, MongoDB

Cassandra
A MODULAR ARCHITECTURE
SIP Server core
Modules Modules Modules Modules
MySQL Radius TM
NAT

Support
Core provides	

Transport managements	

Memory management	

Module interface	

Shared memory	

Locking	

Configuration
Modules provide	

Script functions	

Module parameters	

Special variables	

Management functions
ADDITIONAL HELPERS
KAMCTL
KAMDBCTL
KAMCMD
SIREMIS
Management interface (MI) functions	

Start/stop	

Shared variables	

Statistics	

Database installation helper	

!
RPC Interface and MI functions	

Statistics	

Select/Config variables	

(Arrived from SER)	

!
Web application	

Statistics	

Database management	

Separate project	

!
KAMAILIO ISTHE HEART OFYOUR SIP NETWORK
Kamailio
RTP
relay
PSTN

gw
DB
Admin

(WEB)
Feature
server
3rd 

party
IM/SMS

gw
Internal network
Public network
Users
MULTIPROCESS, NOTTHREADS
UDP listen
TCP listen
TCP/TLS listen
STCP listen
Other worker processes
MANAGEMENT
RPC interface
XMLrpc Json Pipe
MI

(deprecated)
KAMCMD KAMCTL
Unix command line
applications
MEMORY HANDLING
PKG - Kamailio memory manager
Unix memory
manager
Shared memory

(core)
Per process memory
4 MB per process64 MB per Kamailio
Allocated at start.
Transactions SIP message
Shared variables Script variables
ABOUT KEEPING STATE:
• Kamailio keeps transaction, user
and location data in shared
memory (RAM) at runtime	

• Some of this can be cached to
database, but in-memory is the
default	

• This statelessness delivers
scalability and resilience in the
network
Stateless forwarding

and responses
Transaction states
Dialog - ”call” - states
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	

• Feature proxy
Compare with

IP routers!
CONFIGURATION
KAMAILIO IS ATOOLBOX
• Kamailio is not a ready-made
application like Asterisk or
FreeSwitch	

• There is a very powerful
configuration language where you
configure handling of individual SIP
Messages	

• You need understanding of the SIP
protocol to build your application
Load balancer
SBC
Trunk server
PBX
$avp(rtype)
if($rm ==
”INVITE”) {}
route(”NAT”);
t_relay();
THE KAMAILIO SCRIPTS
• C-like language	

• IF/THEN,WHILE constructs	

• Variables with different scopes (global, local,
transactions)	

• Hash tables, database integration, memcached
and much more	

• Loading a new module extends functionality,
like in Asterisk or Apache
?
WHERE’STHE DIAL PLAN?
• Kamailio routes SIP messages, not calls	

• There are many ways to route calls (consisting of at least an
INVITE and a BYE message)	

• There is a module called “DIALPLAN” that can simplify building a
pbx-like call routing engine	

• Remember, Kamailio does not handle media. Companion products
like RTPengine, RTPproxy, Asterisk and FreeSwitch handles media.
??
SOLUTIONS WITH KAMAILIO
SMALL CARRIER
SIP
Kamailio

Session Border

controller
SIP
Kamailio

Core proxy
SIP
Kamailio Registrar/Location server
Asterisk
PSTN Gateway
Asterisk
Voicemail Server
Asterisk
Feature/IVR Server
UNIVERSITY IPTRANSITION
.com
Session Border

controller

(commercial product)
SIP
Kamailio

Core proxy
Asterisk
PBX
Asterisk
Old PBX
Media gateway ISDN
FAILOVER
SIP
Core Kamailio

proxys
FreeSwitch
PBX
FreeSwitch
PBX backup
SIP
MULTI-FEATURE SERVICE
SIP
Asterisk
IVR, Queues, prompts
SIP
Audio
Video
Chat
Presence
Telephony
Core Kamailio

proxys
WHAT ABOUT WEBRTC?
KAMAILIO 4 COMES WITH
SIP OVER WEBSOCKETS
WWWyou
Me
SIP
WS
sip/websockets
sip/tcp
Javascript

app
Media over SRTP
KAMAILIO AND ASTERISK WITH
SIP OVER WEBSOCKETS
WWWyou
Me
SIP
WS
sip/websockets
Javascript

SIP app
Media over SRTP
AST
RTP
JSSIP: OPEN SOURCE SIPSTACK
IN JAVASCRIPT
• Available for download at jssip.net	

• Written by the authors of IETF RFC 7118 on SIP over
websockets	

• Reference implementation	

• MIT license
COMPONENTS NEEDED
• SIP over WS servers: Kamailio, OverSIP, Asterisk, FreeSwitch	

• Audio media server RTP gateway: Asterisk, FreeSwitch,
RTPengine	

• SIP/Javascript: SIPml5, JSSIP
EDVINATRAINING CLASSES
• Kamailio from start	

• The SIP Protocol	

• RTP, RTCP and QoS	

• SIP Security	

• Scalability	

• Many Kamailio labs
CUSTOM

INHOUSE

TRAININGS
• SIP,Asterisk, Kamailio
and much more	

• Done at your site,
customized for your
project	

• Cost effective when
more than four
students	

Find more details at http://edvina.net
• Advanced Kamailio	

• SIP trunking	

• NAT handling	

• WebRTC/SIP	

• Testing, debugging	

• Scalability	

• Many Kamailio labs
THAT’S ALL FOLKS.
Twitter @kamailioproject	

!
Like us on Facebook too!
Download on www.kamailio.org

More Related Content

PDF
rtpengine - Media Relaying and Beyond
PDF
Kamailio - API Based SIP Routing
PDF
rtpengine and kamailio - or how to simulate calls at scale
ODP
Expanding Asterisk with Kamailio
ODP
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
PDF
Scaling Asterisk with Kamailio
PDF
Kamailio, FreeSWITCH, and You
PDF
SIP Attack Handling (Kamailio World 2021)
rtpengine - Media Relaying and Beyond
Kamailio - API Based SIP Routing
rtpengine and kamailio - or how to simulate calls at scale
Expanding Asterisk with Kamailio
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Scaling Asterisk with Kamailio
Kamailio, FreeSWITCH, and You
SIP Attack Handling (Kamailio World 2021)

What's hot (20)

PDF
Kamailio - SIP Routing in Lua
PDF
Kamailio - Secure Communication
PDF
Using Kamailio for Scalability and Security
PDF
Sipwise rtpengine
PDF
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
PDF
Getting a live_transcript_of_your_call_using_the_ari
PDF
Asterisk High Availability Design Guide
PPTX
Introduction to Kamailio (TADSummit 2020 Asia)
PPTX
Using ARI and AGI to Connect Asterisk Instances
PDF
Kamailio - Load Balancing Load Balancers
PDF
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
PPTX
Kill Your IVR with a Voicebot (ClueCon 2019)
PDF
An SFU/MCU integration for heterogeneous environments
PDF
簡介 Linux 的 Network Namespace 功能
PDF
Asterisk sip channel performance
PDF
AstriCon 2017 - Docker Swarm & Asterisk
PDF
Why is Kamailio so different? An introduction.
PDF
SIPREC RTPEngine Media Forking
PDF
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
PDF
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Kamailio - SIP Routing in Lua
Kamailio - Secure Communication
Using Kamailio for Scalability and Security
Sipwise rtpengine
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Getting a live_transcript_of_your_call_using_the_ari
Asterisk High Availability Design Guide
Introduction to Kamailio (TADSummit 2020 Asia)
Using ARI and AGI to Connect Asterisk Instances
Kamailio - Load Balancing Load Balancers
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Kill Your IVR with a Voicebot (ClueCon 2019)
An SFU/MCU integration for heterogeneous environments
簡介 Linux 的 Network Namespace 功能
Asterisk sip channel performance
AstriCon 2017 - Docker Swarm & Asterisk
Why is Kamailio so different? An introduction.
SIPREC RTPEngine Media Forking
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
Ad

Similar to Kamailio :: A Quick Introduction (20)

PDF
FOSS Sthlm: Realtime Communication Update
POT
SIP servers on embedded systems: Powering SoHo communications
PPT
Astricon 2010: Scaling Asterisk installations
PDF
Uip Sip Implementation Best Practices060409
PDF
SIP Router Project
PPT
Vo ip sip
PPTX
FutureComm 2010: SIP Server Applications on Embedded Platforms
PDF
Kamailio - Unifying SIP and Web Worlds with Lua
PPTX
Sangoma SBC Training Presentation
PDF
The ssca® sip training program course outline
PPT
Introduction to IP Telephony
PPTX
Introduction into SIP protocol
PPT
SIP info
PDF
Kamailio - The Story for Asterisk
PDF
ITSPA May 2013 - WebRTC, TURN, and WebSocket
ODP
FOSDEM 2013 - SIP and MSRP over WebSocket in Kamailio
PDF
AN OVERVIEW OF VOICE OVER INTERNET PROTOCOL (VOIP
PDF
Modern VoIP in modern infrastructures
PDF
Solo Telco Gateway
PPT
1 Vo Ip Overview
FOSS Sthlm: Realtime Communication Update
SIP servers on embedded systems: Powering SoHo communications
Astricon 2010: Scaling Asterisk installations
Uip Sip Implementation Best Practices060409
SIP Router Project
Vo ip sip
FutureComm 2010: SIP Server Applications on Embedded Platforms
Kamailio - Unifying SIP and Web Worlds with Lua
Sangoma SBC Training Presentation
The ssca® sip training program course outline
Introduction to IP Telephony
Introduction into SIP protocol
SIP info
Kamailio - The Story for Asterisk
ITSPA May 2013 - WebRTC, TURN, and WebSocket
FOSDEM 2013 - SIP and MSRP over WebSocket in Kamailio
AN OVERVIEW OF VOICE OVER INTERNET PROTOCOL (VOIP
Modern VoIP in modern infrastructures
Solo Telco Gateway
1 Vo Ip Overview
Ad

More from Olle E Johansson (20)

PDF
Cybernode.se: Securing the software supply chain (CRA)
PDF
CRA - overview of vulnerability handling
PDF
Introduction to the proposed EU cyber resilience act (CRA)
PDF
The birth and death of PSTN
PDF
WebRTC and Janus intro for FOSS Stockholm January 2019
PDF
Kamailio World 2018: Having fun with new stuff
PDF
Kamailio on air
PDF
Webrtc overview
PDF
Realtime communication over a dual stack network
PDF
The Realtime Story - part 2
PDF
Sip2016 - a talk at VOIP2DAY 2016
PDF
Sips must die, die, die - about TLS usage in the SIP protocol
PDF
SIP :: Half outbound (random notes)
PDF
Kamailio World 2016: Update your SIP!
PDF
SIP & TLS - Security in a peer to peer world
PDF
Tio tester av TLS - Transport Layer Security (TLS-O-MATIC.COM)
PDF
2015 update: SIP and IPv6 issues - staying Happy in SIP
PDF
TCP/IP Geeks Stockholm :: Introduction to IPv6
PDF
RFC 7435 - Opportunistic security - Some protection most of the time
PDF
SIP and DNS - federation, failover, load balancing and more
Cybernode.se: Securing the software supply chain (CRA)
CRA - overview of vulnerability handling
Introduction to the proposed EU cyber resilience act (CRA)
The birth and death of PSTN
WebRTC and Janus intro for FOSS Stockholm January 2019
Kamailio World 2018: Having fun with new stuff
Kamailio on air
Webrtc overview
Realtime communication over a dual stack network
The Realtime Story - part 2
Sip2016 - a talk at VOIP2DAY 2016
Sips must die, die, die - about TLS usage in the SIP protocol
SIP :: Half outbound (random notes)
Kamailio World 2016: Update your SIP!
SIP & TLS - Security in a peer to peer world
Tio tester av TLS - Transport Layer Security (TLS-O-MATIC.COM)
2015 update: SIP and IPv6 issues - staying Happy in SIP
TCP/IP Geeks Stockholm :: Introduction to IPv6
RFC 7435 - Opportunistic security - Some protection most of the time
SIP and DNS - federation, failover, load balancing and more

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
1. Introduction to Computer Programming.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
OMC Textile Division Presentation 2021.pptx
Machine learning based COVID-19 study performance prediction
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence
Mobile App Security Testing_ A Comprehensive Guide.pdf
Programs and apps: productivity, graphics, security and other tools
MIND Revenue Release Quarter 2 2025 Press Release
Advanced methodologies resolving dimensionality complications for autism neur...
SOPHOS-XG Firewall Administrator PPT.pptx
Encapsulation_ Review paper, used for researhc scholars
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
1. Introduction to Computer Programming.pptx
A comparative analysis of optical character recognition models for extracting...
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
cloud_computing_Infrastucture_as_cloud_p
Diabetes mellitus diagnosis method based random forest with bat algorithm
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Kamailio :: A Quick Introduction

  • 1. A QUICK INTRODUCTION TO KAMAILIO Olle E. Johansson * oej@edvina.net * Twitter oej Copyright Edvina AB, Sollentuna, Sweden 2013-205 .All rights reserved.V4.2
  • 2. FIRST: What is a proxy compared with a PBX?
  • 3. A SIP PBX You Me PBX Everyone talks with the PBX! This is called a SIP b2bua
  • 4. A SIP PROXY You Me SIP We find each other using
 the proxy. Multimedia Communication is peer2peer Media
  • 5. FINDINGYOU You Me SIP DNS is used, like e-mail. DNS sip:alice@example.com
  • 6. THE PROXY ANDTHE PBX WORKS WELLTOGETHER. You Me PBX SIP Services like IVR Conference
  • 7. THE PROXY HAS MANY ROLES SIP SIP SIP SIP Proxy Outbound proxy Location server/registrar Presence server Call routing (LCR) SIP Application server SIP
  • 8. WHAT DOESN’T IT DO? GW HOLD CONF REC Gateway
 to other protocols Mix calls in a conference Put calls on hold Record
 calls Listen to DTMF IVR Handle media RTP
  • 10. KAMAILIO Open Source SIP Server Presence server SIP Proxy Application server A lot of activity! WebSocket SIP server
  • 11. 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 kamailio.org
  • 12. KAMAILIOTECHNOLOGY • 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
  • 13. 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.
  • 15. 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 SIP-router.org Kamailo releases SER releases Tekelec products
  • 16. WHERETO GET IT? Linux packages
 http://www.kamailio.org/wiki/ packages/rpms FreeBSD/OpenBSD
 Ports Source code
 www.kamailio.org Just download and run!
  • 17. KAMAILIO FUNCTIONALITY • It is a SIP server originally designed as a SIP proxy • Can be configured as an • SIP Outbound Proxy • Location server/registrar • Presence server • Application server • …and much more • Development API for SIP servlets and UserAgent functionality • LUA, Java, Python module integration for advanced functionality • Runs on many operating systems SIP proxy Presence
 server SIP application
 server SIP load
 balancer SIP Session Border Controller
  • 18. ADDITIONAL FEATURES • IPv4-IPv6 gateway • UDP/TCP/SCTP/WS translator • NAT traversal support • anti-DOS functions (pike, blacklists) • Gateway to SMS, XMPP (Jabber) • Accounting • Interface to LUA, Python, Mono/C# and Perl • Database support MongoDB, Redis, Radius, MySQL, PostgreSQL, UnixODBC, Berkeley DB and Oracle • ...much more IPv4/IPv6
 UDP/TCP/SCTP/WS
 TLS NAT ! Languages: Java, Python, Lua, Perl, Mono, C# ! Databases: Mysql PostgreSQL UnixODBC Berkeley DB Oracle
 Redis, MongoDB
 Cassandra
  • 19. A MODULAR ARCHITECTURE SIP Server core Modules Modules Modules Modules MySQL Radius TM NAT
 Support Core provides Transport managements Memory management Module interface Shared memory Locking Configuration Modules provide Script functions Module parameters Special variables Management functions
  • 20. ADDITIONAL HELPERS KAMCTL KAMDBCTL KAMCMD SIREMIS Management interface (MI) functions Start/stop Shared variables Statistics Database installation helper ! RPC Interface and MI functions Statistics Select/Config variables (Arrived from SER) ! Web application Statistics Database management Separate project !
  • 21. KAMAILIO ISTHE HEART OFYOUR SIP NETWORK Kamailio RTP relay PSTN
 gw DB Admin
 (WEB) Feature server 3rd 
 party IM/SMS
 gw Internal network Public network Users
  • 22. MULTIPROCESS, NOTTHREADS UDP listen TCP listen TCP/TLS listen STCP listen Other worker processes
  • 23. MANAGEMENT RPC interface XMLrpc Json Pipe MI
 (deprecated) KAMCMD KAMCTL Unix command line applications
  • 24. MEMORY HANDLING PKG - Kamailio memory manager Unix memory manager Shared memory
 (core) Per process memory 4 MB per process64 MB per Kamailio Allocated at start. Transactions SIP message Shared variables Script variables
  • 25. ABOUT KEEPING STATE: • Kamailio keeps transaction, user and location data in shared memory (RAM) at runtime • Some of this can be cached to database, but in-memory is the default • This statelessness delivers scalability and resilience in the network Stateless forwarding
 and responses Transaction states Dialog - ”call” - states
  • 26. 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 • Feature proxy Compare with
 IP routers!
  • 28. KAMAILIO IS ATOOLBOX • Kamailio is not a ready-made application like Asterisk or FreeSwitch • There is a very powerful configuration language where you configure handling of individual SIP Messages • You need understanding of the SIP protocol to build your application Load balancer SBC Trunk server PBX
  • 29. $avp(rtype) if($rm == ”INVITE”) {} route(”NAT”); t_relay(); THE KAMAILIO SCRIPTS • C-like language • IF/THEN,WHILE constructs • Variables with different scopes (global, local, transactions) • Hash tables, database integration, memcached and much more • Loading a new module extends functionality, like in Asterisk or Apache
  • 30. ? WHERE’STHE DIAL PLAN? • Kamailio routes SIP messages, not calls • There are many ways to route calls (consisting of at least an INVITE and a BYE message) • There is a module called “DIALPLAN” that can simplify building a pbx-like call routing engine • Remember, Kamailio does not handle media. Companion products like RTPengine, RTPproxy, Asterisk and FreeSwitch handles media. ??
  • 32. SMALL CARRIER SIP Kamailio
 Session Border
 controller SIP Kamailio
 Core proxy SIP Kamailio Registrar/Location server Asterisk PSTN Gateway Asterisk Voicemail Server Asterisk Feature/IVR Server
  • 33. UNIVERSITY IPTRANSITION .com Session Border
 controller
 (commercial product) SIP Kamailio
 Core proxy Asterisk PBX Asterisk Old PBX Media gateway ISDN
  • 35. MULTI-FEATURE SERVICE SIP Asterisk IVR, Queues, prompts SIP Audio Video Chat Presence Telephony Core Kamailio
 proxys
  • 37. KAMAILIO 4 COMES WITH SIP OVER WEBSOCKETS WWWyou Me SIP WS sip/websockets sip/tcp Javascript
 app Media over SRTP
  • 38. KAMAILIO AND ASTERISK WITH SIP OVER WEBSOCKETS WWWyou Me SIP WS sip/websockets Javascript
 SIP app Media over SRTP AST RTP
  • 39. JSSIP: OPEN SOURCE SIPSTACK IN JAVASCRIPT • Available for download at jssip.net • Written by the authors of IETF RFC 7118 on SIP over websockets • Reference implementation • MIT license
  • 40. COMPONENTS NEEDED • SIP over WS servers: Kamailio, OverSIP, Asterisk, FreeSwitch • Audio media server RTP gateway: Asterisk, FreeSwitch, RTPengine • SIP/Javascript: SIPml5, JSSIP
  • 41. EDVINATRAINING CLASSES • Kamailio from start • The SIP Protocol • RTP, RTCP and QoS • SIP Security • Scalability • Many Kamailio labs CUSTOM
 INHOUSE
 TRAININGS • SIP,Asterisk, Kamailio and much more • Done at your site, customized for your project • Cost effective when more than four students Find more details at http://edvina.net • Advanced Kamailio • SIP trunking • NAT handling • WebRTC/SIP • Testing, debugging • Scalability • Many Kamailio labs
  • 42. THAT’S ALL FOLKS. Twitter @kamailioproject ! Like us on Facebook too! Download on www.kamailio.org