agreed. the design of the db and queries are all properly tested, with only milliseconds of query time even for tables as large as millions of rows. i wanted to implement this only for insurance and was wondering if it's doable, theoretically speaking.

the timer module is promising although lacks dynamic assignment of timeouts. what i have in mind is:
  - do a timer_enable() after receiving an INVITE. 
  - on timeout, go to rourte[timeout], statelessly send a cancel to callee(if applicable) and 408 to caller.
  - OR upon getting a 200 OK from the callee's leg, disable the timer.
  - do you think this is worthy of a feature request? something like timer_enable(timer_id, enable_disable, timeout)

Kelvin Chua


On Thu, Jan 2, 2014 at 2:46 PM, Alex Balashov <abalashov@evaristesys.com> wrote:
On 01/02/2014 01:39 AM, Kelvin Chua wrote:

those timers are for INVITES sent by kamailio right? starting from
t_relay() of the INVITE
what i am looking for is, when i receive an INVITE, i start counting.

TM's timers - and anything else TM does - are reliant on a transaction existing.  A transaction is not created until t_relay() is called.


the reason behind is, with all the functions involving several
sql_xquery() involved to find out where to send the t_relay(),
there will be unforeseen delays which might cause a very high PDD for my
callers, i don't want them to wait.

Even if you had such a timer fire, your database query would still block the SIP worker thread that's handling the request route.

If you have database calls that could get hung for several hundred milliseconds, or even worse, several seconds, the solution to this problem is to fix your architecture and your database calls. Bluntly speaking, you're doing it wrong. No database calls or other external calls upon which Kamailio relies for call processing should be taking long enough to execute that PDD concerns are warranted, or that you should need timers to deal with them.

-- Alex


--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users