<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 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>