<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,<br>
<br>
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. <br>
Now, I am testing what happens when the script takes "too much time" to
return a result. According to exec module documentation the<i>
time_to_kill </i>parameter should take care of it.<br>
<blockquote><b>time_to_kill</b> (INTEGER)<br>
  <i>Specifies the longest time a program is allowed to execute. If the
time is exceeded, the program is killed. </i><br>
</blockquote>
BTW ... I am assuming <i>time </i>is in milliseconds. I think the
documentation should refer the time units.<br>
<br>
Apparently kamailio ignores this parameter (or it doesn't work as I am
expecting). No matter which value I assign to <i>time_to_kill</i>,
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.<br>
<br>
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.<br>
<br>
Shouldn't the <i>time_to_kill</i> be triggered and stop the script? <br>
<br>
Here goes some relevant parts of my configuration. In attachment I am
sending the kamailio log with a debug value of 4. <br>
<br>
<br>
<blockquote><i># ----- exec params -----</i><br>
  <i>modparam("exec", "time_to_kill", 10)</i><br>
  <i># --- exec params end -----</i><br>
</blockquote>
<br>
<br>
<br>
<blockquote><i>#route just to check the exec module<br>
route[TESTEXEC] {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_INFO", "TESTEXEC: Entered ($rU)\n");<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($rU == "miguel")<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $var(calendarTMP)="/root/" + $rU + "_test.pl";<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec_avp("$var(calendarTMP)", "$avp(s:test)");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_INFO", "TESTEXEC: Returned value is
$avp(s:test)\n");<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($avp(s:test) == "busy") {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ru = <a class="moz-txt-link-rfc2396E" href="sip:userbusy@">"sip:userbusy@"</a> + ASTSERVIPPORT;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# Voicemail<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(RELAY);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_INFO", "TESTEXEC: Exiting ($rU)\n");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br>
}<br>
  <br>
  </i></blockquote>
Regards,<br>
<br>
Miguel Baptista<br>
<div
 style="bottom: auto; left: 7px; right: auto; top: 154px; display: none;"
 title="Translating..." class="translator-theme-default"
 id="translator-popup-loading"></div>
</body>
</html>