Record file

Sir,

I have use monitor to record call and when call finish on the basis i have add record file name in script and and of the day when we excute this script than it will transfer record file from /var/spool/asterisk/monitor directory to /home/asterisk all is working fine except i have seen the record file is more than record in script means all record information will not store in script below is the extensions.conf setting. will you please guide whats wrong or missing so all information will not store in script.

exten => s,1,Set(CALLFILENM=${CALLERID(num)}-${STRFTIME(${EPOCH},%d-%m-%Y-%T)},CALLTI=${STRFTIME(${EPOCH},%d-%m-%Y-%T)},AAJ=${STRFTIME(${EPOCH},%d-%m-%Y)})
exten => s,2,Monitor(wav,${CALLFILENM},m)
exten => s,3,SIPAddHeader(Alert-Info: )
exten => s,4,Dial(SIP/21&SIP/23&SIP/12&SIP/14,40,Tt)
exten => s,5,Dial(SIP/16,10,Tt)
exten => s,6,Playback(vm-nobodyavail)
exten => s,7,Hangup()
exten => h,1,Set(TST=${CDR(dstchannel):4:2})
exten => h,2,System(echo “/bin/cp /var/spool/asterisk/monitor/${CALLFILENM}.wav /home/asterisk/${TST}-${CALLTI}.wav” >> /tmp/${AAJ}.record)
exten => s,103,Dial(SIP/16,10,Tt)
exten => s,104,Dial(SIP/0,10,Tt)
exten => s,105,Playback(vm-isonphone)
exten => s,106,Hangup()
exten => h,1,Set(TST=${CDR(dstchannel):4:2})
exten => h,2,System(echo “/bin/cp /var/spool/asterisk/monitor/${CALLFILENM}.wav /home/asterisk/${TST}-${CALLTI}.wav” >> /tmp/${AAJ}.record)
exten => s,204,Dial(SIP/9,20,Tt)
exten => s,205,Playback(vm-isonphone)
exten => s,206,Hangup()
exten => h,1,Set(TST=${CDR(dstchannel):4:2})
exten => h,2,System(echo “/bin/cp /var/spool/asterisk/monitor/${CALLFILENM}.wav /home/asterisk/${TST}-${CALLTI}.wav” >> /tmp/${AAJ}.record)

Rajeev.

Please help.

Rajeev.

Take out the echos and the associated double quotes.

Do you really want to copy (cp), rather than rename (mv)?

Sir,

I have to add this line into a text file if a have remove echo and double quotes than how i have to add this statement in script file.

Rajeev.

Try and use a variable to store directly the recording on the desired system directory :

exten => s,n,Set(DIREC=/home/asterisk)
exten => s,n,Monitor(wav,${DIREC}/${CALLFILENM},m)

Hope this fixes your problem.

Regards,

Joao Cohen
Telecom Systems and Audiotext Specialist
linkedin.com/in/joaocohen

Actully when call receive than it will ring four extension and i don’t know wihich extension pick up the call so when call finished then i have to rename that file with the help of script. So, if i have directly store file so i am unable to know which extension have receive that call.

Rajeev.