I had research this and … sucessfull !
-
By default the extensions_additional.conf file do not edit by hand, because freePBX will auto reload default format (you can show this notice at first line of this file)
-
All of first you have to change the permission of file is 464 (not write)
-
After that , we have files need interested :
_ extensions.conf (/etc/asterisk/)
_ extensions_additional.conf (/etc/asterisk/)
_ recordingcheck (/var/www/html/admin/modules/core/agi-bin)
-
Let begin configure : add new lines to these context.
:::: extensions.conf :::::
[macro-record-enable]
include => macro-dialout-trunk
exten => s,1,GotoIf($[${LEN(${BLINDTRANSFER})} > 0]?2:4)
exten => s,2,ResetCDR(w)
exten => s,3,StopMonitor()
exten => s,4,AGI(recordingcheck,${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)},${UNIQUEID})
exten => s,5,Noop(${CALLERID(number)})
exten => s,6,Set(CALLFILENAME=${CALLFILENAME}${CALLERID(number)})
exten => s,7,Noop(No recording needed)
; Add new lines
;############ for incoming call record #############
exten => s,998,Set(CALLFILENAME=${CALLFILENAME}-${CALLERID(number)}) // chú ý ph?n priority
exten => s,n,Noop(${CALLERID(number)})
exten => s,n,Noop(${CALLERID(name)})
exten => s,n,MixMonitor(${CALLFILENAME}.wav)
;############ for outgoing call record #############
exten => s,800,Set(CALLFILENAME=${CALLFILENAME}) // chú ý ph?n priority
exten => s,n,Noop(OUTNUM=${OUTNUM})
exten => s,n,Noop(DIAL_NUMBER=${DIAL_NUMBER})
; End of new lines
:::: extensions_additional.conf ::::
[macro-dialout-trunk]
include => macro-dialout-trunk-custom
exten => s,1,Set(DIAL_TRUNK=${ARG1})
exten => s,n,ExecIf($[$["${ARG3}" != “”] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != “NOPASSWD”]],Authenticate,${ARG3})
exten => s,n,GotoIf($[“x${OUTDISABLE_${DIAL_TRUNK}}” = “xon”]?disabletrunk,1)
exten => s,n,Set(DIAL_NUMBER=${ARG2})
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS})
exten => s,n,Set(GROUP()=OUT_${DIAL_TRUNK})
exten => s,n,GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = “foo”]?nomax)
exten => s,n,GotoIf($[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} > ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull)
exten => s,n(nomax),GotoIf($["${INTRACOMPANYROUTE}" = “YES”]?skipoutcid)
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${TRUNK_OPTIONS})
exten => s,n,Macro(outbound-callerid,${DIAL_TRUNK})
exten => s,n(skipoutcid),AGI(fixlocalprefix)
exten => s,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER})
exten => s,n,Set(custom=${CUT(OUT_${DIAL_TRUNK},:,1)})
; Add new lines
exten => s,n,Noop(OUTNUM=${OUTNUM})
exten => s,n,Noop(DIAL_NUMBER=${DIAL_NUMBER})
exten => s,n,Set(CALLFILENAME=${CALLFILENAME}-${OUTNUM})
exten => s,n,MixMonitor(${CALLFILENAME}.wav)
; End of new lines
:::: recordingcheck ::::::
case “Group”:
…
$agi->set_variable(“CALLFILENAME”,“IN{$exten[‘data’]}-{$timestamp}-{$uniqueid}”);
$agi->set_priority(998);
case “OUT”:
…
$agi->set_variable(“CALLFILENAME”,“OUT{$exten[‘data’]}-{$timestamp}-{$uniqueid}”);
$agi->set_priority(800);
case “IN”:
…
$agi->set_variable(“CALLFILENAME”,“OUT{$exten[‘data’]}-{$timestamp}-{$uniqueid}”);
$agi->set_priority(998);
…
- Everything OK … you have go to Asterisk CLI > reload
- At this solution have a disavandtage is :
When you want to configure system from Web GUI … at first you have to change the permission of extensions_additional.conf to 664.
After configuration finished you have only add the new lines in extensions_additional.conf again as below. Then change the permission of extensions_additional.conf to 464 again.
- The format of record file name as follow :
OUT1001-20080829-090407-1219975447.10402-0988428477.wav
=> Mean Extension 1001 make call to 0988428477
IN1002-20080829-090201-1219975321.10354-7717786.wav
=> Mean the call from No. 7717786 to Extension 1002
I hope this information helping for all ! This solution i has been test and … sucessfull !
====== Contact info ==========
Name : Lam The Nhan (Steven)
E-mail : [email protected] | yahoo.com
Mobile phone No. : +84 918633646
Home phone No. : +84 9402331