<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    On 2/13/12 2:55 PM, Miguel Baptista wrote:
    <blockquote cite="mid:4F39165F.3060708@uninett.no" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      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>
    </blockquote>
    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?<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <blockquote cite="mid:4F39165F.3060708@uninett.no" type="cite">
      <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 moz-do-not-send="true"
            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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>