Read variable from file


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.
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(
exten => readserver,5,Hangup()


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

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