The return codes have a special interpretation in the config file:
* >0 - is true
* <0 - is false
* =0 - exit config file execution
http://www.asipto.com/pub/kamailio-devel-guide/#c16return_values
I guess perl_exec() returns what is returned from the perl script.
Cheers,
Daniel
On 02/05/14 02:01, James Cloos wrote:
Given this code in .cfg:
if (!perl_exec("verify", "route_LOCATION")) {
xlog("L_INFO", "Invite verify failed for ruri: $ru\n");
sl_send_reply("403", "Not Allowed");
exit;
}
if the perl function returns 1 everything proceeds nicely (skipping the if
block as as expected).
But should the perl function return 0 (which seemed like the right choice
for failure) the call fails to progress; the if block does not run, and
nothing else does either. The INVITing sip client retries and times out.
I had to return a negative value to get the if block to run.
Expected? Or bug?
(Running deb's sid build on amd64.)
-JimC
--
James Cloos <cloos(a)jhcloos.com> OpenPGP: 0x997A9F17ED7DAEA6
_______________________________________________
sr-dev mailing list
sr-dev(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
--
Daniel-Constantin Mierla -
http://www.asipto.com
http://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda