'Finding Keyed Numbers in Asterisk server

How can I get the numbers keyed by the user on Asterisk. There is an example I made, but I could not succeed in printing.

[customer]
exten => 100,1,NoOp(Test)
same => n,Read(DIGITSRESULT,/path/sound_file,3)
same => n,System(/bin/echo "${DIGITSRESULT}" >> /tmp/test.txt)
same => n,Hangup()


Solution 1:[1]

First of all never use System command if you need just write to the file. Asterisk have function FILE for that.

In your case most realistic cause is no permission for asterisk user to /tmp/ folder or /tmp/test.txt

For debug such issues stop asterisk daemon, after that start in console mode as

asterisk -vvvgc

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 arheops