Ticket #5361 (new Bugs)

Opened 2 years ago

Last modified 2 years ago

Post Call Recording Script error/bug

Reported by: franklin Assigned to: p_lindheimer
Priority: major Milestone: Undetermined
Component: Core Version: 2.9-branch
Keywords: Post Call Recording Script Cc: dollett@gmail.com
Confirmation: Unreviewed Distro:
Backend Engine: Asterisk 1.8 Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description (Last modified by mickecarlsson)

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				

Change History

09/13/11 00:39:14 changed by mickecarlsson

  • description changed.

09/17/11 20:41:23 changed by mbrevda

  • milestone changed from 2.10 to Undetermined.

Ultimatly

09/19/11 22:32:09 changed by franklin

[posted in forum] I am finally able to make my heretofore functioning script do its job by putting this in the Post Call Recording Script window: /var/lib/asterisk/bin/sortcalls1.sh {CALLFILENAME}.${MIXMON_FORMAT} /var/spool/asterisk/monitor/ (that's a space between the } /var)

It produces this on a tail -f /var/log/asterisk/full: == Executing [/var/lib/asterisk/bin/sortcalls1.sh OUT2000-20110919-172352-1316478232.6.wav /var/spool/asterisk/monitor/] And then this in the subfolders of /var/spool/asterisk/monitor/: root@pbx 20110919]# ls 20110919-172352-<user>_2000-<tendigphn#>.wav 20110919-173012-<user>_2000-<tendigphn#>.wav

I still get bitching on an amportal restart, though Please wait... /usr/local/sbin/amportal: line 46: export: `\\{CALLFILENAME\}.\$\{MIXMON_FORMAT\}': not a valid identifier /usr/local/sbin/amportal: line 46: export: `/var/spool/asterisk/monitor/': 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: `/var/spool/asterisk/monitor/': not a valid identifier

STOPPING ASTERISK All calls will be dropped once the timer hits 0. To cancel, press CTL-C Asterisk Stoppedrisk to Stop 120

STOPPING FOP SERVER SETTING FILE PERMISSIONS Permissions OK

STARTING ASTERISK

I still think there is a bug. Can any of the developers comment? Thank you very much