Voicemail - playing messages in reverse order

Client saves a lot of old messages. Currently the system plays saved messages from oldest to newest. Is there a way to play the messages from newest to oldest?

http://lists.digium.com/pipermail/asterisk-users/2009-May/232193.html

derivitively, perhaps recompile app-directory with

reordered = 1

But as a pragmatist, I would suggest you use human engineering to coerce your “client” to just “not do that shit”, even if he is (my guess) your humilty impaired CEO :slight_smile:

call this like “script 2222/Old”

#!/bin/bash
cd /var/spool/asterisk/default/$1
k=ls *.txt|wc -l
for ((n=0;n< k;n++))
do FIRST=printf %04d $n
LAST=printf %04d $(($k - $n -1))
if [ $FIRST -ge $LAST ]; then break;fi
mv msg$FIRST.txt msgtmp.txt
mv msg$LAST.txt msg$FIRST.txt
mv msgtmp.txt msg$LAST.txt
mv msg$FIRST.wav msgtmp.wav
mv msg$LAST.wav msg$FIRST.wav
mv msgtmp.wav msg$LAST.wav
mv msg$FIRST.WAV msgtmp.WAV
mv msg$LAST.WAV msg$FIRST.WAV
mv msgtmp.WAV msg$LAST.WAV

add sections for other formats used

mv msg$FIRST.gsm msgtmp.gsm

mv msg$LAST.gsm msg$FIRST.gsm

mv msgtmp.gsm msg$LAST.gsm

done
echo “thanks for that dicko!!”

if you want to piss him off, then run it twice :wink: