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

Cadence: Orchestration as Code
Cadence: Orchestration as CodeCadence: Orchestration as Code
Cadence: Orchestration as CodeMaxim Fateev
 
How to export import a mysql database via ssh in aws lightsail wordpress rizw...
How to export import a mysql database via ssh in aws lightsail wordpress rizw...How to export import a mysql database via ssh in aws lightsail wordpress rizw...
How to export import a mysql database via ssh in aws lightsail wordpress rizw...AlexRobert25
 
Introduction to OpenStack Trove & Database as a Service
Introduction to OpenStack Trove & Database as a ServiceIntroduction to OpenStack Trove & Database as a Service
Introduction to OpenStack Trove & Database as a ServiceTesora
 
Communication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/SubscribeCommunication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/SubscribeSumant Tambe
 
POCO C++ Libraries Intro and Overview
POCO C++ Libraries Intro and OverviewPOCO C++ Libraries Intro and Overview
POCO C++ Libraries Intro and OverviewGünter Obiltschnig
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with AnsibleRayed Alrashed
 
Red Hat Essentials
Red Hat EssentialsRed Hat Essentials
Red Hat Essentialsdjwallis
 
Introduction into Ceph storage for OpenStack
Introduction into Ceph storage for OpenStackIntroduction into Ceph storage for OpenStack
Introduction into Ceph storage for OpenStackOpenStack_Online
 
Mule Common Logging & Error Handling Framework
Mule Common Logging & Error Handling FrameworkMule Common Logging & Error Handling Framework
Mule Common Logging & Error Handling FrameworkVijay Reddy
 
Mininet multiple controller
Mininet   multiple controllerMininet   multiple controller
Mininet multiple controllerCatur Mei Rahayu
 
Linux, Apache, Mysql, PHP
Linux, Apache, Mysql, PHPLinux, Apache, Mysql, PHP
Linux, Apache, Mysql, PHPwebhostingguy
 
OpenStack vs VMware vCloud
OpenStack vs VMware vCloudOpenStack vs VMware vCloud
OpenStack vs VMware vCloudRoozbeh Shafiee
 
Ansible with oci
Ansible with ociAnsible with oci
Ansible with ociDonghuKIM2
 
Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?Chris Simmonds
 

What's hot (20)

Cadence: Orchestration as Code
Cadence: Orchestration as CodeCadence: Orchestration as Code
Cadence: Orchestration as Code
 
How to export import a mysql database via ssh in aws lightsail wordpress rizw...
How to export import a mysql database via ssh in aws lightsail wordpress rizw...How to export import a mysql database via ssh in aws lightsail wordpress rizw...
How to export import a mysql database via ssh in aws lightsail wordpress rizw...
 
Introduction to OpenStack Trove & Database as a Service
Introduction to OpenStack Trove & Database as a ServiceIntroduction to OpenStack Trove & Database as a Service
Introduction to OpenStack Trove & Database as a Service
 
Communication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/SubscribeCommunication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/Subscribe
 
POCO C++ Libraries Intro and Overview
POCO C++ Libraries Intro and OverviewPOCO C++ Libraries Intro and Overview
POCO C++ Libraries Intro and Overview
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Red Hat Essentials
Red Hat EssentialsRed Hat Essentials
Red Hat Essentials
 
Introduction into Ceph storage for OpenStack
Introduction into Ceph storage for OpenStackIntroduction into Ceph storage for OpenStack
Introduction into Ceph storage for OpenStack
 
Mule Common Logging & Error Handling Framework
Mule Common Logging & Error Handling FrameworkMule Common Logging & Error Handling Framework
Mule Common Logging & Error Handling Framework
 
Ipl process
Ipl processIpl process
Ipl process
 
History of Linux
History of LinuxHistory of Linux
History of Linux
 
Mininet multiple controller
Mininet   multiple controllerMininet   multiple controller
Mininet multiple controller
 
Linux, Apache, Mysql, PHP
Linux, Apache, Mysql, PHPLinux, Apache, Mysql, PHP
Linux, Apache, Mysql, PHP
 
Smpe
SmpeSmpe
Smpe
 
OpenStack vs VMware vCloud
OpenStack vs VMware vCloudOpenStack vs VMware vCloud
OpenStack vs VMware vCloud
 
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on KamailioAstricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
UNIX Operating System ppt
UNIX Operating System pptUNIX Operating System ppt
UNIX Operating System ppt
 
Ansible with oci
Ansible with ociAnsible with oci
Ansible with oci
 
Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?
 

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