<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    can you put the second parameter in between double quotes?<br>
    <br>
    I checked the sources and the second parameter can be specified as
    variable.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 28/01/15 06:22, Will Ferrer wrote:<br>
    </div>
    <blockquote
cite="mid:CA+pifNRUd4siq4N9biNW7EZ2fXknaxEV9xyL_xzw=X8rpHx6Tw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hi</div>
        <div><br>
        </div>
        <div>I am having an issue with the Async module. </div>
        <div><br>
        </div>
        <div>The async_route function doesn't seem able to take a
          dynamic value as is it's duration.</div>
        <div><br>
        </div>
        <div>The module docs states:  <span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">The
            sleep parameter represent the number of seconds to suspend
            the processing of a SIP request. Maximum value is 100. The
            parameter can be a static integer or a variable holding an
            integer.</span></div>
        <div><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify"><br>
          </span></div>
        <div><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">Docs
            here: </span><font color="#000000" face="Helvetica, Arial"><span
              style="font-size:12px"><a moz-do-not-send="true"
href="http://kamailio.org/docs/modules/4.2.x/modules/async.html#async.f.async_route">http://kamailio.org/docs/modules/4.2.x/modules/async.html#async.f.async_route</a></span></font></div>
        <div><font color="#000000" face="Helvetica, Arial"><span
              style="font-size:12px"><br>
            </span></font></div>
        <div><span
style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:12px;text-align:justify">However
            when I try:</span></div>
        <div><br>
        </div>
        <div>
          <div>async_route("WITHINDLG_DELAYED", $avp(buffer_duration) );</div>
        </div>
        <div><br>
        </div>
        <div>I get the following error when trying to restart kamailio:</div>
        <div><br>
        </div>
        <div>parse error in config file /etc/kamailio/switchsoftk</div>
        <div>amailio/includes/deployments/develop/callprocessing/../../../default.cfg,
          line 866, column 41-61: function async_route: parameter 2 is
          not constant ... failed!</div>
        <div><br>
        </div>
        <div>I also tried with $var instead of an AVP, and even tried
          having perl call the function (since we have gotten around
          this sort of limitation in the past using perl).</div>
        <div><br>
        </div>
        <div>Perl gives:</div>
        <div><br>
        </div>
        <div>
          <div style="">
            <div style="font-size:12.8000001907349px">Jan 24 03:27:07
              develop-callprocessing /usr/sbin/kamailio[1424]: ERROR:
              app_perl [kamailioxs.xs:289]: moduleFunc(): Module
              function 'async_route' is unsafe. Call is refused.</div>
            <div style="font-size:12.8000001907349px">Jan 24 03:27:07
              develop-callprocessing /usr/sbin/kamailio[1424]: ERROR:
              app_perl [kamailioxs.xs:986]:
              XS_Kamailio__Message_moduleFunction(): calling module
              function 'async_route' failed. Missing loadmodule?</div>
            <div style="font-size:12.8000001907349px"><br>
            </div>
            <div style="font-size:12.8000001907349px">I have gotten
              around this issue with a large if else structure like the
              following:</div>
            <div style="font-size:12.8000001907349px"><br>
            </div>
            <div style="">
              <div style=""><span style="font-size:12.8000001907349px">if
                  ($avp(buffer_duration) == 1) {</span></div>
              <div style=""><span style="font-size:12.8000001907349px"> 
                  async_route("WITHINDLG_DELAYED", 1);</span></div>
              <div style=""><span style="font-size:12.8000001907349px">}
                  else if ($avp(buffer_duration) == 2) {</span></div>
              <div style=""><span style="font-size:12.8000001907349px"><span
                    style="white-space:pre">  </span>async_route("WITHINDLG_DELAYED",
                  2);</span></div>
              <div style=""><span style="font-size:12.8000001907349px">.........</span></div>
              <div style=""><span style="font-size:12.8000001907349px"><br>
                </span></div>
              <div style=""><span style="font-size:12.8000001907349px">This
                  is messy but works for us.</span></div>
              <div style=""><span style="font-size:12.8000001907349px"><br>
                </span></div>
              <div style=""><span style="font-size:12.8000001907349px">The
                  bug is not blocking our progress due to this work
                  around but I wanted to post it any way incase it helps
                  improve the module.</span></div>
              <div style=""><span style="font-size:12.8000001907349px"><br>
                </span></div>
              <div style=""><span style="font-size:12.8000001907349px">All
                  the best.</span></div>
              <div style=""><span style="font-size:12.8000001907349px"><br>
                </span></div>
              <div style=""><span style="font-size:12.8000001907349px">Will
                  Ferrer</span></div>
              <div style=""><span style="font-size:12.8000001907349px"><br>
                </span></div>
              <div style=""><span style="font-size:12.8000001907349px">Switchsoft</span></div>
              <div style=""><span style="font-size:12.8000001907349px"><br>
                </span></div>
              <div style=""><span style="font-size:12.8000001907349px"><br>
                </span></div>
            </div>
          </div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>
          <div><br>
          </div>
        </div>
      </div>
      <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://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>