OK Asterisk gurus, here’s my problem. Working on a little project that goes like this:
Send DTMF command to ASL that calls a script. This script is also sending commands to another program.
Play an audio file over ASL indicating the function being performed.
Now the tricky part, wait until audio playback has completed before moving on to the next command in the script. Don’t want Allison’s lovely voice coming out of places she should not!
How can I do this? Seems like a simple task until you go to do it. I know there is a ${PLAYBACKSTATUS} variable in the system that returns SUCCESS or FAILURE, but not quite sure how to go about accessing it.
Typically Allison voice response only comes out on your talkback, not anything you are connected to. Does that eliminate your concern? If not maybe you can help understand your configuration and desired function.
Hi Tim,
This setup is actually part of a bridge to some digital modes. So there is a private node using chan_usrp that goes to my digital bridge. I connect to the private node either with iaxRPT or via public node and remote control it.
So whatever is played will go to the bridge too if I don’t mute it. So with a script I call a mute command for audio going to the bridge, do all my stuff and play a custom file to tell me what mode and so forth and then unmute the stream.
Here is where the problem comes in, the other commands are executed and the audio is still playing when it gets to the unmute command. I’ve put a sleep command of about 3 seconds in the script as a work around. Ugly and not a very good solution. What I’m looking for is an indication that playback has competed and we can now go ahead execute the next line in the script.
Hope that makes some sense,
Yes that helps explain the situation. It seems to me the app_rpt event management system is the wrong approach to this. But I could be wrong. Have you seen this wiki page? Also see this topic for event scripting example.
Is the digital bridge DVswitch and is the connection within DVSwitch? If so I can’t imagine the talkback side of app_rpt sending it’s telemetry to the digital side. But I know nothing about chan_usrp so I’m not going to be any help with that. Perhaps setting duplex=0 with linktolink=yes would help.
Thanks for the input guys. Steve that’s the way I’ve had it running since the beginning when it was just DMR to ASL on one TG. Since retirement I’ve been bored and playing around with adding additional modes. Thought it would be cool to let a few guys have access to it and add some feedback as to what mode and TG they were on. Well,as they say nothing is ever simple. The sleep command may not be very elegant, but it does work.
AGI looks like it may have some interesting possibilities, something new to investigate.