i would like to have an fr_inv_timer functionality on inbound INVITEs.
the only way i imagine this to work is to use timer module, set a predefined timer value, and when reaching that value after the INVITE, execute a ROUTE that cancels the callee and sends a 500 or timeout message back to the caller.
problem is, the timeout value for module is static. i need the timeout to be dynamic for different callers.
are there any other methods on achieving this?
Kelvin Chua
Take a look at the following module parameters: http://kamailio.org/docs/modules/4.1.x/modules/tm.html#fr_timer_avp http://kamailio.org/docs/modules/4.1.x/modules/tm.html#fr_inv_timer_avp
Regards, Ovidiu Sas On Jan 2, 2014 12:03 AM, "Kelvin Chua" kelchy@gmail.com wrote:
i would like to have an fr_inv_timer functionality on inbound INVITEs.
the only way i imagine this to work is to use timer module, set a predefined timer value, and when reaching that value after the INVITE, execute a ROUTE that cancels the callee and sends a 500 or timeout message back to the caller.
problem is, the timeout value for module is static. i need the timeout to be dynamic for different callers.
are there any other methods on achieving this?
Kelvin Chua
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
Not only that, but there is also the t_set_fr() module function that lets one change the values of fr_timer and fr_inv_timer dynamically:
http://kamailio.org/docs/modules/4.1.x/modules/tm.html#tm.f.t_set_fr
However, the arguments seem to be static integers, not string values, so I am not sure the function will take PVs as arguments. In that light, the AVP approach might make more sense.
-- Alex
On 01/02/2014 01:03 AM, Ovidiu Sas wrote:
Take a look at the following module parameters: http://kamailio.org/docs/modules/4.1.x/modules/tm.html#fr_timer_avp http://kamailio.org/docs/modules/4.1.x/modules/tm.html#fr_inv_timer_avp
Regards, Ovidiu Sas
On Jan 2, 2014 12:03 AM, "Kelvin Chua" <kelchy@gmail.com mailto:kelchy@gmail.com> wrote:
i would like to have an fr_inv_timer functionality on inbound INVITEs. the only way i imagine this to work is to use timer module, set a predefined timer value, and when reaching that value after the INVITE, execute a ROUTE that cancels the callee and sends a 500 or timeout message back to the caller. problem is, the timeout value for module is static. i need the timeout to be dynamic for different callers. are there any other methods on achieving this? Kelvin Chua _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
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
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.
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.
Kelvin Chua
On Thu, Jan 2, 2014 at 2:21 PM, Alex Balashov abalashov@evaristesys.comwrote:
Not only that, but there is also the t_set_fr() module function that lets one change the values of fr_timer and fr_inv_timer dynamically:
http://kamailio.org/docs/modules/4.1.x/modules/tm.html#tm.f.t_set_fr
However, the arguments seem to be static integers, not string values, so I am not sure the function will take PVs as arguments. In that light, the AVP approach might make more sense.
-- Alex
On 01/02/2014 01:03 AM, Ovidiu Sas wrote:
Take a look at the following module parameters:
http://kamailio.org/docs/modules/4.1.x/modules/tm.html#fr_timer_avp http://kamailio.org/docs/modules/4.1.x/modules/tm.html#fr_inv_timer_avp
Regards, Ovidiu Sas
On Jan 2, 2014 12:03 AM, "Kelvin Chua" <kelchy@gmail.com mailto:kelchy@gmail.com> wrote:
i would like to have an fr_inv_timer functionality on inbound INVITEs. the only way i imagine this to work is to use timer module, set a predefined timer value, and when reaching that value after the INVITE, execute a ROUTE that cancels the callee and sends a 500 or timeout message back to the caller. problem is, the timeout value for module is static. i need the timeout to be dynamic for different callers. are there any other methods on achieving this? Kelvin Chua _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
list sr-users@lists.sip-router.org mailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
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
-- 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
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
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.comwrote:
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
On 01/02/2014 02:47 AM, Kelvin Chua wrote:
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)
To be honest, no, I don't think it's worth a feature request, because the complications of implementing something like this are not justified by the effectiveness of the solutions it offers to the sorts of problems you're identifying.
Since you mentioned sql_xquery(), it's worth noting that some of the database connector modules (e.g. db_mysql) offer a query timeout parameter:
http://kamailio.org/docs/modules/4.1.x/modules/db_mysql.html#idp1968288
-- Alex
ok noted. thanks alex.
Kelvin Chua
On Thu, Jan 2, 2014 at 3:51 PM, Alex Balashov abalashov@evaristesys.comwrote:
On 01/02/2014 02:47 AM, Kelvin Chua wrote:
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)
To be honest, no, I don't think it's worth a feature request, because the complications of implementing something like this are not justified by the effectiveness of the solutions it offers to the sorts of problems you're identifying.
Since you mentioned sql_xquery(), it's worth noting that some of the database connector modules (e.g. db_mysql) offer a query timeout parameter:
http://kamailio.org/docs/modules/4.1.x/modules/db_mysql.html#idp1968288
-- 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