ReadFile No application

Hello

I get an error like the one below. No application appears. I am using Asterisk version 16. Can you help me ?

[May 21 21:03:31] WARNING[31854][C-00000011]: pbx.c:2907 pbx_extension_helper: No application ‘ReadFile’ for extension (ob, s, 7)

Readfile() is gone. The function FILE is the replacement. See

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

thanks.

The file it read is one and zero. I want it to read an announcement when I read it. But it didn’t work.
What could be the problem?

exten => s,5,System(/tmp/stid.sh ${stid} > /tmp/log1.txt)

exten => s,6,Set(KKK=${FILE(/tmp/log1.txt,1,1,l)})

exten => s,7,ExecIf(["{KKK}" = 1 ]?Playback(/var/lib/asterisk/ivr/kres))

exten => s,8,HangUp()

Please post your dialplan snippet using 'Preformatted text' tags. As shown, you’re missing a couple of dollar signs, but not all, implying you either missed them when entering your dialplan or when you re-typed it into this forum.

If you use 'same = n' instead of 'exten = s,x' it will make your life easier.

If you add a line like 'same = n, verbose(KKK = @${KKK}@)' between lines 6 & 7 it may yield a clue.

If you post your console log (with verbose > 2) in 'Preformatted text' tags, it may also yield clues.

If the only use of /tmp/log1.txt is to get the output of stid.sh into your dialplan, consider 'same = n, set(KKK=${SHELL(/tmp/stid.sh)})'

I usually use double-quotes on both sides of a comparison, so you may want to consider that.

If you describe what your application is, you may get some relevant suggestions.

Make sure you’re getting the correct value on the KKK variable,
same=>n,verbose(${KKK} ) , also you can use linux awk or cat command in combination with the shell() function to get the the desired values

I have one more question. The number entered must be a maximum of 9 digits. If it is more or less than nine, I want to give an error message. How can I do that ?

who wrote this piece of code ?

Because if was you, you should know you should know the diference between = , > and !=

same=>n,ExecIf($[${LEN(${KKK})}!= “9”]?

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