Hello,
I am running kamailio 3.1.3 and I am making some tests with the exec
module. I am running a "dummy" script and it worked like a charm.
Now, I am testing what happens when the script takes "too much time" to
return a result. According to exec module documentation the
time_to_kill parameter should take care of it.
time_to_kill (INTEGER)
Specifies the longest time a program is allowed to execute. If the
time is exceeded, the program is killed.
BTW ... I am assuming time is in milliseconds. I think the
documentation should refer the time units.
Apparently kamailio ignores this parameter (or it doesn't work as I am
expecting). No matter which value I assign to time_to_kill,
kamailio doesn't kill the script and waits for the script to finish. In
the meanwhile some SIP timers are triggered ... resulting into a failed
call.
The test I am doing is quite simple. For incoming INVITEs, use a
external script to check the status of a specific test user, if it
returns the keyword "busy" sends it to voicemail otherwise route the
INVITE to the local user. The test script returns a result after about
8 seconds.
Shouldn't the time_to_kill be triggered and stop the script?
Here goes some relevant parts of my configuration. In attachment I am
sending the kamailio log with a debug value of 4.
# ----- exec params -----
modparam("exec", "time_to_kill", 10)
# --- exec params end -----
#route just to check the exec module
route[TESTEXEC] {
xlog("L_INFO", "TESTEXEC: Entered ($rU)\n");
if ($rU == "miguel")
{
$var(calendarTMP)="/root/" + $rU + "_test.pl";
exec_avp("$var(calendarTMP)", "$avp(s:test)");
xlog("L_INFO", "TESTEXEC: Returned value is
$avp(s:test)\n");
if ($avp(s:test) == "busy") {
$ru = "sip:userbusy@" + ASTSERVIPPORT;
# Voicemail
route(RELAY);
}
}
xlog("L_INFO", "TESTEXEC: Exiting ($rU)\n");
return;
}
Regards,
Miguel Baptista