2

This is the code in my .conf file for asterisk freepbx I know for sure blocked is true

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")

This is the logs from asterisk saying Blocked is true

[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

Any Idea why its not branching correctly?

koyaanisqatsi
  • 2,585
  • 2
  • 8
  • 15
M Suhayl
  • 27
  • 5
  • Please take care to tag your questions correctly. This question is nothing to do with PHP or FreePBX. – miken32 Oct 28 '21 at 15:33

1 Answers1

1

Unfortanly asterisk know nothing about machine learning etc and does not think that

"true" == "TRUE"

In this case both are strings and strings with capitals not the same as lower strings(see UTF-8 table).

Even more, asterisk's boolean value is 1(integer)

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

arheops
  • 15,544
  • 1
  • 21
  • 27