I am running a script in the GUI Post Call Recording Script window
/var/lib/asterisk/bin/sortcalls1.sh ^{CALLFILENAME}.^{MIXMON_FORMAT} ^{MIXMON_DIR}
New 2.9 ISO load from the FreePBX Site.
I am running a sortcalls1.sh that previously worked on a 2.7 box.
Here is the script:
#!/bin/sh
TODAY=`date +'%Y_%m'`
#echo "Today $TODAY" >> $2calls.logdate >> $2calls.log
#mkdir -p $2/$TODAY
#ln /var/spool/asterisk/monitor/$TODAY* /var/spool/asterisk/monitor/$TODAY
date >> $2calls.log
DATE=`date -r $2$1 +'%Y%m%d'`
mkdir -p $2$DATE
UNIQUEID=`echo $1 |sed "s/.*\-\([.0-9]*\)\.[a-zA-Z]*$/\1/"`
FILETYPE=`echo $1 |sed "s/.*\-[.0-9]*\(\.[a-zA-Z]*$\)/\1/"`
NEWFILE=`/usr/bin/mysql -u asteriskuser -pS29PoLwX91XR -N -B -D asteriskcdrdb -e "SELECT CONCAT(DATE_FORMAT(calldate,'%Y%m%d-%H%i%s'),'-',clid,'-',dst) FROM cdr WHERE uniqueid = $UNIQUEID LIMIT 1"|sed -e "s/\s/_/g" -e "s/_$/$FILETYPE/" -e 's/["<>]//g' `
if [ -z $NEWFILE ] ;then
NEWFILE=$1
else
NEWFILE=$NEWFILE.wav
fi
echo "author $NEWFILE"
#NN=`echo $NEWFILE`|sed 's/-/_/g'
#echo $NN
echo "linking $2$1 to $2$DATE/$NEWFILE" >>$2calls.log
if [ ! -f $2$DATE/$NEWFILE ] ;then ln $2$1 $2$DATE/$NEWFILE;fi
#cd $2/$DATE
#echo "will ftp" >> $2calls.log
#/var/lib/asterisk/bin/put.exp $NEWFILE >> $2calls.log
#cd $2
#fi
I have also used -u freepbxuser with the same -p and I get the same results as I have pasted below. I would like to run this as root, as that is how I was doing it before, but it will not let me. I tried to change the mysqlroot password with commands I found on one of the forums and it seemed to work, but I get the same results if I put root and the new root password I set. Here is what happens:
[root@ystems bin]# vi sortcalls1.sh
[root@ystems bin]# amportal restart
Please wait...
/usr/local/sbin/amportal: line 46: export: `\^\{CALLFILENAME\}.\^\{MIXMON_FORMAT\}': not a valid identifier
/usr/local/sbin/amportal: line 46: export: `\^\{MIXMON_DIR\}': not a valid identifier
/var/lib/asterisk/bin/freepbx_engine: line 98: export: `\^\{CALLFILENAME\}.\^\{MIXMON_FORMAT\}': not a valid identifier
/var/lib/asterisk/bin/freepbx_engine: line 98: export: `\^\{MIXMON_DIR\}': not a valid identifier
STOPPING ASTERISK
All calls will be dropped once the timer hits 0. To cancel, press CTL-C
Asterisk ended with exit status 0
Asterisk shutdown normally.
Asterisk Stopped
STOPPING FOP SERVER
SETTING FILE PERMISSIONS
Permissions OK
STARTING ASTERISK
Asterisk Started