[SR-Users] t_suspend usage in branch_route

Vasiliy Ganchev vancecezar at gmail.com
Fri Feb 9 10:00:20 CET 2018

I am glad that you have something working, but I think you will have some
issues with your approach.

Some important point regarding push/suspending etc. that I would like to
emphasize and point your attention:

1.The modern mobile devices - put your SIP app to "sleep" quite fast. The
TCP/TLS connection is closed. (are you using UDP?)

2. So if your location prevents non-alive registrations to live there you
possibly need:
  - have a long "Expires" in registration. (remember your app is
sleeping/killed most of the time, and is unable to refresh the registration)

3. When your location has "non alive registration", after t_relay - INVITE
will be forked to all branches (including that "non alive"). How can you
know that the registration is alive? 
 - a possible case - is to send push for every call, without paying
attention on "aliveness" of the registration 
 Drawback: your app will have to handle case when SIP INVITE and push arrive
at the same time (usually it will by firstly SIP, and in few seconds push)

So my approach to push in kamailio:
1. use short "Expires", (300s) - to remove non-refreshed registration from
location asap.

2. store all the necessary push data to "htable".  (while REGISTER
   (actually I have 2 tables: 
     a) extension as a key, and list of instances as a value
     b) instance as a key, and all parameters as a value (here is token,
type, version etc.)

3. When INVITE comes 
 a) make lookup(location)
 b) check if there is something found in location (remember you may have no
registrations, but there still may be devices that support push and can be
  b1) NO records in location - t_suspend and push send
  b2) ts_store and relay to alive branches. When REGISTER from push device
comes - ts_append

So  the answer to your initial question - ts_suspend is never done in
branch_route, as we get there only if there are valid registrations (and
there is no suspend needed)

Hope my insight helped. Good luck in your pushing.

and of course most of the text above is not my invention, but it is based on
Daniel/Federico's job. Their presentations are what was my insight when I
developed push in our solution:


Sent from: http://sip-router.1086192.n5.nabble.com/Users-f3.html

More information about the sr-users mailing list