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