IP PBX ForumCategory: Bug ReportMIXMONITOR variables bug
Alessio POzzatoAlessio POzzato asked 6 years ago
I tried to run a post record script in bash but the pbx don’t pass the mixmonitor variable to the script. In fact I want receive a mail with attacched the recording file. with my script I receive the mail but all the mixmonitor variables into the mail are blank. It seems that the mixmonitor variables are not passed to the bash script. Is there a workaround or is a bug?
this is the my post recording script line in the guy
/usr/share/asterisk/agi-bin/postrecording.sh ^{TIMESTR} ^{FROMEXTEN} ^{CALLFILENAME} ^{UNIQUEID} ^{ARG3}
and this is the bash scrypt
#!/bin/bash
#This script emails the recorded call right after the call is hung up. Below are the variables passed through asterisk
# $1 – Time String
# $2 – Source
# $3 – File
# $4 – unique id
# $5 – Destination
# $dt – Date and Time
/bin/sleep 3
dy=$(date ‘+%Y’)
dm=$(date ‘+%m’)
dd=$(date ‘+%d’)

dt=$(date ‘+%m/%d/%Y %r’);
echo $dt
echo -e “You have a new call recording to listen to \n\n
The call date and time was $dt \n\n
The call was from $2 \n\n
The call was to $5 \n\n
And the unique call id was $4\n\n
Please see the attached file \n\n” | mail -a /var/spool/asterisk/monitor/$dy/$dm/$dd/$4 -s “New Call Recording” mymail@domain.com
Eyal OrenEyal Oren
Staff replied 6 years ago

Hi Allesio

Look like you are using wring parameters , please try:
/usr/share/asterisk/agi-bin/postrecording.sh ^{REC_FILENAME} ^{DESTINATION_NUMBER} ^{CALL_SOURCE}

So $1 will be full path of file
$2 the caller
$3 destination

1 Answers
Alessio POzzatoAlessio POzzato answered 6 years ago
Hi Eyal
thanks for your suggestion now is working. can you give me a link or document where I can find a full list of these variables considering that are different from the aasterisk standard?