Your SlideShare is downloading. ×
0
Laboratorio de Conmutación12/13: Kamailio                     By Antón Román 09/27/2011
PresentationQuobis, who we are:               www.quobis.com●   Quobis is a Engineering company focused on VoIP technologi...
Motivation Why are we doing this? ●     We strongly believe University must be linked to real world. ●   Part of our contr...
st                                          1        Part                                Biref introduction to telephony  ...
Introduction to telephony.Quobis Networks SLUTodos los derechos reservados                                5
Introduction to telephony.                ●   1833 Samuel Morse invents telegraph                ●   1871 Antonio Meuci in...
Introduction to telephony.           1870                                ●   Fix line between two endpoints               ...
Introduction to telephony.Circuit conmutation paradigm (ends of 70s)
Introduction to telephony.Digital conmutation (ISDN) (begining of 90s)
Introduction to telephony.Packet conmutation paradigm (IP) (nowadays)
Introduction to telephony.                    What advantages does ToIP offer?:                ●TDM and ISDN conmutation t...
Introduction to telephony.               What about mobile telephony?:           ●Maybe the most important milestone in   ...
Basics of IP telephonyQuobis Networks SLUTodos los derechos reservados                            13
1. Basics of IP telephony       VoIP (Voice over IP) technologies      allow multimedia data transmission      (voice, vid...
2. Basics of IP telephony  VoIP = Signaling Protocols (SIP) + Voice transport protocols (RTP/RTCP)    There are more signa...
4. Basics of IP telephonyNormally signaling and voice are sent separately(different protocols and ports).This gives flexib...
5. Basics of IP telephonyMultimedia  sessions(1)Audio and video: RTP/UDP + RTCP (for QoS, optional)Codecs: G711a (64Kbps),...
5. Basics of IP telephonyMultimedia sessions (2)RTP (Real Time Protocol) designed to transmit real timedata→ not only voic...
nd2 Part     SIP           19
1. SIPSIP (Session Initiation Protocol)Protocol defined in RFC3261.RFC(Request For Comments) are published byIETF (Interne...
2. SIPSince it is based on RFC3261, many othersRFCs add new functionality: presence, IM...SIP uses clear text messages (li...
3. SIP SIP functions:1.­ User location: users register themselves to say the IP/port pair where they are listening to SIP ...
4. SIP  SIP functions (cont.):4.­ Call establishment (multimedia sessions).5.­ Call management: call transfers, param re­n...
5. SIP  SIP RolesUser Agent ­  examples: a SIP phone or a Media Server. It can play two roles:     User Agent Client (UAC)...
6. SIP SIP transportSIP messages can be sent over TCP (port 5060) and UDP(port 5060). Normally UDP is used.It can also be ...
7. SIP     SIP messages      Requests:      ● REGISTER: register users      ● INVITE: session establishment       ● BYE: e...
8. SIP  SIP responses:  Provisional (1xx):                                   Redirection (3xx):                   100 Tryi...
9. SIPSIP trapezoidPage 28Copyright Quobis Networks 2010 – All rights reserved
10. SIPRegister + Call                        A              ……......           Kamailio    ……......     B                ...
11. SIP          Initial REGISTER: endpoint->Kamailio          REGISTER sip:10.1.20.245 SIP/2.0          Via: SIP/2.0/UDP ...
12. SIP          401: Kamailio->endpoint          SIP/2.0 401 Unauthorized          Via: SIP/2.0/UDP 10.1.3.15:5060;branch...
13. SIP          Authentiqued REGISTER: endpoint->Kamailio          REGISTER sip:10.1.20.245 SIP/2.0          Via: SIP/2.0...
14. SIP          200: Kamailio->endpoint          SIP/2.0 200 OK          Via: SIP/2.0/UDP 10.1.3.15:5060;branch=z9hG4bK-6...
rd3 PartKamailio           34
Open Source ToIP projects.SIP Open Source projects. Clients: Ekiga, Twinkle, Jitsi.✔ IP­PBX: Asterisk (and derived project...
1. Kamailio   Kamailio (formerly known as OpenSER): is a SIP   softswitch. It can peform every SIP role (for us it will be...
2. Kamailio          Kamailio can be installed on any Linux distribution.                                                 ...
3. Kamailio          Kamailio can be used in different scenarios:            ●   NAT Traversal: mediaproxy, rtpproxy, nath...
4. Kamailio   ●Kamailio is based on modules with a kernel which   performs following tasks: memory management,   parsing a...
5. Kamailio   Image got from www.kamailio.orgPage 40   Note: in 3.x versions Database and MI API are not in the kernel.Cop...
6. Kamailio. Configuration (1)     Configuration     ●    Routing behaviour is configured in kamailio.cfg.     ●Kamailio m...
7. Kamailio. Configuration (2)   Configuration file has several parts:   1. General parameter setup : port, protocol...   ...
8. Kamailio. Configuration (3)     4. Secondary routes (route[x]()): accesed from the     main route (route()).           ...
10. Kamailio. Configuration (4)     6. Reply routes (onreply_route[x]()): executed     when a 2xx reply to a sent request ...
11. kamailio. Configuration (5)                                                       Fuente: AsiptoPage 45   Image got fr...
12. Kamailio. Configuration (6)                                                       Fuente: AsiptoPage 46   Image got fr...
13. Kamailio. Init.d and kamctl    How to launch Kamailio:    /etc/init.d/kamailio start/stop/restart/status    Kamctl: to...
QUOBIS                             NETWORKS                           Pol. A Granxa P.260                          36400 P...
Upcoming SlideShare
Loading in...5
×

Presentacion kamailio uvigo_09262011

1,184

Published on

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,184
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
30
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Presentacion kamailio uvigo_09262011"

  1. 1. Laboratorio de Conmutación12/13: Kamailio By Antón Román 09/27/2011
  2. 2. PresentationQuobis, who we are: www.quobis.com● Quobis is a Engineering company focused on VoIP technologies.● Founded in 2006 by Teleco Uvigo alumnus.● Premises at O Porriño.● 90% engineers.● Main customers: operators, call centers and enterprises● Partnerships: AcmePacket, Aheeva, SIPWise and Iptego.● Own products: MTRP, SecVoID, MCU,...● R&D activities. Currently involved in Avanza and FP7 projects. 2
  3. 3. Motivation Why are we doing this? ● We strongly believe University must be linked to real world. ● Part of our contribution to Kamailio Open Source Project. ● Professionals with qualified VoIP skills are demanded. ● Close cooperation with university in R&D projects.Quobis Networks SLUTodos los derechos reservados 3
  4. 4. st 1 Part Biref introduction to telephony Basics of IP Telephony (ToIP)Quobis Networks SLUTodos los derechos reservados 4
  5. 5. Introduction to telephony.Quobis Networks SLUTodos los derechos reservados 5
  6. 6. Introduction to telephony. ● 1833 Samuel Morse invents telegraph ● 1871 Antonio Meuci invents telephone ● 1876 Alexander Graham Bell patents telephone ● 1877 First telephone call in SpainQuobis Networks SLUTodos los derechos reservados 6
  7. 7. Introduction to telephony. 1870 ● Fix line between two endpoints ● Manual conmutation ● Automatic conmutation (relay-based) ● Computer-controlled automatic conmutation ● Digital conmutation only electronic ● IP Conmutation!! 2010Quobis Networks SLUTodos los derechos reservados 7
  8. 8. Introduction to telephony.Circuit conmutation paradigm (ends of 70s)
  9. 9. Introduction to telephony.Digital conmutation (ISDN) (begining of 90s)
  10. 10. Introduction to telephony.Packet conmutation paradigm (IP) (nowadays)
  11. 11. Introduction to telephony. What advantages does ToIP offer?: ●TDM and ISDN conmutation technologies were a monopoly of big corporations: operators and makers. ● It allows to re-use knowhow and infrastructure → high speed evolution ●It allows to re-use generic hardware → reduces coste. ● Open Source ToIP projects are born.Quobis Networks SLUTodos los derechos reservados 11
  12. 12. Introduction to telephony. What about mobile telephony?: ●Maybe the most important milestone in history of telephony. 1970 ●It was born as a circuit-oriented technology (GSM) ●It will be an all-IP network (4G→LTE) in a few years. 2010 ●ToIP concepts can be applied to Mobile telephony → convergence!Quobis Networks SLUTodos los derechos reservados 12
  13. 13. Basics of IP telephonyQuobis Networks SLUTodos los derechos reservados 13
  14. 14. 1. Basics of IP telephony VoIP (Voice over IP) technologies allow multimedia data transmission (voice, video, IM... ) over IP networks. ToIP (Telephony over IP) means telephony systems implemented with VoIP technology.Quobis Networks SLUTodos los derechos reservados 14
  15. 15. 2. Basics of IP telephony VoIP = Signaling Protocols (SIP) + Voice transport protocols (RTP/RTCP) There are more signaling protocols besides SIP: H323, Skype(*), MGCP, IAX, Skinny... however SIP is and will be the most used in short and middle term. (*) closed protocol 15
  16. 16. 4. Basics of IP telephonyNormally signaling and voice are sent separately(different protocols and ports).This gives flexibility to protocols and allows themto be adapted to new codecs and future multimediarequirements:● H323 → TDM signaling over IP● SIP → native IP protocol → easily readable! 16
  17. 17. 5. Basics of IP telephonyMultimedia  sessions(1)Audio and video: RTP/UDP + RTCP (for QoS, optional)Codecs: G711a (64Kbps), G711u (64Kbps), G729 (8 or 13 Kbps, licensed), GSM (13 Kbps)...Multimedia session params are agreed during SIP call establishment  through SDP (Session Description Protocol).SDP message are  attached to SIP messages (2 protocols, 1 text message). 17
  18. 18. 5. Basics of IP telephonyMultimedia sessions (2)RTP (Real Time Protocol) designed to transmit real timedata→ not only voice or videoIt can be used to transmit desktop sessions, medicalmonitoring data, share prices... 18
  19. 19. nd2 Part SIP 19
  20. 20. 1. SIPSIP (Session Initiation Protocol)Protocol defined in RFC3261.RFC(Request For Comments) are published byIETF (Internet Engineering Task Force) anddefine Internet standards. Many actors areinvolved (academia, makers, operators...). 20
  21. 21. 2. SIPSince it is based on RFC3261, many othersRFCs add new functionality: presence, IM...SIP uses clear text messages (like HTTP,actually its based on it).Designed to establish any type ofmultimedia session (voice, videocall,videostreaming, electrocardiogram values... ). 21
  22. 22. 3. SIP SIP functions:1.­ User location: users register themselves to say the IP/port pair where they are listening to SIP traffic.2.­ Multimedia parameter negotiation: it allows to negotiate session parameters (codecs, packetization time, ports...).3.­ User availability: it allows to publish and notify info about user availability, and subscribe to user status. 22
  23. 23. 4. SIP  SIP functions (cont.):4.­ Call establishment (multimedia sessions).5.­ Call management: call transfers, param re­negotiation... 23
  24. 24. 5. SIP  SIP RolesUser Agent ­  examples: a SIP phone or a Media Server. It can play two roles:  User Agent Client (UAC) – User Agent which sends a request   User Agent Server (UAS) ­ User Agent which answers a request Redirect Server ­ User Agent Server which redirect requests Proxy – sends request on behalf of users. It is what users see of a SIP network .Registrar ­ accepts  REGISTER messages and stores user location in a Database. 24
  25. 25. 6. SIP SIP transportSIP messages can be sent over TCP (port 5060) and UDP(port 5060). Normally UDP is used.It can also be transported over TLS.SIP URI: identifies and locates a user.sip:user@domain.com → sip:1234@<ip-server>sips:user@domain.comDomain is resolved by DNS. Three types of DNS recordsinvolved: SRV (protocol and port), NAPTR (protocolsavailable) and A. 25
  26. 26. 7. SIP SIP messages Requests: ● REGISTER: register users ● INVITE: session establishment  ● BYE: end of session ● ACK: acknowledge (INVITE, 407,...) ● SUBSCRIBE: event subscription ● INFO: transmit info during a call (DTMF)Page 26Copyright Quobis Networks 2010 – All rights reserved
  27. 27. 8. SIP SIP responses: Provisional (1xx): Redirection (3xx):    100 Trying  302 Moved Temporaly 180 Ringing Request failure (4xx):  Successful (2xx): 401 Unauthorized  200 OK   404 Not found              202 OK   407 Proxy Authentication Required   408 Request TimeoutPage 27Copyright Quobis Networks 2010 – All rights reserved
  28. 28. 9. SIPSIP trapezoidPage 28Copyright Quobis Networks 2010 – All rights reserved
  29. 29. 10. SIPRegister + Call A ……...... Kamailio ……...... B (Registrar local services) Register 200 Ok Invite Invite 100 Trying 100 Trying 180 Ringing 180 Ringing 200 Ok 200 Ok Ack Media Session Bye 200 OkPage 29Copyright Quobis Networks 2010 – All rights reserved
  30. 30. 11. SIP Initial REGISTER: endpoint->Kamailio REGISTER sip:10.1.20.245 SIP/2.0 Via: SIP/2.0/UDP 10.1.3.15:5060;branch=z9hG4bK-83dafcc6 From: "1234" <sip:1234@10.1.20.245>;tag=a75abbe5b6e4cc6o1 To: "1234" <sip:1234@10.1.20.245> Call-ID: 14221856-8faf084d@10.1.3.15 CSeq: 33037 REGISTER Max-Forwards: 70 Authorization: Digest username="1234",realm="10.1.20.245",nonce="4a389a3a00000098 4df34ebaabed674b40c0b27d8b354c1d",uri="sip:10.1.20.245",algori thm=MD5,response="216509e17700c67fb1b346675e0f46b2" Contact: "1234" <sip:1234@10.1.3.15:5060>;expires=60 User-Agent: Linksys/SPA941-5.1.5 Content-Length: 0 Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER Supported: replacesPage 30Copyright Quobis Networks 2010 – All rights reserved
  31. 31. 12. SIP 401: Kamailio->endpoint SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 10.1.3.15:5060;branch=z9hG4bK-83dafcc6 From: "1234" <sip:1234@10.1.20.245>;tag=a75abbe5b6e4cc6o1 To: "1234" <sip:1234@10.1.20.245>;tag=f8f2ab2c1295e90ed7dbb499b30f44b 2.c168 Call-ID: 14221856-8faf084d@10.1.3.15 CSeq: 33037 REGISTER WWW-Authenticate: Digest realm="10.1.20.245", nonce="4a389a750000009c100b4538aaabc0db79e49a68db0e7db a", stale=true Server: Kamailio (1.5.0-notls (i386/linux)) Content-Length: 0Page 31Copyright Quobis Networks 2010 – All rights reserved
  32. 32. 13. SIP Authentiqued REGISTER: endpoint->Kamailio REGISTER sip:10.1.20.245 SIP/2.0 Via: SIP/2.0/UDP 10.1.3.15:5060;branch=z9hG4bK-67a1ce3 From: "1234" <sip:1234@10.1.20.245>;tag=a75abbe5b6e4cc6o1 To: "1234" <sip:1234@10.1.20.245> Call-ID: 14221856-8faf084d@10.1.3.15 CSeq: 33038 REGISTER Max-Forwards: 70 Authorization: Digest username="1234",realm="10.1.20.245",nonce="4a389a750000009c 100b4538aaabc0db79e49a68db0e7dba",uri="sip:10.1.20.245",algor ithm=MD5,response="34d004dc426d7b56d9d742dbc69aeb4c" Contact: "1234" <sip:1234@10.1.3.15:5060>;expires=60 User-Agent: Linksys/SPA941-5.1.5 Content-Length: 0 Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER Supported: replacesPage 32Copyright Quobis Networks 2010 – All rights reserved
  33. 33. 14. SIP 200: Kamailio->endpoint SIP/2.0 200 OK Via: SIP/2.0/UDP 10.1.3.15:5060;branch=z9hG4bK-67a1ce3 From: "1234" <sip:1234@10.1.20.245>;tag=a75abbe5b6e4cc6o1 To: "1234" <sip:1234@10.1.20.245>;tag=f8f2ab2c1295e90ed7dbb499b30f44b 2.4319 Call-ID: 14221856-8faf084d@10.1.3.15 CSeq: 33038 REGISTER Contact: <sip:1234@10.1.3.15:5060>;expires=60 Server: Kamailio (1.5.0-notls (i386/linux)) Content-Length: 0Page 33Copyright Quobis Networks 2010 – All rights reserved
  34. 34. rd3 PartKamailio 34
  35. 35. Open Source ToIP projects.SIP Open Source projects. Clients: Ekiga, Twinkle, Jitsi.✔ IP­PBX: Asterisk (and derived projects), Freeswitch. ✔ Softswitch: Kamailio­SIP Router, OpenSIPS.✔ MediaServer: SEMS, Asterisk, FreeSwitch.✔ Gateway: (Asterisk || FreeSwitch) + hardware card ✔ 35
  36. 36. 1. Kamailio Kamailio (formerly known as OpenSER): is a SIP softswitch. It can peform every SIP role (for us it will be Proxy and Registar). It is a high performance and robust software. It is used by VoIP providers: Voztelecom (Spain) and 1&1 (Germany). Kamailio is released under GPL license. Several companies offer professional support. Now it is part of the SIP Router project.Page 36Copyright Quobis Networks 2010 – All rights reserved
  37. 37. 2. Kamailio Kamailio can be installed on any Linux distribution. Real test: 150 calls/s. Virtual machine with 512MB RAM and 1,4GHz. A dedicated server with 4GB RAM could provide service to 300,000 users → Vigo!Page 37Copyright Quobis Networks 2010 – All rights reserved
  38. 38. 3. Kamailio Kamailio can be used in different scenarios: ● NAT Traversal: mediaproxy, rtpproxy, nathelper ● Presence server: presence, presence_xml ● Load balancer: dispatcher, path ● Instant Messaging: imc, xmppPage 38Copyright Quobis Networks 2010 – All rights reserved
  39. 39. 4. Kamailio ●Kamailio is based on modules with a kernel which performs following tasks: memory management, parsing and transport message. ● Kamailios funcionality can be enriched with modules (dynamic libraries, .so) included in the configuration. ● Configuration is just a file: /etc/kamailio/kamailio.cfg ●Modules param and users are provisioned in Database (MySQL, Postgres, Oracle).Page 39Copyright Quobis Networks 2010 – All rights reserved
  40. 40. 5. Kamailio Image got from www.kamailio.orgPage 40 Note: in 3.x versions Database and MI API are not in the kernel.Copyright Quobis Networks 2010 – All rights reserved
  41. 41. 6. Kamailio. Configuration (1) Configuration ● Routing behaviour is configured in kamailio.cfg. ●Kamailio must be restarted to apply in changes kamailio.cfg. ●Variable params are configured in Database and can be reloaded in execution time: user provision, ACL, LCR...Page 41Copyright Quobis Networks 2010 – All rights reserved
  42. 42. 7. Kamailio. Configuration (2) Configuration file has several parts: 1. General parameter setup : port, protocol... 2. Module load and module param setup: loadmodule “permissions.so” loadmodule “permissions.so”                ...                ... modparam(“permissions”, “db_mode”, 1) modparam(“permissions”, “db_mode”, 1) 3. Main route: every request that reaches Kamailio is executed in the main route. route{ route{ ... ... route[TO_KAMAILIO2] route[TO_KAMAILIO2] ... ... }}Page 42Copyright Quobis Networks 2010 – All rights reserved
  43. 43. 8. Kamailio. Configuration (3) 4. Secondary routes (route[x]()): accesed from the main route (route()). route[TO_KAMAILIO2]{ route[TO_KAMAILIO2]{          ...          ... t_on_failure(“1”) t_on_failure(“1”) …… t_on_reply(“3”) t_on_reply(“3”) }} 5. Error route route{}: executed when Kamailio receives an error reply to a sent request. failure_route[1]{ failure_route[1]{ ... ... }}Page 43Copyright Quobis Networks 2010 – All rights reserved
  44. 44. 10. Kamailio. Configuration (4) 6. Reply routes (onreply_route[x]()): executed when a 2xx reply to a sent request is received. onreply_route[1]{ onreply_route[1]{          ...          ... }} 7. Branch routes (branch_route[x]()): executed to create a parallel route to send request to another server branch_route[1]{ branch_route[1]{          ...          ... }}Page 44Copyright Quobis Networks 2010 – All rights reserved
  45. 45. 11. kamailio. Configuration (5) Fuente: AsiptoPage 45 Image got from www.kamailio.orgCopyright Quobis Networks 2010 – All rights reserved
  46. 46. 12. Kamailio. Configuration (6) Fuente: AsiptoPage 46 Image got from www.kamailio.orgCopyright Quobis Networks 2010 – All rights reserved
  47. 47. 13. Kamailio. Init.d and kamctl How to launch Kamailio: /etc/init.d/kamailio start/stop/restart/status Kamctl: tool to control and monitor kamailio ● Check main stats: kamctl monitor ● Check uptime: kamctl fifo uptime ● Add user to Kamailio DB: kamctl add 101 secret101Page 47Copyright Quobis Networks 2010 – All rights reserved
  48. 48. QUOBIS NETWORKS Pol. A Granxa P.260 36400 Porriño (Spain) Tlf. +34 902 999 465 Sip://sip.quobis.com www.quobis.comCreative Commons Attribution-NonCommercial 3.0 Unported License
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×