2. Presentation
Quobis, 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. 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 SLU
Todos los derechos reservados 3
4. st
1 Part
Biref introduction to telephony
Basics of IP Telephony (ToIP)
Quobis Networks SLU
Todos los derechos reservados 4
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 Spain
Quobis Networks SLU
Todos los derechos reservados 6
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!!
2010
Quobis Networks SLU
Todos los derechos reservados 7
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 SLU
Todos los derechos reservados 11
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 SLU
Todos los derechos reservados 12
13. Basics of IP telephony
Quobis Networks SLU
Todos los derechos reservados 13
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 SLU
Todos los derechos reservados 14
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. 4. Basics of IP telephony
Normally signaling and voice are sent separately
(different protocols and ports).
This gives flexibility to protocols and allows them
to be adapted to new codecs and future multimedia
requirements:
● H323 → TDM signaling over IP
● SIP → native IP protocol → easily readable!
16
20. 1. SIP
SIP (Session Initiation Protocol)
Protocol defined in RFC3261.
RFC(Request For Comments) are published by
IETF (Internet Engineering Task Force) and
define Internet standards. Many actors are
involved (academia, makers, operators...).
20
21. 2. SIP
Since it is based on RFC3261, many others
RFCs add new functionality: presence, IM...
SIP uses clear text messages (like HTTP,
actually it's based on it).
Designed to establish any type of
multimedia session (voice, videocall,
videostreaming, electrocardiogram values... ).
21
24. 5. SIP
SIP Roles
User 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. 6. SIP
SIP transport
SIP 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.com
Domain is resolved by DNS. Three types of DNS records
involved: SRV (protocol and port), NAPTR (protocols
available) and A.
25
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 26
Copyright Quobis Networks 2010 – All rights reserved
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 Timeout
Page 27
Copyright Quobis Networks 2010 – All rights reserved
29. 10. SIP
Register + 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 Ok
Page 29
Copyright Quobis Networks 2010 – All rights reserved
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 36
Copyright Quobis Networks 2010 – All rights reserved
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 37
Copyright Quobis Networks 2010 – All rights reserved
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, xmpp
Page 38
Copyright Quobis Networks 2010 – All rights reserved
39. 4. Kamailio
●Kamailio is based on modules with a kernel which
performs following tasks: memory management,
parsing and transport message.
● Kamailio's 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 39
Copyright Quobis Networks 2010 – All rights reserved
40. 5. Kamailio
Image got from www.kamailio.org
Page 40
Note: in 3.x versions Database and MI API are not in the kernel.
Copyright Quobis Networks 2010 – All rights reserved
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 41
Copyright Quobis Networks 2010 – All rights reserved
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 42
Copyright Quobis Networks 2010 – All rights reserved
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 43
Copyright Quobis Networks 2010 – All rights reserved
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 44
Copyright Quobis Networks 2010 – All rights reserved
45. 11. kamailio. Configuration (5)
Fuente: Asipto
Page 45
Image got from www.kamailio.org
Copyright Quobis Networks 2010 – All rights reserved
46. 12. Kamailio. Configuration (6)
Fuente: Asipto
Page 46
Image got from www.kamailio.org
Copyright Quobis Networks 2010 – All rights reserved
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 secret101
Page 47
Copyright Quobis Networks 2010 – All rights reserved