Hi. In a hangup handler, is there a way to determine whether a channel was ever bridged? BRIDGEPEER variable is cleared by this point.
I need this because Asterisk creates empty recording files even if MixMonitor was started with “b” option. I want to delete recordings for channels that were not bridged.
Right, but you can test the state of the file in the script you execute from MixMonitor.
This is just an example of testing the file in bash.
#!/bin/bash
FILENAME=$1
SRCDIR=/var/spool/asterisk/monitor
if [[ -s $ASTMONDIR/$FILENAME.wav ]]
then
echo "File exists and is not empty";
else
echo "File is empty";
The problem is, the file is not zero-size. Asterisk writes something, probably file headers, and the content certainly depends on the audio format. Examining that is not trivial. There has to be an easier solution.