Kamailio :: A Quick Introduction

39.657 visualizaciones

Publicado el

Kamailio is the leading Open Source SIP Server - a SIP proxy, registrar, location server, presence server, IMS server and much more. Find out more by viewing this quick presentation! (Updated June 2014)

Publicado en: Tecnología
3 comentarios
57 recomendaciones
Estadísticas
Notas
Sin descargas
Visualizaciones
Visualizaciones totales
39.657
En SlideShare
0
De insertados
0
Número de insertados
12.481
Acciones
Compartido
0
Descargas
0
Comentarios
3
Recomendaciones
57
Insertados 0
No insertados

No hay notas en la diapositiva.

Kamailio :: A Quick Introduction

  1. 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. 2. FIRST: What is a proxy compared with a PBX?
  3. 3. A SIP PBX You Me PBX Everyone talks with the PBX! This is called a SIP b2bua
  4. 4. A SIP PROXY You Me SIP We find each other using
 the proxy. Multimedia Communication is peer2peer Media
  5. 5. FINDINGYOU You Me SIP DNS is used, like e-mail. DNS sip:alice@example.com
  6. 6. THE PROXY ANDTHE PBX WORKS WELLTOGETHER. You Me PBX SIP Services like IVR Conference
  7. 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. 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
  9. 9. INTRODUCING KAMAILIO
  10. 10. KAMAILIO Open Source SIP Server Presence server SIP Proxy Application server A lot of activity! WebSocket SIP server
  11. 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. 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. 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.
  14. 14. KAMAILIO EVOLUTION From http://sip-router.org/wiki/history/ser-9-years Notice 
 That we merged!
  15. 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. 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. 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. 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. 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. 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. 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. 22. MULTIPROCESS, NOTTHREADS UDP listen TCP listen TCP/TLS listen STCP listen Other worker processes
  23. 23. MANAGEMENT RPC interface XMLrpc Json Pipe MI
 (deprecated) KAMCMD KAMCTL Unix command line applications
  24. 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. 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. 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!
  27. 27. CONFIGURATION
  28. 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. 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. 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. ??
  31. 31. SOLUTIONS WITH KAMAILIO
  32. 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. 33. UNIVERSITY IPTRANSITION .com Session Border
 controller
 (commercial product) SIP Kamailio
 Core proxy Asterisk PBX Asterisk Old PBX Media gateway ISDN
  34. 34. FAILOVER SIP Core Kamailio
 proxys FreeSwitch PBX FreeSwitch PBX backup SIP
  35. 35. MULTI-FEATURE SERVICE SIP Asterisk IVR, Queues, prompts SIP Audio Video Chat Presence Telephony Core Kamailio
 proxys
  36. 36. WHAT ABOUT WEBRTC?
  37. 37. KAMAILIO 4 COMES WITH SIP OVER WEBSOCKETS WWWyou Me SIP WS sip/websockets sip/tcp Javascript
 app Media over SRTP
  38. 38. KAMAILIO AND ASTERISK WITH SIP OVER WEBSOCKETS WWWyou Me SIP WS sip/websockets Javascript
 SIP app Media over SRTP AST RTP
  39. 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. 40. COMPONENTS NEEDED • SIP over WS servers: Kamailio, OverSIP, Asterisk, FreeSwitch • Audio media server RTP gateway: Asterisk, FreeSwitch, RTPengine • SIP/Javascript: SIPml5, JSSIP
  41. 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. 42. THAT’S ALL FOLKS. Twitter @kamailioproject ! Like us on Facebook too! Download on www.kamailio.org

×