[SR-Users] Issue with non static values for sleep in the Async module
Daniel-Constantin Mierla
miconda at gmail.com
Wed Jan 28 13:55:58 CET 2015
Hello,
can you put the second parameter in between double quotes?
I checked the sources and the second parameter can be specified as variable.
Cheers,
Daniel
On 28/01/15 06:22, Will Ferrer wrote:
> Hi
>
> I am having an issue with the Async module.
>
> The async_route function doesn't seem able to take a dynamic value as
> is it's duration.
>
> The module docs states: 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.
>
> Docs
> here: http://kamailio.org/docs/modules/4.2.x/modules/async.html#async.f.async_route
>
> However when I try:
>
> async_route("WITHINDLG_DELAYED", $avp(buffer_duration) );
>
> I get the following error when trying to restart kamailio:
>
> parse error in config file /etc/kamailio/switchsoftk
> amailio/includes/deployments/develop/callprocessing/../../../default.cfg,
> line 866, column 41-61: function async_route: parameter 2 is not
> constant ... failed!
>
> 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).
>
> Perl gives:
>
> 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.
> 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?
>
> I have gotten around this issue with a large if else structure like
> the following:
>
> if ($avp(buffer_duration) == 1) {
> async_route("WITHINDLG_DELAYED", 1);
> } else if ($avp(buffer_duration) == 2) {
> async_route("WITHINDLG_DELAYED", 2);
> .........
>
> This is messy but works for us.
>
> 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.
>
> All the best.
>
> Will Ferrer
>
> Switchsoft
>
>
>
>
>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150128/10cfcf7e/attachment.html>
More information about the sr-users
mailing list