On 13.02.2012 16:31, Daniel-Constantin Mierla wrote:
Hello,

On 2/13/12 2:55 PM, Miguel Baptista wrote:
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.
thinking of the time when the module was implemented, the unit is second. Have you tried with a lower value, short enough to be visible in seconds time?

I didn't know if time is milliseconds or seconds. So, I tried several values: 1, 5, 10, 50, 100, 1000 ... But no change in kamailio's bahaviour. It doesn't kill the running script.
Should I send another log file with a lower time_to_kill value?

Cheers,
Daniel


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


_______________________________________________
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
    

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda