This is the current context i made. I believe there is alot of improvements to be made and its not complete as of yet.

[defaultout]

exten => 1,1,Goto(time,${EXTEN},1)

exten => _X.,1,Answer()

exten => _X.,n,Set(my_callgroup=${CHANNEL(callgroup)})

exten => _X.,n,Set(pickupgroup=${CHANNEL(Pickupgroup)})

exten => _X.,n,Set(callerExtension=${CALLERID(num)})

exten => _X.,n,NoOp(Callgroup assigned to this channel is ${my_callgroup})

exten => _X.,n,NoOp(Pickupgroup : ${pickupgroup})

exten => _X.,n,GotoIf($[${LEN(${EXTEN})} > 4]?CheckExclusion:NoAuth)

exten => _X.,n(CheckExclusion),Set(ExcludedNumberFile=/etc/asterisk/exclude.conf)

exten => _X.,n,Set(ExcludedNumber=${EXTEN})

exten => _X.,n,Set(ExcludedNumber=${CUT(ExcludedNumber,/,1)})

exten => _X.,n,Set(ExcludedNumberFound=0)

exten => _X.,n,System(cat ${ExcludedNumberFile} | grep -q “^${ExcludedNumber}$”)

exten => _X.,n,GotoIf($[${SYSTEMSTATUS} = SUCCESS]?Exclude:Auth)

exten => _X.,n(Exclude),Dial(IAX2/vm40100/0${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(NoAuth),Goto(defaultin,+2711560${EXTEN},1)

exten => _X.,n,Hangup()

exten => _X.,n(Auth),Authenticate(/etc/asterisk/pwds,am,6)

exten => _X.,n,Set(RecNumberFile=/etc/asterisk/recordext.conf)

exten => _X.,n,Set(RecNumber=${callerExtension})

exten => _X.,n,Set(RecNumber=${CUT(RecNumber,/,1)})

exten => _X.,n,Set(RecNumberFound=0)

exten => _X.,n,System(cat ${RecNumberFile} | grep -q “^${RecNumber}$”)

exten => _X.,n,GotoIf($[${SYSTEMSTATUS} = SUCCESS]?Rec:Cont)

exten => _X.,n,Hangup()

exten => _X.,n(Cont),GotoIf($[${my_callgroup} = 0]?Norm:Inter)

exten => _X.,n,Hangup()

exten => _X.,n(Norm),NoOp(Extension should not be recorded : ${pickupgroup})

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “80”]?dial_vodacom)

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “81”]?dial_mtn)

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “82”]?dial_liquid)

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “83”]?dial_vox)

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “84”]?dial_tforge:dial_default)

exten => _X.,n,Hangup()

exten => _X.,n(dial_default),Dial(IAX2/vm40100/${EXTEN})

exten => _X.,n,Hangup()

exten => _X.,n(dial_vodacom),Dial(IAX2/vodacom/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(dial_mtn),Dial(IAX2/mtn/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(dial_liquid),Dial(IAX2/liquid/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(dial_vox),Dial(IAX2/vox/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(dial_tforge),Dial(IAX2/tforge/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(Inter),NoOp(International Call Made : ${my_callgroup})

exten => _X.,n,Dial(IAX2/vm40100/${EXTEN})

exten => _X.,n,Hangup()

exten => _X.,n(Rec),NoOp(Extension should be recorded : ${callerExtension})

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “80”]?rec_vodacom)

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “81”]?rec_mtn)

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “82”]?rec_liquid)

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “83”]?rec_vox)

exten => _X.,n,GotoIf($[“${EXTEN:0:2}” = “84”]?rec_tforge:rec_default)

exten => _X.,n,Hangup()

exten => _X.,n(rec_vodacom),NoOp(Extension should be recorded : Vodacom)

exten => _X.,n,Gosub(recordingout,s,1(${EXTEN:2}))

exten => _X.,n,Dial(IAX2/vm40100/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(rec_mtn),NoOp(Extension should be recorded : Mtn)

exten => _X.,n,Gosub(recordingout,s,1(${EXTEN:2}))

exten => _X.,n,Dial(IAX2/vm40100/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(rec_liquid),NoOp(Extension should be recorded : Liquid)

exten => _X.,n,Gosub(recordingout,s,1(${EXTEN:2}))

exten => _X.,n,Dial(IAX2/vm40100/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(rec_vo),NoOp(Extension should be recorded : Vox)

exten => _X.,n,Gosub(recordingout,s,1(${EXTEN:2}))

exten => _X.,n,Dial(IAX2/vm40100/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(rec_tforge),NoOp(Extension should be recorded : TForge)

exten => _X.,n,Gosub(recordingout,s,1(${EXTEN:2}))

exten => _X.,n,Dial(IAX2/vm40100/${EXTEN:2})

exten => _X.,n,Hangup()

exten => _X.,n(rec_default),NoOp(Extension should be recorded : Default)

exten => _X.,n,Set(fixed=${IF($[${LEN(${EXTEN})} > 11]?${EXTEN:2}:${EXTEN})})

exten => _X.,n,Gosub(recordingout,s,1(${fixed}))

exten => _X.,n,Dial(IAX2/vm40100/${fixed})

exten => _X.,n,Hangup()

[recordingout]

exten => s,1,Set(DATE=${STRFTIME(${EPOCH},UTC-2,%Y%m%d%H%M)})

exten => s,n,Set(RECFILE=/home/RecTest/Out_${ARG1}*${DATE}*${CALLERID(num)})

exten => s,n,MixMonitor(${RECFILE}.wav,/etc/asterisk/soxthefile.sh ${RECFILE})

exten => s,n,Return()

[recordingin]

exten => s,1,Set(DATE=${STRFTIME(${EPOCH},UTC-2,%Y%m%d%H%M)})

exten => s,n,Set(RECFILE=/home/RecTest/In_${ARG1}*${DATE}*${CALLERID(num)})

exten => s,n,MixMonitor(${RECFILE}.wav,/etc/asterisk/soxthefile.sh ${RECFILE})

exten => s,n,Return()