Conditional Applications/Functions Not Working

Installing Asterisk v18.0.1 on Centos 7.9.2009 (Kernel 3.10.0-1127.el7.x86_64) and try to implement these simple dialplan

[default]
exten => *100,1,NoOP(Hello there)
 same => n,ExecIf($["${CALL_ORIGIN}"="APP"]?nemo)
 same => n,Playback(vm-welcome)
 same => n,Hangup()

ExecIf("PJSIP/100-00000001", "nan?nemo")

The conditional " ["{CALL_ORIGIN}"=“APP”] " returns “nan” instead of zero. Is this a known issue on the latest version of Asterisk?

If expr is true, execute and return the result of appiftrue(args) .

If expr is true, but appiftrue is not found, then the application will return a non-zero value
,
in you case as nemo is not a found it should return non-zero, unless something changed

The problem is in the macro expansion of the expression; one would expect it to expand to 0 or 1, not to Not-a-Number. That happens even before the ExecIf application is entered.

2 Likes

This problem is due to a bug in the latest version of the glibc library (version 2.17-322.el7_9). The solution is to downgrade:
Go to console:

yum downgrade glibc-devel glibc glibc-common glibc-headers

systemctl restart asterisk

3 Likes

I know that “nemo” is not an application, the issue here is that the conditional function “ExecIf” returns “nan” instead of “true” or “false”.

As rcuadra said, this happens when you install the Glibc library with version 2.17.322, so, downgrading this library to version 2.17-317 fix the issue.

2 Likes

https://sourceware.org/bugzilla/show_bug.cgi?id=26649