ExecIF always evaluate?

It seesm ExecIF will execute a SQL statement even if is false? I am using asterisk 11 and here is one of the example:

exten => _X!,n,ExecIF($[${DRowCnt}>1]?Set(DialString=${ODBC_SP_test(${testID})}))

so the issue is that even if ${DrowCnt}=1 which is not bigger then 1, it will still evalute the store procedure. Why is that?

thank you!

Variables, and functions, are substituted before the line is parsed for applications.

Hello David,

Hey thanks again for the help. but can you clarify a bit (I guess I am slow), what you mean by

“Variables, and functions, are substituted”

so are you saying that odbc funcation call will always get executed?

${xxxxx} and ${xxxxx(yyyy)} are replaced by their values/results.

Any ${…} construct will always get executed if the priority is reached.

You need to use explicit GoTo’s if you don’t want any side effects.