Since starting to use Trixbox our company has needed a way to port over a feature from our previous PBX system. That capability was to allow the PBX to call a list of numbers after a voicemail was left. We used this feature primarily for an After Hours paging system.
Anyway, looking around the forums and google I couldn't find what I needed until I found this link: http://www.voip-info.org/wiki/view/Asterisk+Voicemail+Notify+for+...
It had what I needed with modifications. Posted below is the instructions and code on those modifications.
Create a File in folder /etc/ VMNotify.sh - Paste Code below.
Make sure you make VMNotify.sh executable: chmod +x /etc/VMNotify.sh
VMBox="5100" #Enter Extension/Voice Mail Box Here
CALLLIST=("1805XXXXXXX" "1805XXXXXXX") #Enter Phone Numbers to call
CallTimes=2 #How many times to call Each number Before going to next.
CallMinutes=5 #How many minutes between each call
CallFinal=1 #How many times to call calllist before quiting. Enter 0 for unlimited
OutboundChannel="SIP/SipTrunk/" #The Trunk to outdial from
#*************Do Not Change Below Variables******************
LOCKFILE=/tmp/outdial.lock
MESSAGEFILE=/var/spool/asterisk/voicemail/default/${VMBox}/INBOX/msg0000.txt
CALLFILE=/tmp/outdial.call
CALLUSER=asterisk
OUTGOING=/var/spool/asterisk/outgoing/
x=0
Limit=${#CALLLIST[*]}
#************************************************************
if [ -f $LOCKFILE ];
then
echo -f $LOCKFILE
echo exit
exit 0
fi
touch $LOCKFILE
function callgroup {
for (( i = 0; i
do
for (( j = 0; j
do
if [ -f $MESSAGEFILE ];
then
echo $MESSAGEFILE exists!
echo calling ${CALLLIST[$i]}
echo Channel: ${OutboundChannel}${CALLLIST[$i]} >> $CALLFILE
echo "CallerID: After Hours
echo MaxRetries: 0 >> $CALLFILE
echo RetryTime: 60 >> $CALLFILE
echo WaitTime: 30 >> $CALLFILE
echo Context: from-internal >> $CALLFILE
echo Extension: 5682 >> $CALLFILE
echo Priority: 1 >> $CALLFILE
chown $CALLUSER:$CALLUSER $CALLFILE
chmod 664 $CALLFILE
echo moving $CALLFILE to $OUTGOING
mv $CALLFILE $OUTGOING
else echo No MV
rm -f $LOCKFILE
exit
fi
sleep ${CallMinutes}m
done
done
}
while [ $x -lt $CallFinal ]
do
if [ $CallFinal -eq 0 ];
then
x=0
else
((x=x+1))
fi
callgroup
done
rm -f $LOCKFILE
--------------------------------------
edit file /etc/crontab
This will run VMNotify.sh every 5 minutes
paste this line:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /etc/VMNotify.sh
--------------------------------------
Edit extensions_custom.conf
Add this chunk of text to file. I just placed it at bottom of file.
Make sure to replace the 5100 value with the Voicemail/Entension you want monitored.
exten => 5682,1,Answer
exten => 5682,n,Wait(3)
exten => 5682,n,Macro(user-callerid)
exten => 5682,n,Playback(it-services)
exten => 5682,n,Macro(get-vmcontext,5100)
exten => 5682,n,VoiceMailMain(5100@${VMCONTEXT})
exten => 5682,n,Macro(hangupcall)
Member Since:
2007-01-03