[sr-dev] [kamailio/kamailio] alias_db_lookup is returning `-1` if result is not found. Documentation implies it should return false. (#2517)

Daniel-Constantin Mierla notifications at github.com
Mon Oct 19 21:29:55 CEST 2020


The rules for evaluating the return code of the function does not apply for (pseudo-)variables, otherwise it will not be possible to use variables with value 0 in logical expressions.

This function evaluation is not common along other scripting languages, but it is how it was added at the beginning of the project and it has been kept for backward compatibility. Other scripting languages have their own oddities , like Lua using 1-based index, python using whitespace-based incremented blocks, etc ... one has to learn this bits as it starts using a new scripting language...

I extended the FAQ to highlight the behaviour for pseudo-variables vs functions return code.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2517#issuecomment-712393510
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20201019/a4cbd70b/attachment.htm>


More information about the sr-dev mailing list