SlideShare a Scribd company logo
1 of 27
Download to read offline
Federico
Cabiddu
Senior VoIP Developer
Kamailio
in a Mobile World
Kamailio World | © 2015 Orange Vallée

Working in VoIP since 2001

Working with OpenSER/Kamailio since 2005

Libon Voice Team Tech Coordinator
About me
What is Libon?
app available on
VoIP and VoIP out calls
App2app calls and calls to landlines and
mobiles in more than 100 destinations.
Instant messages
Instant messaging with Libon and non-
Libon users (OpenChat).
Customized voicemail
Create customized greetings for each
one of your contacts or groups of
contacts.
Kamailio World | © 2015 Orange Vallée

Constraints of a mobile VoIP application

A commonly used approach

Multidevice scenarios

The TSILO module

Working example
Contents
Kamailio World | © 2015 Orange Vallée

Power consumption

Data consumption

Socket unreliability

Constructor constraints: iOS background
mode(s)
Mobile VoIP apps constraints
Kamailio World | © 2015 Orange Vallée
Push notifications
In mobile context:
a short message sent
to a smartphone
through a centralized
service and targeted
to a specific app.
It can be used to
trigger an action from
the app.
Kamailio World | © 2015 Orange Vallée
Push notifications & VoIP
Kamailio World | © 2015 Orange Vallée
Pros
• Simple way for a service to send
notifications to user's device
• Available on several platforms/OS
• Reliable (APNS > 99% success rate)
• No need to deal with pinhole/NAT
• No need to permanently store users'
location
• Use resources “on demand”
Kamailio World | © 2015 Orange Vallée
Push notifications
Cons
• No immediate delivery status report
• No delivery guarantee
• Not possible to predict delivery time
• Different API per provider
• Different UX per OS/Version:
– Apple push before iOS 7 vs Apple
“silent push”
Kamailio World | © 2015 Orange Vallée
Push notifications

Users can have many devices

Only some of them may be
reachable

Each device may have a different
Push Notification system
Kamailio World | © 2015 Orange Vallée
Multi-device: new challenges
How long do we have to wait
before relaying the INVITE?
Kamailio World | © 2015 Orange Vallée
Multi-device: the question
“Late” parallel forking
Instead of forking an INVITE just to the
currently registered contacts, send the
INVITE to the available ones and continue
adding branches as soon as new ones
register and as long as the transaction
hasn't got a final reply.
TSILO = Transactions Silo
Kamailio World | © 2015 Orange Vallée
TSILO: concept
Kamailio World | © 2015 Orange Vallée
Push & multi-device
Callee's
devices
receive the
INVITE
(5,7,9) as
soon as
they
register
(4,6,8)
Kamailio World | © 2015 Orange Vallée
TSILO: details
 ts_store()
store the current transaction
 ts_append(domain¹, ruri)
add branches to all the transactions
currently stored for ruri
 ts_append_to(tindex, tlabel, domain¹)
add branches to a specific transaction
identified by tindex and tlabel
(1) the table over which the internal lookup is performed
Kamailio World | © 2015 Orange Vallée
TSILO: exported functions
 r-uris stored as entries of a hash table
(separate chaining with linked lists for
collisions)
 transactions per r-uri stored as linked list
of the hash table entries
 t_append*() call lookup_to_dset
(REGISTRAR module) and
t_append_branches (TM module)
 For each transaction a TM cb for
TMCB_DESTROY event is registered
Kamailio World | © 2015 Orange Vallée
TSILO: implementation details
Hibernate
Kamailio World | © 2015 Orange Vallée
TSILO: example (preamble)
Based on KamailioWorld 2014 Async Push example
by Daniel Constantin-Mierla
loadmodule “tsilo.so”
# ----- htable params -----
modparam("htable", "htable",
"vtp=>size=10;autoexpire=120;dbtable=htable;dbmode=0")
request_route {
...
if (is_method(“INVITE”))
{
route(INVITE);
}
if (is_method(“REGISTER”))
{
route(REGISTER);
}
...
}
Kamailio World | © 2015 Orange Vallée
TSILO: example
# manage incoming INVITEs
route[INVITE] {
if (!lookup("location"))
{
send_reply("100", "Trying");
route(SUSPEND);
}
else
{
t_relay();
ts_store();
$sht(vtp=>stored::$rU) = 1;
xdbg("stored transaction [$T(id_index):$T(id_label)] $fU
=> $rUn");
}
route(SENDPUSH);
}
Kamailio World | © 2015 Orange Vallée
TSILO: example
# suspend the transaction
route[SUSPEND] {
if(!t_suspend())
{
xlog("failed suspending trasaction [$T(id_index):
$T(id_label)]n");
send_reply("501", "Unknown destination");
exit;
}
xdbg("suspended transaction [$T(id_index):$T(id_label)] $fU
=> $rUn");
$sht(vtp=>join::$rU) = "" + $T(id_index) + ":" +
$T(id_label);
xdbg("htable key value [$sht(vtp=>join::$rU)]n");
}
Kamailio World | © 2015 Orange Vallée
TSILO: example
route[SENDPUSH] {
$var(luaret) = 0;
if(lua_runstring("do_push([[$hdr(X-VxTo)]], [[$tU]], [[$hdr(X-
VxFrom)]], [[$fU]], [[$ci]])")<0)
{
send_reply("501", "No link to destination");
exit;
}
if($var(luaret)!=1)
{
send_reply("501", "Unknown destination");
exit;
}
}
# manage incoming REGISTERs
route[REGISTER] {
if (!save("location"))
sl_reply_error();
route(PUSHJOIN);
exit;
}
Kamailio World | © 2015 Orange Vallée
TSILO: example
# append branches or resume the transaction
route[PUSHJOIN] {
$var(hjoin) = 0;
lock("$tU");
$var(hjoin) = $sht(vtp=>join::$tU);
$var(hstored) = $sht(vtp=>stored::$tU);
$sht(vtp=>join::$tU) = $null;
unlock("$tU");
if ($var(hjoin)==0)
{
if ($var(hstored))
ts_append("location", "$tU");
return;
}
$var(id_index) = $(var(hjoin){s.select,0,:}{s.int});
$var(id_label) = $(var(hjoin){s.select,1,:}{s.int});
xdbg("resuming trasaction [$var(id_index):$var(id_label)] $tU
($var(hjoin))n");
t_continue("$var(id_index)", "$var(id_label)", "INVRESUME");
}
Kamailio World | © 2015 Orange Vallée
TSILO: example
# lookup and relay after resuming transaction
route[INVRESUME] {
lookup("location");
t_relay();
ts_store();
$sht(vtp=>stored::$rU) = 1;
xdbg("stored transaction [$T(id_index):$T(id_label)] $fU =>
$rUn");
}
Kamailio World | © 2015 Orange Vallée
TSILO: example
Kamailio World | © 2015 Orange Vallée
Multi-device without
Push & TSILO
Kamailio World | © 2015 Orange Vallée
Multi-device
with Push & TSILO
• Stats
• More RPC commands
• USRLOC callbacks?
Kamailio World | © 2015 Orange Vallée
TSILO: improvements
Thank you!
Questions?
email: federico.cabiddu@gmail.com
Kamailio World | © 2015 Orange Vallée

More Related Content

What's hot

Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and KamailioGiacomo Vacca
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsOlle E Johansson
 
Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionOlle E Johansson
 
TOC training KeyCloak Redhat SSO core
TOC training KeyCloak Redhat SSO coreTOC training KeyCloak Redhat SSO core
TOC training KeyCloak Redhat SSO corePascal Flamand
 
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...Fred Posner
 
Hacking SIP Like a Boss!
Hacking SIP Like a Boss!Hacking SIP Like a Boss!
Hacking SIP Like a Boss!Fatih Ozavci
 
Kamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade TrafficKamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade TrafficDaniel-Constantin Mierla
 
Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.Olle E Johansson
 
SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)Fred Posner
 
Chapter 16 : inter-vlan routing
Chapter 16 : inter-vlan routingChapter 16 : inter-vlan routing
Chapter 16 : inter-vlan routingteknetir
 
High Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft AzureHigh Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft AzureSanjay Willie
 
Cisco Identity Services Engine (ISE)
Cisco Identity Services Engine (ISE)Cisco Identity Services Engine (ISE)
Cisco Identity Services Engine (ISE)Anwesh Dixit
 
Kamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouKamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouFred Posner
 
Asterisk Rest Interface - ARI
Asterisk Rest Interface - ARIAsterisk Rest Interface - ARI
Asterisk Rest Interface - ARIDavid Muñoz
 
「Photon OS + Docker」VLAN 環境の構築
「Photon OS + Docker」VLAN 環境の構築「Photon OS + Docker」VLAN 環境の構築
「Photon OS + Docker」VLAN 環境の構築Fuva Brain
 
Simple callcenter platform with PHP
Simple callcenter platform with PHPSimple callcenter platform with PHP
Simple callcenter platform with PHPMorten Amundsen
 
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIMarcelo Gornstein
 
Media Handling in FreeSWITCH
Media Handling in FreeSWITCHMedia Handling in FreeSWITCH
Media Handling in FreeSWITCHMoises Silva
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerShu Sugimoto
 

What's hot (20)

Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and Kamailio
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installations
 
Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick Introduction
 
TOC training KeyCloak Redhat SSO core
TOC training KeyCloak Redhat SSO coreTOC training KeyCloak Redhat SSO core
TOC training KeyCloak Redhat SSO core
 
Kamailio - SIP Routing in Lua
Kamailio - SIP Routing in LuaKamailio - SIP Routing in Lua
Kamailio - SIP Routing in Lua
 
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
 
Hacking SIP Like a Boss!
Hacking SIP Like a Boss!Hacking SIP Like a Boss!
Hacking SIP Like a Boss!
 
Kamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade TrafficKamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade Traffic
 
Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.
 
SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)
 
Chapter 16 : inter-vlan routing
Chapter 16 : inter-vlan routingChapter 16 : inter-vlan routing
Chapter 16 : inter-vlan routing
 
High Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft AzureHigh Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft Azure
 
Cisco Identity Services Engine (ISE)
Cisco Identity Services Engine (ISE)Cisco Identity Services Engine (ISE)
Cisco Identity Services Engine (ISE)
 
Kamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouKamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and You
 
Asterisk Rest Interface - ARI
Asterisk Rest Interface - ARIAsterisk Rest Interface - ARI
Asterisk Rest Interface - ARI
 
「Photon OS + Docker」VLAN 環境の構築
「Photon OS + Docker」VLAN 環境の構築「Photon OS + Docker」VLAN 環境の構築
「Photon OS + Docker」VLAN 環境の構築
 
Simple callcenter platform with PHP
Simple callcenter platform with PHPSimple callcenter platform with PHP
Simple callcenter platform with PHP
 
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
 
Media Handling in FreeSWITCH
Media Handling in FreeSWITCHMedia Handling in FreeSWITCH
Media Handling in FreeSWITCH
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
 

Viewers also liked (14)

Kamailio - SIP Servers Everywhere
Kamailio - SIP Servers EverywhereKamailio - SIP Servers Everywhere
Kamailio - SIP Servers Everywhere
 
Aynchronous Processing in Kamailio Configuration File
Aynchronous Processing in Kamailio Configuration FileAynchronous Processing in Kamailio Configuration File
Aynchronous Processing in Kamailio Configuration File
 
PresentacióN1
PresentacióN1PresentacióN1
PresentacióN1
 
Richard-K.-Bretton-Resume
Richard-K.-Bretton-ResumeRichard-K.-Bretton-Resume
Richard-K.-Bretton-Resume
 
How to write a Newspaper Article
How to write a Newspaper ArticleHow to write a Newspaper Article
How to write a Newspaper Article
 
Kamailio and VoIP Wild World
Kamailio and VoIP Wild WorldKamailio and VoIP Wild World
Kamailio and VoIP Wild World
 
Folcsonomía parte 3
Folcsonomía parte 3Folcsonomía parte 3
Folcsonomía parte 3
 
Cap.10
Cap.10Cap.10
Cap.10
 
CV 2016
CV 2016CV 2016
CV 2016
 
W- Wort
W- WortW- Wort
W- Wort
 
die Schulfächer
die Schulfächer die Schulfächer
die Schulfächer
 
Ser Community Manager y No Morir en el Intento (PRIMERA PARTE)
Ser Community Manager y No Morir en el Intento (PRIMERA PARTE)Ser Community Manager y No Morir en el Intento (PRIMERA PARTE)
Ser Community Manager y No Morir en el Intento (PRIMERA PARTE)
 
Meine familie...
Meine familie... Meine familie...
Meine familie...
 
Meine familie
Meine familie Meine familie
Meine familie
 

Similar to Kamailio-In-A-Mobile-World

How to augment On-premise Call Centers to Scale-out to the Cloud
How to augment On-premise Call Centers to Scale-out to the CloudHow to augment On-premise Call Centers to Scale-out to the Cloud
How to augment On-premise Call Centers to Scale-out to the CloudDaniel Zivkovic
 
Twilio at the Google App Engine Meetup 2009-10
Twilio at the Google App Engine Meetup 2009-10Twilio at the Google App Engine Meetup 2009-10
Twilio at the Google App Engine Meetup 2009-10Twilio Inc
 
Keynote Ouverture Plénière - Sébastien Verger
Keynote Ouverture Plénière - Sébastien VergerKeynote Ouverture Plénière - Sébastien Verger
Keynote Ouverture Plénière - Sébastien VergerRSD
 
IoT Deep Dive - Be an IoT Developer for an Hour
IoT Deep Dive - Be an IoT Developer for an HourIoT Deep Dive - Be an IoT Developer for an Hour
IoT Deep Dive - Be an IoT Developer for an HourTaisuke Yamada
 
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market SizingBy The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market SizingAlan Quayle
 
Let's Talk Mobile
Let's Talk MobileLet's Talk Mobile
Let's Talk MobileChris Muir
 
Data Day - Escuchando la red
Data Day - Escuchando la redData Day - Escuchando la red
Data Day - Escuchando la redSoftware Guru
 
HP Helion Webinar #2
HP Helion Webinar #2 HP Helion Webinar #2
HP Helion Webinar #2 BeMyApp
 
JVMCON Java in the 21st Century: are you thinking far enough ahead?
JVMCON Java in the 21st Century: are you thinking far enough ahead?JVMCON Java in the 21st Century: are you thinking far enough ahead?
JVMCON Java in the 21st Century: are you thinking far enough ahead?Steve Poole
 
Delivering Integrated HetNets: Small Cell Forum’s expanded mission
Delivering Integrated HetNets: Small Cell Forum’s expanded missionDelivering Integrated HetNets: Small Cell Forum’s expanded mission
Delivering Integrated HetNets: Small Cell Forum’s expanded missionSmall Cell Forum
 
FAST Digital Telco
FAST Digital TelcoFAST Digital Telco
FAST Digital TelcoCapgemini
 
Interfaces de Voz avanzadas con VoiceXML - Iván Sixto | VoIP2DAY 2015
Interfaces de Voz avanzadas con VoiceXML - Iván Sixto | VoIP2DAY 2015Interfaces de Voz avanzadas con VoiceXML - Iván Sixto | VoIP2DAY 2015
Interfaces de Voz avanzadas con VoiceXML - Iván Sixto | VoIP2DAY 2015VOIP2DAY
 
Accel klantenevent 2016: Awingu
Accel klantenevent 2016: AwinguAccel klantenevent 2016: Awingu
Accel klantenevent 2016: AwinguAccel
 
Prevention first platform for cyber defence the alternative strategy khipu ...
Prevention first platform for cyber defence the alternative strategy   khipu ...Prevention first platform for cyber defence the alternative strategy   khipu ...
Prevention first platform for cyber defence the alternative strategy khipu ...Jisc
 
Datasheet Tuleap Enterprise and myTuleap
Datasheet Tuleap Enterprise and myTuleapDatasheet Tuleap Enterprise and myTuleap
Datasheet Tuleap Enterprise and myTuleapTuleap
 
OMA LwM2M - HOP Ubiquitous
OMA LwM2M - HOP UbiquitousOMA LwM2M - HOP Ubiquitous
OMA LwM2M - HOP UbiquitousAntonio J. Jara
 
Cloud Native Infrastructure Automation
Cloud Native Infrastructure AutomationCloud Native Infrastructure Automation
Cloud Native Infrastructure AutomationVMware Tanzu
 

Similar to Kamailio-In-A-Mobile-World (20)

How to augment On-premise Call Centers to Scale-out to the Cloud
How to augment On-premise Call Centers to Scale-out to the CloudHow to augment On-premise Call Centers to Scale-out to the Cloud
How to augment On-premise Call Centers to Scale-out to the Cloud
 
Oracle Cloud Café IOT 12 avril 2016
Oracle Cloud Café IOT 12 avril 2016Oracle Cloud Café IOT 12 avril 2016
Oracle Cloud Café IOT 12 avril 2016
 
Oracle Cloud Café IoT 12-APR-2016
Oracle Cloud Café IoT 12-APR-2016Oracle Cloud Café IoT 12-APR-2016
Oracle Cloud Café IoT 12-APR-2016
 
Twilio at the Google App Engine Meetup 2009-10
Twilio at the Google App Engine Meetup 2009-10Twilio at the Google App Engine Meetup 2009-10
Twilio at the Google App Engine Meetup 2009-10
 
Keynote Ouverture Plénière - Sébastien Verger
Keynote Ouverture Plénière - Sébastien VergerKeynote Ouverture Plénière - Sébastien Verger
Keynote Ouverture Plénière - Sébastien Verger
 
IoT Deep Dive - Be an IoT Developer for an Hour
IoT Deep Dive - Be an IoT Developer for an HourIoT Deep Dive - Be an IoT Developer for an Hour
IoT Deep Dive - Be an IoT Developer for an Hour
 
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market SizingBy The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
 
Let's Talk Mobile
Let's Talk MobileLet's Talk Mobile
Let's Talk Mobile
 
Data Day - Escuchando la red
Data Day - Escuchando la redData Day - Escuchando la red
Data Day - Escuchando la red
 
HP Helion Webinar #2
HP Helion Webinar #2 HP Helion Webinar #2
HP Helion Webinar #2
 
JVMCON Java in the 21st Century: are you thinking far enough ahead?
JVMCON Java in the 21st Century: are you thinking far enough ahead?JVMCON Java in the 21st Century: are you thinking far enough ahead?
JVMCON Java in the 21st Century: are you thinking far enough ahead?
 
Delivering Integrated HetNets: Small Cell Forum’s expanded mission
Delivering Integrated HetNets: Small Cell Forum’s expanded missionDelivering Integrated HetNets: Small Cell Forum’s expanded mission
Delivering Integrated HetNets: Small Cell Forum’s expanded mission
 
FAST Digital Telco
FAST Digital TelcoFAST Digital Telco
FAST Digital Telco
 
Interfaces de Voz avanzadas con VoiceXML - Iván Sixto | VoIP2DAY 2015
Interfaces de Voz avanzadas con VoiceXML - Iván Sixto | VoIP2DAY 2015Interfaces de Voz avanzadas con VoiceXML - Iván Sixto | VoIP2DAY 2015
Interfaces de Voz avanzadas con VoiceXML - Iván Sixto | VoIP2DAY 2015
 
Accel klantenevent 2016: Awingu
Accel klantenevent 2016: AwinguAccel klantenevent 2016: Awingu
Accel klantenevent 2016: Awingu
 
Prevention first platform for cyber defence the alternative strategy khipu ...
Prevention first platform for cyber defence the alternative strategy   khipu ...Prevention first platform for cyber defence the alternative strategy   khipu ...
Prevention first platform for cyber defence the alternative strategy khipu ...
 
Datasheet Tuleap Enterprise and myTuleap
Datasheet Tuleap Enterprise and myTuleapDatasheet Tuleap Enterprise and myTuleap
Datasheet Tuleap Enterprise and myTuleap
 
Zipwire Cloud solution
Zipwire Cloud solutionZipwire Cloud solution
Zipwire Cloud solution
 
OMA LwM2M - HOP Ubiquitous
OMA LwM2M - HOP UbiquitousOMA LwM2M - HOP Ubiquitous
OMA LwM2M - HOP Ubiquitous
 
Cloud Native Infrastructure Automation
Cloud Native Infrastructure AutomationCloud Native Infrastructure Automation
Cloud Native Infrastructure Automation
 

Kamailio-In-A-Mobile-World

  • 2. Kamailio World | © 2015 Orange Vallée  Working in VoIP since 2001  Working with OpenSER/Kamailio since 2005  Libon Voice Team Tech Coordinator About me
  • 3. What is Libon? app available on VoIP and VoIP out calls App2app calls and calls to landlines and mobiles in more than 100 destinations. Instant messages Instant messaging with Libon and non- Libon users (OpenChat). Customized voicemail Create customized greetings for each one of your contacts or groups of contacts. Kamailio World | © 2015 Orange Vallée
  • 4.  Constraints of a mobile VoIP application  A commonly used approach  Multidevice scenarios  The TSILO module  Working example Contents Kamailio World | © 2015 Orange Vallée
  • 5.  Power consumption  Data consumption  Socket unreliability  Constructor constraints: iOS background mode(s) Mobile VoIP apps constraints Kamailio World | © 2015 Orange Vallée
  • 6. Push notifications In mobile context: a short message sent to a smartphone through a centralized service and targeted to a specific app. It can be used to trigger an action from the app. Kamailio World | © 2015 Orange Vallée
  • 7. Push notifications & VoIP Kamailio World | © 2015 Orange Vallée
  • 8. Pros • Simple way for a service to send notifications to user's device • Available on several platforms/OS • Reliable (APNS > 99% success rate) • No need to deal with pinhole/NAT • No need to permanently store users' location • Use resources “on demand” Kamailio World | © 2015 Orange Vallée Push notifications
  • 9. Cons • No immediate delivery status report • No delivery guarantee • Not possible to predict delivery time • Different API per provider • Different UX per OS/Version: – Apple push before iOS 7 vs Apple “silent push” Kamailio World | © 2015 Orange Vallée Push notifications
  • 10.  Users can have many devices  Only some of them may be reachable  Each device may have a different Push Notification system Kamailio World | © 2015 Orange Vallée Multi-device: new challenges
  • 11. How long do we have to wait before relaying the INVITE? Kamailio World | © 2015 Orange Vallée Multi-device: the question
  • 12. “Late” parallel forking Instead of forking an INVITE just to the currently registered contacts, send the INVITE to the available ones and continue adding branches as soon as new ones register and as long as the transaction hasn't got a final reply. TSILO = Transactions Silo Kamailio World | © 2015 Orange Vallée TSILO: concept
  • 13. Kamailio World | © 2015 Orange Vallée Push & multi-device Callee's devices receive the INVITE (5,7,9) as soon as they register (4,6,8)
  • 14. Kamailio World | © 2015 Orange Vallée TSILO: details
  • 15.  ts_store() store the current transaction  ts_append(domain¹, ruri) add branches to all the transactions currently stored for ruri  ts_append_to(tindex, tlabel, domain¹) add branches to a specific transaction identified by tindex and tlabel (1) the table over which the internal lookup is performed Kamailio World | © 2015 Orange Vallée TSILO: exported functions
  • 16.  r-uris stored as entries of a hash table (separate chaining with linked lists for collisions)  transactions per r-uri stored as linked list of the hash table entries  t_append*() call lookup_to_dset (REGISTRAR module) and t_append_branches (TM module)  For each transaction a TM cb for TMCB_DESTROY event is registered Kamailio World | © 2015 Orange Vallée TSILO: implementation details Hibernate
  • 17. Kamailio World | © 2015 Orange Vallée TSILO: example (preamble) Based on KamailioWorld 2014 Async Push example by Daniel Constantin-Mierla
  • 18. loadmodule “tsilo.so” # ----- htable params ----- modparam("htable", "htable", "vtp=>size=10;autoexpire=120;dbtable=htable;dbmode=0") request_route { ... if (is_method(“INVITE”)) { route(INVITE); } if (is_method(“REGISTER”)) { route(REGISTER); } ... } Kamailio World | © 2015 Orange Vallée TSILO: example
  • 19. # manage incoming INVITEs route[INVITE] { if (!lookup("location")) { send_reply("100", "Trying"); route(SUSPEND); } else { t_relay(); ts_store(); $sht(vtp=>stored::$rU) = 1; xdbg("stored transaction [$T(id_index):$T(id_label)] $fU => $rUn"); } route(SENDPUSH); } Kamailio World | © 2015 Orange Vallée TSILO: example
  • 20. # suspend the transaction route[SUSPEND] { if(!t_suspend()) { xlog("failed suspending trasaction [$T(id_index): $T(id_label)]n"); send_reply("501", "Unknown destination"); exit; } xdbg("suspended transaction [$T(id_index):$T(id_label)] $fU => $rUn"); $sht(vtp=>join::$rU) = "" + $T(id_index) + ":" + $T(id_label); xdbg("htable key value [$sht(vtp=>join::$rU)]n"); } Kamailio World | © 2015 Orange Vallée TSILO: example
  • 21. route[SENDPUSH] { $var(luaret) = 0; if(lua_runstring("do_push([[$hdr(X-VxTo)]], [[$tU]], [[$hdr(X- VxFrom)]], [[$fU]], [[$ci]])")<0) { send_reply("501", "No link to destination"); exit; } if($var(luaret)!=1) { send_reply("501", "Unknown destination"); exit; } } # manage incoming REGISTERs route[REGISTER] { if (!save("location")) sl_reply_error(); route(PUSHJOIN); exit; } Kamailio World | © 2015 Orange Vallée TSILO: example
  • 22. # append branches or resume the transaction route[PUSHJOIN] { $var(hjoin) = 0; lock("$tU"); $var(hjoin) = $sht(vtp=>join::$tU); $var(hstored) = $sht(vtp=>stored::$tU); $sht(vtp=>join::$tU) = $null; unlock("$tU"); if ($var(hjoin)==0) { if ($var(hstored)) ts_append("location", "$tU"); return; } $var(id_index) = $(var(hjoin){s.select,0,:}{s.int}); $var(id_label) = $(var(hjoin){s.select,1,:}{s.int}); xdbg("resuming trasaction [$var(id_index):$var(id_label)] $tU ($var(hjoin))n"); t_continue("$var(id_index)", "$var(id_label)", "INVRESUME"); } Kamailio World | © 2015 Orange Vallée TSILO: example
  • 23. # lookup and relay after resuming transaction route[INVRESUME] { lookup("location"); t_relay(); ts_store(); $sht(vtp=>stored::$rU) = 1; xdbg("stored transaction [$T(id_index):$T(id_label)] $fU => $rUn"); } Kamailio World | © 2015 Orange Vallée TSILO: example
  • 24. Kamailio World | © 2015 Orange Vallée Multi-device without Push & TSILO
  • 25. Kamailio World | © 2015 Orange Vallée Multi-device with Push & TSILO
  • 26. • Stats • More RPC commands • USRLOC callbacks? Kamailio World | © 2015 Orange Vallée TSILO: improvements