[sr-dev] Patch allowing app_lua lua_run to return values

Daniel-Constantin Mierla miconda at gmail.com
Fri Aug 26 09:45:29 CEST 2011


Hi Nathan,

thanks for the patch. It will get in, but not sure yet if for 3.2.0, we 
are in testing phase. The patch is not that big, I will evaluate and see 
if there is any major impact. Ultimately it will be in next version.

Daniel

On 8/25/11 9:31 PM, Nathan Angelacos wrote:
> Enclosed is a small patch that allows lua_run() to return an integer 
> value.  If the return value is not an integer, 1 is returned (like is 
> true with current git master.) As a side effect, lua scripts can now 
> exit() the sip-router script by returning 0.
>
>
> Example:
>
> Lua script:
> test_equality = function ( a , b )
>   if a == b then
>     return 1
>   else
>     return -1
> end
>
> sip-router script:
>
> if (lua_run("test_equality", "$fU", "$tU")) {
>  xdbg("SCRIPT: The values are equal\n");
> }
>
>
>
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20110826/6ba5f19d/attachment.htm>


More information about the sr-dev mailing list