Read variable from file

Hi,

I would like to configure my /etc/asterisk/extensions_custom.conf to read a variable from a file.
That file will have a value (numbers) that are supposed to be heard on the phone call.
It’s almost done… I just can’t figure out how to read the variable… My application is like this:

The problem is on line 2 - setting the variable…that file is only digits inside.
[custom-read-server]
exten => readserver,1,Answer
exten => readserver,2,Set(temperature=$[system(cat /etc/scripts/temperature.txt)])
exten => readserver,3,SayNumber(${temperature},f)
exten => readserver,4,AGI(teste_eduardo.sh)
exten => readserver,5,Hangup()

Thanks.

On phone and have no way to test. Could it be you need Curly braces around the system command?

https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Function_FILE

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.