2

这是我的 .conf 文件中用于星号 freepbx 的代码,我确信阻塞是真的

same => n,Noop(${Blocked})
same => n,GotoIf($["${Blocked}"=="TRUE"]?blah-ivr-v5-difficulties,s,1)
same => n,Noop("The code reaches here and doesnt hit the context at the top but its value is true")

这是来自星号的日志,说 Blocked 是真的

[2021-10-28 11:53:08] VERBOSE[11267][C-001e313b] pbx.c: Executing [s@blah-ivr-v5-pinreset-2:11] NoOp("SIP/blah-00245082", "true") in new stack

[2021-10-28 11:53:08] VERBOSE[11267][C-001e313b] pbx.c: Executing [s@blah-ivr-v5-pinreset-2:12] GotoIf("SIP/blah-00245082", "0?blah-ivr-v5-difficulties,s,1") in new stack

任何想法为什么它没有正确分支?

4

1 回答 1

1

不幸的星号对机器学习等一无所知,也不认为

"true" == "TRUE"

在这种情况下,两者都是字符串和大写的字符串与较低的字符串不同(参见 UTF-8 表)。

更重要的是,星号的布尔值是1(整数)

https://unicode-table.com/en/

http://www.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/asterisk-APP-B-89.html

https://wiki.asterisk.org/wiki/display/AST/Manipulating+Variables+Basics

于 2021-10-28T14:26:15.027 回答