System command

Does somebody know why this isn’t working ???
I like to record calls Monitor in wav format
and then make them in mp3 format. with lame in a shell script
If I echo all the shell command it looks good.

${CALLFILENAME} is correct, also transport ok to the shell script.
echo $1 >> logfile is okay in the shell script.

echo “/usr…lame -f -quiet …$1.wav …$1.mp3” >> logfile looks okay.

Running asterisk 1.4 as root or as asterisk both the same problem.
No errors in logfile.

I don’t know, I don’t know :blush: :imp: :smiling_imp:

extentions.conf
exten => 15,1,Set(CALLFILENAME=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)})
exten => 15,2,Monitor(wav,${CALLFILENAME},m)
exten => 15,3,DateTime()
exten => 15,4,System(/root/makemp3.sh ${CALLFILENAME})
exten => 15,5,Hangup

makemp3.sh
#!/bin/sh
/usr/local/bin/lame -f --quiet /var/spool/asterisk/monitor/$1.wav /var/spool/asterisk/monitor/$1.mp3

Have you tried to quote the command in System()?

exten => 15,4,System(!/root/makemp3.sh ${CALLFILENAME})

Before test with the above sugestions
– Executing [15@from-sip:4] System(“SIP/1234-093ca378”, “/root/makemp3.sh 1234-15-20070514-115015”) in new stack

include the sugestions :

Sugestion 1 with quotes gives a warning now it’s double quoted
[May 14 11:48:10] WARNING[27739]: app_system.c:105 system_exec_helper: Unable to execute ‘"/root/makemp3.sh 1234-15-20070514-114801"’

Sugestion 2 give the following error :
– Executing [15@from-sip:4] System(“SIP/1234-0941c528”, “!/root/makemp3.sh 1234-15-20070514-114622”) in new stack
[May 14 11:46:31] WARNING[27670]: app_system.c:105 system_exec_helper: Unable to execute ‘!/root/makemp3.sh 1234-15-20070514-114622’

Thanks for your help

STILL don’t know why this isn’t working.
AARGGHHHHHHH

If anyone can tell me why i send him a cold beer
:laughing:

Check the basics. It could just be a permissions problem with the shell script.

Login as root, and go to the shell script.

Do a chmod to give all users (like asterisk) execute permissions.

You might also need write permissions to the new directory location.

Also, any error message in the original command?

Not any errors.
In the makemp3.sh shell script i put the line
echo $1 >> makemp3.log
and this works fine striange isn’t it !!!

makemp3.sh
#!/bin/sh
/usr/local/bin/lame -f --quiet /var/spool/asterisk/monitor/$1.wav /var/spool/asterisk/monitor/$1.mp3
echo $1 >> makemp3.log

lame hase rights to everyone and running asterisk as root for now

extentions.conf
exten => 15,1,Set(CALLFILENAME=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)})
exten => 15,2,Monitor(wav,${CALLFILENAME},m)
exten => 15,3,DateTime()
exten => 15,4,System(/root/makemp3.sh ${CALLFILENAME})
exten => 15,5,Hangup