I'm trying to make a call using a call file on asterisk where it plays a file and hangs up after a given time whether the sound file has finished or not.
I have it working with this bash script as the AGI script:
#!/bin/bash
Duration="30"
file="sound.mp3"
while read VAR && [ -n ${VAR} ] ; do : ; done
echo "ANSWER"
read RESPONSE
echo 'SET AUTOHANGUP $Duration'
echo 'EXEC PLAYBACK "'$file'" ""'
read RESPONSE
exit 0
The problem is that the asterisk cdr logs show the call to last 30 seconds whether the the person on the other end has hung up or not...
Can anyone help?