My goal is to listen to announcements according to a verification code entered on incoming calls.
I did something for that below. My problem is not being able to listen to announcements after verification. What I want to do is to listen to a different announcement if it is true and not an announcement. Bash script verifies. If it is true, it writes 0 if it is not 1.
If it says 1, listen to announcement A. If it says 0, I want to listen to the B announcement. Bash script writes 0 or 1 in a text file.
You play ob1.
You read a ‘#’ terminated string of digits into a variable named digits.
You execute a Bash script, passing a variable named digit (not digits?) and write the output to a log file.
You hang up.
How do you think your script is telling Asterisk if digit is something or not?
Where in your dialplan do you do anything to listen to announcement A or B?
The OP used playback() and you suggested that if he used read() correctly, he wouldn’t need playback(). I was merely pointing out that the caller experience would be different since an entry interrupts read() like it does background(), not that background() could replace read().
I do see some issues in your dialplan and I would place ob1 audio in Read itself but if I understand your question correctly then basically you can do something like this.
Then, if you need help, please post your dialplan using 'dialplan show ’ and ‘preformatted text’ tags followed by a console log (with debug and verbose set to least 3) in preformatted text tags.