External call forward

hy,
i’m trying to forward via IVR to a external cell phone since 1 week…no chance.
as described in many threads i created a ring group 664… in this ringroup i definded the external number 03423423423#

the forward doesn’t work, it works only when i call the ring group from a internal extension 105 or 106.

but i want to redirect the calelr over the IVR to the cell phone? whats wrong.

thx

post your extensions.conf

hy,
i’m working through freepbx 2.3.1, asterisk 1.5 so i’ve a extensions_additional.conf:

[code]; do not edit this file, this is an auto-generated file by freepbx
; all modifications must be done from the web gui

[size=9]
[i][globals]
#include globals_custom.conf
CALLFILENAME = ""
DIAL_OPTIONS = Ttr
TRUNK_OPTIONS = tT
DIAL_OUT = 9
FAX =
FAX_RX = system
FAX_RX_EMAIL = office@doktoronline.at
INCOMING = group-all
NULL = ""
OPERATOR =
PARKNOTIFY = SIP/200
RECORDEXTEN = ""
RINGTIMER = 15
DIRECTORY = last
AFTER_INCOMING =
IN_OVERRIDE = forcereghours
REGTIME = 7:55-17:05
REGDAYS = mon-fri
DIRECTORY_OPTS =
OUT_1 = ZAP/g0
VM_PREFIX = *
TONEZONE = us
ALLOW_SIP_ANON = no
FAX_RX_FROM = freepbx@gmail.com
VM_DDTYPE =
VM_GAIN =
OPERATOR_XTN =
VM_OPTS =
TIMEFORMAT = kM
VMX_CONTEXT = from-internal
VMX_PRI = 1
VMX_TIMEDEST_CONTEXT =
VMX_TIMEDEST_EXT = dovm
VMX_TIMEDEST_PRI = 1
VMX_LOOPDEST_CONTEXT =
VMX_LOOPDEST_EXT = dovm
VMX_LOOPDEST_PRI = 1
VMX_OPTS_TIMEOUT =
VMX_OPTS_LOOP =
VMX_OPTS_DOVM =
VMX_TIMEOUT = 2
VMX_REPEAT = 1
VMX_LOOPS = 1
TRANSFER_CONTEXT = from-internal-xfer
ZAPTEL_DELAY = 0
OUTDISABLE_2 = off
OUTFAIL_2 =
OUTKEEPCID_2 = off
OUTCID_2 =
OUTMAXCHANS_2 =
DIALOUTIDS = 1/2/
OUTPREFIX_2 =
OUT_2 = IAX2/vpbx_test_trunk1
ASTETCDIR = /etc/asterisk
ASTMODDIR = /usr/lib/asterisk/modules
ASTVARLIBDIR = /var/lib/asterisk
ASTAGIDIR = /var/lib/asterisk/agi-bin
ASTSPOOLDIR = /var/spool/asterisk
ASTRUNDIR = /var/run/asterisk
ASTLOGDIR = /var/log/asterisk
CWINUSEBUSY = true
AMPMGRUSER = admin
AMPMGRPASS = amp111

;end of [globals]

[app-dialvm]
include => app-dialvm-custom
exten => *98,1,Answer
exten => *98,n,Wait(1)
exten => *98,n,VoiceMailMain()
exten => *98,n,Macro(hangupcall,)
exten => _*98.,1,Answer
exten => _*98.,n,Wait(1)
exten => _*98.,n,Macro(get-vmcontext,${EXTEN:3})
exten => _*98.,n,VoiceMailMain(${EXTEN:3}@${VMCONTEXT})
exten => _*98.,n,Macro(hangupcall,)

; end of [app-dialvm]

[app-vmmain]
include => app-vmmain-custom
exten => *97,1,Answer
exten => *97,n,Wait(1)
exten => *97,n,Macro(user-callerid,)
exten => *97,n,Macro(get-vmcontext,${AMPUSER})
exten => *97,n(check),MailBoxExists(${AMPUSER}@${VMCONTEXT})
exten => *97,n,GotoIf($["${VMBOXEXISTSSTATUS}" = “SUCCESS”]?mbexist)
exten => *97,n,VoiceMailMain()
exten => *97,n,Macro(hangupcall,)
exten => *97,check+101(mbexist),VoiceMailMain(${AMPUSER}@${VMCONTEXT})
exten => *97,n,Macro(hangupcall,)

; end of [app-vmmain]

[ivr-2]
include => ivr-2-custom
exten => h,1,Hangup
exten => s,1,Set(LOOPCOUNT=0)
exten => s,n,Set(__DIR-CONTEXT=default)
exten => s,n,Set(IVR_CONTEXT${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,GotoIf($["${CDR(disposition)}" = “ANSWERED”]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Background(custom/IVR_DOL_V2)
exten => s,n,WaitExten(,)
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
exten => 0,1,dbDel(${BLKVM_OVERRIDE})
exten => 0,n,Set(__NODEST=)
exten => 0,n,Goto(from-did-direct,100,1)
exten => 1,1,dbDel(${BLKVM_OVERRIDE})
exten => 1,n,Set(__NODEST=)
exten => 1,n,Goto(from-did-direct,120,1)
exten => 2,1,dbDel(${BLKVM_OVERRIDE})
exten => 2,n,Set(__NODEST=)
exten => 2,n,Goto(ext-local,vmu100,1)
exten => i,1,Playback(invalid)
exten => i,n,Goto(loop,1)
exten => t,1,Goto(loop,1)
exten => loop,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => loop,n,GotoIf($[${LOOPCOUNT} > 2]?hang,1)
exten => loop,n,Goto(ivr-2,s,begin)
exten => return,1,Set(IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(IVR_CONTEXT${CONTEXT}=${IVR_CONTEXT
${CONTEXT}})
exten => return,n,Goto(ivr-2,s,begin)
exten => fax,1,Goto(ext-fax,in_fax,1)

; end of [ivr-2]

[app-calltrace]
include => app-calltrace-custom
exten => *69,1,Goto(app-calltrace-perform,s,1)

; end of [app-calltrace]

[app-calltrace-perform]
include => app-calltrace-perform-custom
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Playback(info-about-last-call&telephone-number)
exten => s,n,Set(lastcaller=${DB(CALLTRACE/${AMPUSER})})
exten => s,n,GotoIf($[ $[ “${lastcaller}” = “” ] | $[ “${lastcaller}” = “unknown” ] ]?noinfo)
exten => s,n,SayDigits(${lastcaller})
exten => s,n,Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=7)
exten => s,n,Background(to-call-this-number&press-1)
exten => s,n,Goto(fin)
exten => s,n(noinfo),Playback(from-unknown-caller)
exten => s,n,Macro(hangupcall,)
exten => s,n(fin),Noop(Waiting for input)
exten => s,n,WaitExten(60,)
exten => s,n,Playback(sorry-youre-having-problems&goodbye)
exten => 1,1,Goto(from-internal,${lastcaller},1)
exten => i,1,Playback(vm-goodbye)
exten => i,n,Macro(hangupcall,)
exten => t,1,Playback(vm-goodbye)
exten => t,n,Macro(hangupcall,)

; end of [app-calltrace-perform]

[app-directory]
include => app-directory-custom
exten => #,1,Answer
exten => #,n,Wait(1)
exten => #,n,AGI(directory,${DIR-CONTEXT},from-did-direct,${DIRECTORY:0:1}${DIRECTORY_OPTS})
exten => #,n,Playback(vm-goodbye)
exten => #,n,Hangup
exten => i,1,Playback(privacy-incorrect)

; end of [app-directory]

[app-echo-test]
include => app-echo-test-custom
exten => *43,1,Answer
exten => *43,n,Wait(1)
exten => *43,n,Playback(demo-echotest)
exten => *43,n,Echo()
exten => *43,n,Playback(demo-echodone)
exten => *43,n,Hangup

; end of [app-echo-test]

[app-speakextennum]
include => app-speakextennum-custom
exten => *65,1,Answer
exten => *65,n,Wait(1)
exten => *65,n,Macro(user-callerid,)
exten => *65,n,Playback(your)
exten => *65,n,Playback(extension)
exten => *65,n,Playback(number)
exten => *65,n,Playback(is)
exten => *65,n,SayDigits(${AMPUSER})
exten => *65,n,Wait(2)
exten => *65,n,Hangup

; end of [app-speakextennum]

[app-speakingclock]
include => app-speakingclock-custom
exten => *60,1,Answer
exten => *60,n,Wait(1)
exten => *60,n,Set(NumLoops=0)
exten => *60,n(start),Set(FutureTime=$[${EPOCH} + 11])
exten => *60,n,Playback(at-tone-time-exactly)
exten => *60,n,GotoIf($["${TIMEFORMAT}" = “kM”]?hr24format)
exten => *60,n,SayUnixTime(${FutureTime},IM ‘and’ S ‘seconds’ p)
exten => *60,n,Goto(waitloop)
exten => *60,n(hr24format),SayUnixTime(${FutureTime},kM ‘and’ S ‘seconds’)
exten => *60,n(waitloop),Set(TimeLeft=$[${FutureTime} - ${EPOCH}])
exten => *60,n,GotoIf($[${TimeLeft} < 1]?playbeep)
exten => *60,n,Wait(1)
exten => *60,n,Goto(waitloop)
exten => *60,n(playbeep),Playback(beep)
exten => *60,n,Wait(5)
exten => *60,n,Set(NumLoops=$[${NumLoops} + 1])
exten => *60,n,GotoIf($[${NumLoops} < 5]?start)
exten => *60,n,Playback(goodbye)
exten => *60,n,Hangup

; end of [app-speakingclock]

[ext-queues]
include => ext-queues-custom
exten => 111,1,Macro(user-callerid,)
exten => 111,n,Answer
exten => 111,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 111,n,Set(__BLKVM_BASE=${EXTEN})
exten => 111,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 111,n,Set(_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm))
exten => 111,n,Set(__NODEST=${EXTEN})
exten => 111,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)}-${UNIQUEID})
exten => 111,n,Set(__MOHCLASS=queuemusic)
exten => 111,n,Queue(111,t,)
exten => 111,n,dbDel(${BLKVM_OVERRIDE})
exten => 111,n,Set(__NODEST=)
exten => 111,n,Goto(ext-local,vmb106,1)
exten => 111*,1,Macro(agent-add,111,)
exten => 111**,1,Macro(agent-del,111,111)

; end of [ext-queues]

[app-recordings]
include => app-recordings-custom
exten => *77,1,Macro(user-callerid,)
exten => *77,n,Wait(2)
exten => *77,n,Macro(systemrecording,dorecord)
exten => *99,1,Macro(user-callerid,)
exten => *99,n,Wait(2)
exten => *99,n,Macro(systemrecording,docheck)

; end of [app-recordings]

[ext-recordings]
include => ext-recordings-custom
exten => recording-5,1,Answer
exten => recording-5,n,Playback(custom/Begruessungsband)
exten => recording-5,n,Hangup
exten => recording-6,1,Answer
exten => recording-6,n,Playback(custom/IVRband)
exten => recording-6,n,Hangup
exten => recording-7,1,Answer
exten => recording-7,n,Playback(custom/ivrbandconvert2)
exten => recording-7,n,Hangup
exten => recording-10,1,Answer
exten => recording-10,n,Playback(custom/IVR_DOL_V1)
exten => recording-10,n,Hangup
exten => recording-12,1,Answer
exten => recording-12,n,Playback(custom/IVR_DOL_V2)
exten => recording-12,n,Hangup
exten => recording-2,1,Answer
exten => recording-2,n,Playback(queue-thereare)
exten => recording-2,n,Hangup
exten => recording-4,1,Answer
exten => recording-4,n,Playback(custom/testdolconvert)
exten => recording-4,n,Hangup
exten => recording-3,1,Answer
exten => recording-3,n,Playback(custom/testdolwav)
exten => recording-3,n,Hangup

; end of [ext-recordings]

[ext-group]
include => ext-group-custom
exten => 664,1,Macro(user-callerid,)
exten => 664,n,GotoIf($[“foo${BLKVM_OVERRIDE}” = “foo”]?skipdb)
exten => 664,n,GotoIf($["${DB(${BLKVM_OVERRIDE})}" = “TRUE”]?skipov)
exten => 664,n(skipdb),Set(__NODEST=)
exten => 664,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 664,n,Set(__BLKVM_BASE=${EXTEN})
exten => 664,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 664,n(skipov),Set(RRNODEST=${NODEST})
exten => 664,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 664,n,Set(RecordMethod=Group)
exten => 664,n,Macro(record-enable,06649101612#,${RecordMethod})
exten => 664,n,Set(RingGroupMethod=hunt)
exten => 664,n(DIALGRP),Macro(dial,20,${DIAL_OPTIONS},06649101612#)
exten => 664,n,Set(RingGroupMethod=)
exten => 664,n,GotoIf($[“foo${RRNODEST}” != “foo”]?nodest)
exten => 664,n,Set(__NODEST=)
exten => 664,n,dbDel(${BLKVM_OVERRIDE})
exten => 664,n,Goto(ext-local,vmu100,1)
exten => 664,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

; end of [ext-group]

[app-cf-busy-off]
include => app-cf-busy-off-custom
exten => *91,1,Answer
exten => *91,n,Wait(1)
exten => *91,n,Macro(user-callerid,)
exten => *91,n,dbDel(CFB/${AMPUSER})
exten => *91,n,Playback(call-fwd-on-busy&de-activated)
exten => *91,n,Macro(hangupcall,)
exten => _*91.,1,Answer
exten => _*91.,n,Wait(1)
exten => _*91.,n,Set(fromext=${EXTEN:3})
exten => _*91.,n,dbDel(CFB/${fromext})
exten => _*91.,n,Playback(call-fwd-on-busy&for&extension)
exten => _*91.,n,SayDigits(${fromext})
exten => _*91.,n,Playback(cancelled)
exten => _*91.,n,Macro(hangupcall,)

; end of [app-cf-busy-off]

[app-cf-busy-off-any]
include => app-cf-busy-off-any-custom
exten => *92,1,Answer
exten => *92,n,Wait(1)
exten => *92,n,Playback(please-enter-your&extension)
exten => *92,n,Read(fromext,then-press-pound,)
exten => *92,n,Wait(1)
exten => *92,n,dbDel(CFB/${fromext})
exten => *92,n,Playback(call-fwd-on-busy&for&extension)
exten => *92,n,SayDigits(${fromext})
exten => *92,n,Playback(cancelled)
exten => *92,n,Macro(hangupcall,)

; end of [app-cf-busy-off-any]

[app-cf-busy-on]
include => app-cf-busy-on-custom
exten => *90,1,Answer
exten => *90,n,Wait(1)
exten => *90,n,Macro(user-callerid,)
exten => *90,n,Playback(call-fwd-on-busy)
exten => *90,n,Playback(please-enter-your&extension)
exten => *90,n,Read(fromext,then-press-pound,)
exten => *90,n,Set(fromext=${IF($[“foo${fromext}”=“foo”]?${AMPUSER}:${fromext})})
exten => *90,n,Wait(1)
exten => *90,n(startread),Playback(ent-target-attendant)
exten => *90,n,Read(toext,then-press-pound,)
exten => *90,n,GotoIf($[“foo${toext}”=“foo”]?startread)
exten => *90,n,Wait(1)
exten => *90,n,Set(DB(CFB/${fromext})=${toext})
exten => *90,n,Playback(call-fwd-on-busy&for&extension)
exten => *90,n,SayDigits(${fromext})
exten => *90,n,Playback(is-set-to)
exten => *90,n,SayDigits(${toext})
exten => *90,n,Macro(hangupcall,)
exten => _*90.,1,Answer
exten => _*90.,n,Wait(1)
exten => _*90.,n,Macro(user-callerid,)
exten => _*90.,n,Set(DB(CFB/${AMPUSER})=${EXTEN:3})
exten => _*90.,n,Playback(call-fwd-on-busy&for&extension)
exten => _*90.,n,SayDigits(${AMPUSER})
exten => _*90.,n,Playback(is-set-to)
exten => _*90.,n,SayDigits(${EXTEN:3})
exten => _*90.,n,Macro(hangupcall,)

; end of [app-cf-busy-on]

[app-cf-off]
include => app-cf-off-custom
exten => *73,1,Answer
exten => *73,n,Wait(1)
exten => *73,n,Macro(user-callerid,)
exten => *73,n,dbDel(CF/${AMPUSER})
exten => *73,n,Playback(call-fwd-unconditional&de-activated)
exten => *73,n,Macro(hangupcall,)
exten => _*73.,1,Answer
exten => _*73.,n,Wait(1)
exten => _*73.,n,Set(fromext=${EXTEN:3})
exten => _*73.,n,dbDel(CF/${fromext})
exten => _*73.,n,Playback(call-fwd-unconditional&for&extension)
exten => _*73.,n,SayDigits(${fromext})
exten => _*73.,n,Playback(cancelled)
exten => _*73.,n,Macro(hangupcall,)

; end of [app-cf-off]

[app-cf-off-any]
include => app-cf-off-any-custom
exten => *74,1,Answer
exten => *74,n,Wait(1)
exten => *74,n,Playback(please-enter-your&extension)
exten => *74,n,Read(fromext,then-press-pound,)
exten => *74,n,Wait(1)
exten => *74,n,dbDel(CF/${fromext})
exten => *74,n,Playback(call-fwd-unconditional&for&extension)
exten => *74,n,SayDigits(${fromext})
exten => *74,n,Playback(cancelled)
exten => *74,n,Macro(hangupcall,)

; end of [app-cf-off-any]

[app-cf-on]
include => app-cf-on-custom
exten => *72,1,Answer
exten => *72,n,Wait(1)
exten => *72,n,Macro(user-callerid,)
exten => *72,n,Playback(call-fwd-unconditional)
exten => *72,n,Playback(please-enter-your&extension)
exten => *72,n,Read(fromext,then-press-pound,)
exten => *72,n,Set(fromext=${IF($[“foo${fromext}”=“foo”]?${AMPUSER}:${fromext})})
exten => *72,n,Wait(1)
exten => *72,n(startread),Playback(ent-target-attendant)
exten => *72,n,Read(toext,then-press-pound,)
exten => *72,n,GotoIf($[“foo${toext}”=“foo”]?startread)
exten => *72,n,Wait(1)
exten => *72,n,Set(DB(CF/${fromext})=${toext})
exten => *72,n,Playback(call-fwd-unconditional&for&extension)
exten => *72,n,SayDigits(${fromext})
exten => *72,n,Playback(is-set-to)
exten => *72,n,SayDigits(${toext})
exten => *72,n,Macro(hangupcall,)
exten => _*72.,1,Answer
exten => _*72.,n,Wait(1)
exten => _*72.,n,Macro(user-callerid,)
exten => _*72.,n,Set(DB(CF/${AMPUSER})=${EXTEN:3})
exten => _*72.,n,Playback(call-fwd-unconditional&for&extension)
exten => _*72.,n,SayDigits(${AMPUSER})
exten => _*72.,n,Playback(is-set-to)
exten => _*72.,n,SayDigits(${EXTEN:3})
exten => _*72.,n,Macro(hangupcall,)

; end of [app-cf-on]

[app-cf-unavailable-off]
include => app-cf-unavailable-off-custom
exten => *53,1,Answer
exten => *53,n,Wait(1)
exten => *53,n,Macro(user-callerid,)
exten => *53,n,dbDel(CFU/${AMPUSER})
exten => *53,n,Playback(call-fwd-no-ans&de-activated)
exten => *53,n,Macro(hangupcall,)
exten => _*53.,1,Answer
exten => _*53.,n,Wait(1)
exten => _*53.,n,Set(fromext=${EXTEN:3})
exten => _*53.,n,dbDel(CFU/${fromext})
exten => _*53.,n,Playback(call-fwd-no-ans&for&extension)
exten => _*53.,n,SayDigits(${fromext})
exten => _*53.,n,Playback(cancelled)
exten => _*53.,n,Macro(hangupcall,)

; end of [app-cf-unavailable-off]

[app-cf-unavailable-on]
include => app-cf-unavailable-on-custom
exten => *52,1,Answer
exten => *52,n,Wait(1)
exten => *52,n,Macro(user-callerid,)
exten => *52,n,Playback(call-fwd-no-ans)
exten => *52,n,Playback(please-enter-your&extension)
exten => *52,n,Read(fromext,then-press-pound,)
exten => *52,n,Set(fromext=${IF($[“foo${fromext}”=“foo”]?${AMPUSER}:${fromext})})
exten => *52,n,Wait(1)
exten => *52,n(startread),Playback(ent-target-attendant)
exten => *52,n,Read(toext,then-press-pound,)
exten => *52,n,GotoIf($[“foo${toext}”=“foo”]?startread)
exten => *52,n,Wait(1)
exten => *52,n,Set(DB(CFU/${fromext})=${toext})
exten => *52,n,Playback(call-fwd-no-ans&for&extension)
exten => *52,n,SayDigits(${fromext})
exten => *52,n,Playback(is-set-to)
exten => *52,n,SayDigits(${toext})
exten => *52,n,Macro(hangupcall,)
exten => _*52.,1,Answer
exten => _*52.,n,Wait(1)
exten => _*52.,n,Macro(user-callerid,)
exten => _*52.,n,Set(DB(CFU/${AMPUSER})=${EXTEN:3})
exten => _*52.,n,Playback(call-fwd-no-ans&for&extension)
exten => _*52.,n,SayDigits(${AMPUSER})
exten => _*52.,n,Playback(is-set-to)
exten => _*52.,n,SayDigits(${EXTEN:3})
exten => _*52.,n,Macro(hangupcall,)

; end of [app-cf-unavailable-on]

[ext-findmefollow]
include => ext-findmefollow-custom
exten => FM120,1,Goto(120,FM120)
exten => 120,1,GotoIf($[ “${DB(AMPUSER/120/followme/ddial)}” = “EXTENSION” ]?ext-local,120,1)
exten => 120,n(FM120),Macro(user-callerid,)
exten => 120,n,GotoIf($[“foo${BLKVM_OVERRIDE}” = “foo”]?skipdb)
exten => 120,n,GotoIf($["${DB(${BLKVM_OVERRIDE})}" = “TRUE”]?skipov)
exten => 120,n(skipdb),Set(__NODEST=)
exten => 120,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 120,n,Set(__BLKVM_BASE=${EXTEN})
exten => 120,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 120,n(skipov),Set(RRNODEST=${NODEST})
exten => 120,n(skipvmblk),Set(__NODEST=${EXTEN})
exten => 120,n,GotoIf($[$[ “${DB(AMPUSER/120/followme/prering)}” = “0” ] | $[ “${DB(AMPUSER/120/followme/prering)}” = “” ]] ?skipsimple)
exten => 120,n,Macro(simple-dial,120,${DB(AMPUSER/120/followme/prering)})
exten => 120,n(skipsimple),Set(RecordMethod=Group)
exten => 120,n,Macro(record-enable,${DB(AMPUSER/120/followme/grplist)},${RecordMethod})
exten => 120,n,Set(RingGroupMethod=ringall)
exten => 120,n,Set(_FMGRP=120)
exten => 120,n(DIALGRP),GotoIf($[ “${DB(AMPUSER/120/followme/grpconf)}” = “ENABLED” ]?doconfirm)
exten => 120,n,Macro(dial,${DB(AMPUSER/120/followme/grptime)},${DIAL_OPTIONS},${DB(AMPUSER/120/followme/grplist)})
exten => 120,n,Goto(nextstep)
exten => 120,n(doconfirm),Macro(dial-confirm,${DB(AMPUSER/120/followme/grptime)},${DIAL_OPTIONS},${DB(AMPUSER/120/followme/grplist)},120)
exten => 120,n(nextstep),Set(RingGroupMethod=)
exten => 120,n,GotoIf($[“foo${RRNODEST}” != “foo”]?nodest)
exten => 120,n,Set(__NODEST=)
exten => 120,n,dbDel(${BLKVM_OVERRIDE})
exten => 120,n,Goto(ext-local,vmu100,1)
exten => 120,n(nodest),Noop(SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST})

; end of [ext-findmefollow]

[fmgrps]
include => fmgrps-custom
exten => _RG-120-.,1,Macro(dial,${DB(AMPUSER/120/followme/grptime)},M(confirm^^^120)${DIAL_OPTIONS},${EXTEN:7})

; end of [fmgrps]

[app-userlogonoff]
include => app-userlogonoff-custom
exten => *12,1,Macro(user-logoff,)
exten => *12,n,Hangup
exten => *11,1,Macro(user-logon,)
exten => *11,n,Hangup
exten => _*11.,1,Macro(user-logon,${EXTEN:3},)
exten => _*11.,n,Hangup

; end of [app-userlogonoff]

[app-pickup]
include => app-pickup-custom
exten => _.,1,Noop(Attempt to Pickup ${EXTEN:2} by ${CALLERID(num)})
exten => _
.,n,Pickup(${EXTEN:2})

; end of [app-pickup]

[app-zapbarge]
include => app-zapbarge-custom
exten => 888,1,Macro(user-callerid,)
exten => 888,n,Set(GROUP()=${CALLERID(number)})
exten => 888,n,Answer
exten => 888,n,Wait(1)
exten => 888,n,ZapBarge()
exten => 888,n,Hangup

; end of [app-zapbarge]

[app-chanspy]
include => app-chanspy-custom
exten => 555,1,Macro(user-callerid,)
exten => 555,n,Answer
exten => 555,n,Wait(1)
exten => 555,n,ChanSpy()
exten => 555,n,Hangup

; end of [app-chanspy]

[ext-test]
include => ext-test-custom
exten => 7777,1,Goto(from-pstn,s,1)
exten => 666,1,Goto(ext-fax,in_fax,1)
exten => h,1,Macro(hangupcall,)

; end of [ext-test]

[ext-did]
include => ext-did-custom
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => 0129837780,1,Set(__FROM_DID=${EXTEN})
exten => 0129837780,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 0129837780,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 0129837780,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 0129837780,n,Goto(from-did-direct,100,1)
exten => 01298377812,1,Set(__FROM_DID=${EXTEN})
exten => 01298377812,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 01298377812,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 01298377812,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 01298377812,n,Goto(ext-group,664,1)
exten => 01298377814,1,Set(__FROM_DID=${EXTEN})
exten => 01298377814,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 01298377814,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 01298377814,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 01298377814,n,Goto(ivr-2,s,1)
exten => 012983778556,1,Set(__FROM_DID=${EXTEN})
exten => 012983778556,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 012983778556,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 012983778556,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 012983778556,n,Set(FAX_RX_EMAIL=office@doktoronline.at)
exten => 012983778556,n,Answer
exten => 012983778556,n,Wait(4)
exten => 012983778556,n,Goto()
exten => 07205585580,1,Set(__FROM_DID=${EXTEN})
exten => 07205585580,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 07205585580,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 07205585580,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 07205585580,n,Goto(from-did-direct,110,1)
exten => 072055855852,1,Set(__FROM_DID=${EXTEN})
exten => 072055855852,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 072055855852,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 072055855852,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 072055855852,n,Goto(from-did-direct,110,1)
exten => 072055855854,1,Set(__FROM_DID=${EXTEN})
exten => 072055855854,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 072055855854,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 072055855854,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 072055855854,n,Goto(from-did-direct,110,1)
exten => 072055855857,1,Set(__FROM_DID=${EXTEN})
exten => 072055855857,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 072055855857,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 072055855857,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 072055855857,n,Goto(from-did-direct,110,1)
exten => 0720558558999,1,Set(__FROM_DID=${EXTEN})
exten => 0720558558999,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 0720558558999,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 0720558558999,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 0720558558999,n,Goto(ext-queues,111,1)
exten => 012983778105,1,Set(__FROM_DID=${EXTEN})
exten => 012983778105,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 012983778105,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 012983778105,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 012983778105,n,Goto(from-did-direct,105,1)
exten => 012983778106,1,Set(__FROM_DID=${EXTEN})
exten => 012983778106,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 012983778106,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 012983778106,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 012983778106,n,Goto(from-did-direct,106,1)
exten => 012983778110,1,Set(__FROM_DID=${EXTEN})
exten => 012983778110,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 012983778110,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 012983778110,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 012983778110,n,Goto(from-did-direct,110,1)
exten => 012983778120,1,Set(__FROM_DID=${EXTEN})
exten => 012983778120,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 012983778120,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 012983778120,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 012983778120,n,Goto(from-did-direct,120,1)
exten => 012983778100,1,Set(__FROM_DID=${EXTEN})
exten => 012983778100,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 012983778100,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 012983778100,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 012983778100,n,Goto(from-did-direct,100,1)
exten => 012983778666,1,Set(__FROM_DID=${EXTEN})
exten => 012983778666,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 012983778666,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 012983778666,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 012983778666,n,Set(FAX_RX_EMAIL=office@doktoronline.at)
exten => 012983778666,n,Answer
exten => 012983778666,n,Wait(0)
exten => 012983778666,n,Goto(from-did-direct,666,1)

; end of [ext-did]

[ext-did-catchall]
include => ext-did-catchall-custom
exten => s,1,Noop(No DID or CID Match)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(ss-noservice)
exten => s,n,SayAlpha(${FROM_DID})
exten => _[#X].,1,Set(__FROM_DID=${EXTEN})
exten => _[
#X].,n,Noop(Received an unknown call with DID set to ${EXTEN})
exten => _[*#X].,n,Goto(ext-did,s,1)

; end of [ext-did-catchall]

[ext-local]
include => ext-local-custom
exten => 100,1,Macro(exten-vm,100,100)
exten => 100,n,Hangup
exten => 100,hint,SIP/100
exten => ${VM_PREFIX}100,1,Macro(vm,100,DIRECTDIAL)
exten => ${VM_PREFIX}100,n,Hangup
exten => vmb100,1,Macro(vm,100,BUSY)
exten => vmb100,n,Hangup
exten => vmu100,1,Macro(vm,100,NOANSWER)
exten => vmu100,n,Hangup
exten => vms100,1,Macro(vm,100,NOMESSAGE)
exten => vms100,n,Hangup
exten => 105,1,Macro(exten-vm,105,105)
exten => 105,n,Hangup
exten => 105,hint,SIP/105
exten => ${VM_PREFIX}105,1,Macro(vm,105,DIRECTDIAL)
exten => ${VM_PREFIX}105,n,Hangup
exten => vmb105,1,Macro(vm,105,BUSY)
exten => vmb105,n,Hangup
exten => vmu105,1,Macro(vm,105,NOANSWER)
exten => vmu105,n,Hangup
exten => vms105,1,Macro(vm,105,NOMESSAGE)
exten => vms105,n,Hangup
exten => 106,1,Macro(exten-vm,106,106)
exten => 106,n,Hangup
exten => 106,hint,SIP/106
exten => ${VM_PREFIX}106,1,Macro(vm,106,DIRECTDIAL)
exten => ${VM_PREFIX}106,n,Hangup
exten => vmb106,1,Macro(vm,106,BUSY)
exten => vmb106,n,Hangup
exten => vmu106,1,Macro(vm,106,NOANSWER)
exten => vmu106,n,Hangup
exten => vms106,1,Macro(vm,106,NOMESSAGE)
exten => vms106,n,Hangup
exten => 110,1,Macro(exten-vm,110,110)
exten => 110,n,Hangup
exten => 110,hint,SIP/110
exten => ${VM_PREFIX}110,1,Macro(vm,110,DIRECTDIAL)
exten => ${VM_PREFIX}110,n,Hangup
exten => vmb110,1,Macro(vm,110,BUSY)
exten => vmb110,n,Hangup
exten => vmu110,1,Macro(vm,110,NOANSWER)
exten => vmu110,n,Hangup
exten => vms110,1,Macro(vm,110,NOMESSAGE)
exten => vms110,n,Hangup
exten => 120,1,Macro(exten-vm,120,120)
exten => 120,n,Hangup
exten => 120,hint,SIP/120
exten => ${VM_PREFIX}120,1,Macro(vm,120,DIRECTDIAL)
exten => ${VM_PREFIX}120,n,Hangup
exten => vmb120,1,Macro(vm,120,BUSY)
exten => vmb120,n,Hangup
exten => vmu120,1,Macro(vm,120,NOANSWER)
exten => vmu120,n,Hangup
exten => vms120,1,Macro(vm,120,NOMESSAGE)
exten => vms120,n,Hangup
exten => 666,1,Macro(exten-vm,novm,666)
exten => 666,n,Hangup
exten => 666,hint,SIP/666

; end of [ext-local]

[from-trunk-vpbx_test_trunk1]
include => from-trunk-vpbx_test_trunk1-custom
exten => _.,1,Set(GROUP()=OUT_2)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

; end of [from-trunk-vpbx_test_trunk1]

[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-001-route1
include => outrt-002-test_route_1
exten => foo,1,Noop(bar)

; end of [outbound-allroutes]

[outrt-001-route1]
include => outrt-001-route1-custom
exten => 9311,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => 9311,n,Macro(outisbusy,)
exten => 9411,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => 9411,n,Macro(outisbusy,)
exten => 9911,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => 9911,n,Macro(outisbusy,)
exten => _9011.,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _9011.,n,Macro(outisbusy,)
exten => _91800NXXXXXX,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _91800NXXXXXX,n,Macro(outisbusy,)
exten => _91866NXXXXXX,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _91866NXXXXXX,n,Macro(outisbusy,)
exten => _91877NXXXXXX,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _91877NXXXXXX,n,Macro(outisbusy,)
exten => _91888NXXXXXX,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _91888NXXXXXX,n,Macro(outisbusy,)
exten => _91NXXNXXXXXX,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _91NXXNXXXXXX,n,Macro(outisbusy,)
exten => _9NXXNXXXXXX,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _9NXXNXXXXXX,n,Macro(outisbusy,)
exten => _9NXXXXXX,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _9NXXXXXX,n,Macro(outisbusy,)

; end of [outrt-001-route1]

[outrt-002-test_route_1]
include => outrt-002-test_route_1-custom
exten => _+ZX.,1,Macro(dialout-trunk,2,${EXTEN:1},)
exten => _+ZX.,n,Macro(outisbusy,)
exten => _0.,1,Macro(dialout-trunk,2,${EXTEN},)
exten => _0.,n,Macro(outisbusy,)

; end of [outrt-002-test_route_1]

[app-blackhole]
include => app-blackhole-custom
exten => hangup,1,Noop(Blackhole Dest: Hangup)
exten => hangup,n,Hangup
exten => zapateller,1,Noop(Blackhole Dest: Play SIT Tone)
exten => zapateller,n,Answer
exten => zapateller,n,Zapateller()
exten => musiconhold,1,Noop(Blackhole Dest: Put caller on hold forever)
exten => musiconhold,n,Answer
exten => musiconhold,n,MusicOnHold()
exten => congestion,1,Noop(Blackhole Dest: Congestion)
exten => congestion,n,Answer
exten => congestion,n,Playtones(congestion)
exten => congestion,n,Congestion(20)
exten => congestion,n,Hangup
exten => busy,1,Noop(Blackhole Dest: Busy)
exten => busy,n,Answer
exten => busy,n,Playtones(busy)
exten => busy,n,Busy(20)
exten => busy,n,Hangup

; end of [app-blackhole]

[bad-number]
include => bad-number-custom
exten => _X.,1,ResetCDR()
exten => _X.,n,NoCDR()
exten => _X.,n,Wait(1)
exten => _X.,n,Playback(silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer)
exten => _X.,n,Wait(1)
exten => _X.,n,Congestion(20)
exten => _X.,n,Hangup
exten => _.,1,ResetCDR()
exten => _
.,n,NoCDR()
exten => _.,n,Wait(1)
exten => _
.,n,Playback(silence/1&feature-not-avail-line&silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer)
exten => _.,n,Wait(1)
exten => _
.,n,Congestion(20)
exten => _*.,n,Hangup

; end of [bad-number]

[from-internal-additional]
include => from-internal-additional-custom
include => app-dialvm
include => app-vmmain
include => app-calltrace
include => app-directory
include => app-echo-test
include => app-speakextennum
include => app-speakingclock
include => ext-queues
include => app-recordings
include => ext-group
include => grps
include => app-cf-busy-off
include => app-cf-busy-off-any
include => app-cf-busy-on
include => app-cf-off
include => app-cf-off-any
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => ext-findmefollow
include => fmgrps
include => app-userlogonoff
include => app-pickup
include => app-zapbarge
include => app-chanspy
include => ext-test
include => ext-local
include => outbound-allroutes
exten => h,1,Hangup

; end of [from-internal-additional][/i]

[/size][/code]

and here my extensions.conf

[code]
; FreePBX
; Copyright © 2004 Coalescent Systems Inc (Canada)
; Copyright © 2006 Why Pay More 4 Less Pty Ltd (Australia)
; Released under the GNU GPL Licence version 2.

; dialparties.agi (http://www.sprackett.com/asterisk/)
; Asterisk::AGI (http://asterisk.gnuinter.net/)
; gsm (http://www.ibiblio.org/pub/Linux/utils/compress/!INDEX.short.html)
; loligo sounds (http://www.loligo.com/asterisk/sounds/)
; mpg123 (http://voip-info.org/wiki-Asterisk+config+musiconhold.conf)

;************************** -WARNING- ****************************************
; *
; This include file is to be used with extreme caution. In almost all cases *
; any custom dialplan SHOULD be put in extensions_custom.conf which will *
; not hurt freepbx generated dialplan. In some very rare and custom situation *
; users have a need to override what freepbx generates. Anything in this file *
; will do such. *
; *
#include extensions_override_freepbx.conf
; *
;************************** -WARNING- ****************************************

; include extension contexts generated from AMP
#include extensions_additional.conf

; Customizations to this dialplan should be made in extensions_custom.conf
; See extensions_custom.conf.sample for an example
#include extensions_custom.conf

[from-trunk] ; just an alias since VoIP shouldn’t be called PSTN
include => from-pstn

[from-pstn]
include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
include => ext-did
include => ext-did-catchall ; THIS MUST COME AFTER ext-did
include => from-did-direct ; MODIFICATOIN (PL) for findmefollow if enabled, should be bofore ext-local
exten => fax,1,Goto(ext-fax,in_fax,1)

; MODIFICATION (PL)
;
; Required to assure that direct dids go to personal ring group before local extension.
; This could be auto-generated however I it is prefered to be put here and hard coded
; so that it can be modified if ext-local should take precedence in certain situations.
; will have to decide what to do later.
;
[from-did-direct]
include => ext-findmefollow
include => ext-local

; ############################################################################
; Macros [macro]
; ############################################################################

; Rings one or more extensions. Handles things like call forwarding and DND
; We don’t call dial directly for anything internal anymore.
; ARGS: $TIMER, $OPTIONS, $EXT1, $EXT2, $EXT3, …
; Use a Macro call such as the following:
; Macro(dial,$DIAL_TIMER,$DIAL_OPTIONS,$EXT1,$EXT2,$EXT3,…)
[macro-dial]
exten => s,1,GotoIf($["${MOHCLASS}" = “”]?dial)
exten => s,2,SetMusicOnHold(${MOHCLASS})
exten => s,3(dial),AGI(dialparties.agi)
exten => s,4,NoOp(Returned from dialparties with no extensions to call and DIALSTATUS: ${DIALSTATUS})

exten => s,10,Dial(${ds}) ; dialparties will set the priority to 10 if $ds is not null
exten => s,11,Set(DIALSTATUS=${IF($["${DIALSTATUS_CW}"!="" ]?${DIALSTATUS_CW}:${DIALSTATUS})})

exten => s,20,NoOp(Returned from dialparties with hunt groups to dial )
exten => s,21,Set(HuntLoop=0)
exten => s,22,GotoIf($[${HuntMembers} >= 1]?30 ) ; if this is from rg-group, don’t strip prefix
exten => s,23,NoOp(Returning there are no members left in the hunt group to ring)

exten => s,30,Set(HuntMember=HuntMember${HuntLoop})
exten => s,31,GotoIf($[$["${CALLTRACE_HUNT}" != “” ] & $["${RingGroupMethod}" = “hunt” ]]?32:35 ) ; Set CAll Trace for Hunt member we are going to call
exten => s,32,Set(CT_EXTEN=${CUT(ARG3,$[${HuntLoop} + 1])})
exten => s,33,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
exten => s,34,Goto(s,42)

exten => s,35,GotoIf($[$["${CALLTRACE_HUNT}" != “” ] & $["${RingGroupMethod}" = “memoryhunt” ]]?36:50 ) ;Set Call Trace for each hunt member we are going to call "Memory groups have multiple members to set CALL TRACE For hence the loop
exten => s,36,Set(CTLoop=0)
exten => s,37,GotoIf($[${CTLoop} > ${HuntLoop}]?42 ) ; if this is from rg-group, don’t strip prefix
exten => s,38,Set(CT_EXTEN=${CUT(ARG3,$[${CTLoop} + 1])})
exten => s,39,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
exten => s,40,Set(CTLoop=$[1 + ${CTLoop}])
exten => s,41,Goto(s,37)

exten => s,42,Dial(${${HuntMember}}${ds} ) ; dialparties will set the priority to 20 if $ds is not null and its a hunt group
exten => s,43,Set(HuntLoop=$[1 + ${HuntLoop}])
exten => s,44,GotoIf($[$[$[“foo${RingGroupMethod}” != “foofirstavailable”] & $[“foo${RingGroupMethod}” != “foofirstnotonphone”]] | $[“foo${DialStatus}” = “fooBUSY”]]?46)
exten => s,45,Set(HuntMembers=0)
exten => s,46,Set(HuntMembers=$[${HuntMembers} - 1])
exten => s,47,Goto(s,22)
exten => s,50,DBdel(CALLTRACE/${CT_EXTEN})
exten => s,51,Goto(s,42)

; make sure hungup calls go here so that proper cleanup occurs from call confirmed calls and the like
;
exten => h,1,Macro(hangupcall)

; Ring an extension, if the extension is busy or there is no answer send it
; to voicemail
; ARGS: $VMBOX, $EXT
[macro-exten-vm]
exten => s,1,Macro(user-callerid)

exten => s,n,Set(FROMCONTEXT=exten-vm)
exten => s,n,Set(VMBOX=${ARG1})
exten => s,n,Set(EXTTOCALL=${ARG2})
exten => s,n,Set(CFUEXT=${DB(CFU/${EXTTOCALL})})
exten => s,n,Set(CFBEXT=${DB(CFB/${EXTTOCALL})})
exten => s,n,Set(RT=${IF($[$["${VMBOX}"!=“novm”] | $[“foo${CFUEXT}”!=“foo”]]?${RINGTIMER}:"")})
exten => s,n,Macro(record-enable,${EXTTOCALL},IN)

exten => s,n,Macro(dial,${RT},${DIAL_OPTIONS},${EXTTOCALL})
exten => s,n,Set(SV_DIALSTATUS=${DIALSTATUS})
exten => s,n,GosubIf($[$["${SV_DIALSTATUS}"=“NOANSWER”] & $[“foo${CFUEXT}”!=“foo”]]?docfu,1) ; check for CFU in use on no answer
exten => s,n,GosubIf($[$["${SV_DIALSTATUS}"=“BUSY”] & $[“foo${CFBEXT}”!=“foo”]]?docfb,1) ; check for CFB in use on busy
exten => s,n,Set(DIALSTATUS=${SV_DIALSTATUS})
exten => s,n,NoOp(Voicemail is ‘${VMBOX}’)
exten => s,n,GotoIf($["${VMBOX}" = “novm”]?s-${DIALSTATUS},1) ; no voicemail in use for this extension
exten => s,n,NoOp(Sending to Voicemail box ${EXTTOCALL})
exten => s,n,Macro(vm,${VMBOX},${DIALSTATUS})

; Try the Call Forward on No Answer / Unavailable number
exten => docfu,1,Set(RTCFU=${IF($["${VMBOX}"!=“novm”]?${RINGTIMER}:"")})
exten => docfu,n,Dial(Local/${CFUEXT}@from-internal/n,${RTCFU},${DIAL_OPTIONS})
exten => docfu,n,Return

; Try the Call Forward on Busy number
exten => docfb,1,Set(RTCFB=${IF($["${VMBOX}"!=“novm”]?${RINGTIMER}:"")})
exten => docfb,n,Dial(Local/${CFBEXT}@from-internal/n,${RTCFB},${DIAL_OPTIONS})
exten => docfb,n,Return

; Extensions with no Voicemail box reporting BUSY come here
exten => s-BUSY,1,NoOp(Extension is reporting BUSY and not passing to Voicemail)
exten => s-BUSY,n,Playtones(busy)
exten => s-BUSY,n,Busy(20)

; Anything but BUSY comes here
exten => _s-.,1,Playtones(congestion)
exten => _s-.,n,Congestion(10)

;------------------------------------------------------------------------
; [macro-vm]
;------------------------------------------------------------------------
; CONTEXT: macro-vm
; PURPOSE: call voicemail system and extend with personal ivr
;
; Under normal use, this macro will call the voicemail system with the extension and
; desired greeting mode of busy, unavailable or as specified with direct voicemail
; calls (usually unavailable) when entered from destinations.
;
; The voicemail system’s two greetings have been ‘hijacked’ as follows to extend the
; system by giving the option of a private ‘ivr’ for each voicemail user. The following
; applies to both the busy and unavailable modes of voicemail and can be applied to one
; or both, and differently.
;
; Global Defaults:
;
; The following are default values, used in both busy and unavail modes if no specific
; values are specified.
;
; VMX_REPEAT
; The number of times to repeat the users message if no option is pressed.
; VMX_TIMEOUT
; The timeout to wait after playing message before repeating or giving up.
; VMX_LOOPS
; The number of times it should replay the message and check for an option when
; an invalid option is pressed.
;
; VMX_OPTS_DOVM
; Default voicemail option to use if vm is chosen as an option. No options will
; cause Allison’s generic message, ‘s’ will go straight to beep.
; VMX_OPTS_TIMEOUT
; Default voicemail option to use if it times out with no options. No options will
; cause Allison’s generic message, ‘s’ will go straight to beep.
; IF THE USER PRESSES # - it will look like a timeout as well since no option will
; be presented. If the user wishes to enable a mode where a caller can press #
; during their message and it goes straight to voicemail with only a ‘beep’ then
; this should be set to ‘s’.
; VMX_OPTS_LOOPS
; Default voicemail option to use if to many wrong options occur. No options will
; cause Allison’s generic message, ‘s’ will go straight to beep.
;
; VMX_CONTEXT
; Default context for user destinations if not supplied in the user’s settings
; VMX_PRI
; Default priority for user destinations if not supplied in the user’s settings
;
; VMX_TIMEDEST_CONTEXT
; Default context for timeout destination if not supplied in the user’s settings
; VMX_TIMEDEST_EXT
; Default extension for timeout destination if not supplied in the user’s settings
; VMX_TIMEDEST_PRI
; Default priority for timeout destination if not supplied in the user’s settings
;
; VMX_LOOPDEST_CONTEXT
; Default context for loops destination if not supplied in the user’s settings
; VMX_LOOPDEST_EXT
; Default extension for loops destination if not supplied in the user’s settings
; VMX_LOOPDEST_PRI
; Default priority for loops destination if not supplied in the user’s settings
;
;
; The AMPUSER database variable has been extended with a ‘vmx’ tree (vm-extension). A
; duplicate set is included for both unavail and busy. You could choose for to have an
; ivr when unavail is taken, but not with busy - or a different once with busy.
; The full list is below, each specific entry is futher described:
;
; state: Whether teh current mode is enabled or disabled. Anything but ‘enabled’ is
; treated as disabled.
; repeat: This is the number of times that the users message should be played after the
; timeout if the user has not entered anything. It is just a variable to the
; Read() function which will do the repeating.
; timeout: This is how long to wait after the message has been read for a response from
; the user. A caller can enter a digit any time during the playback.
; loops: This is the number of loops that the system will allow a caller to retry if
; they enter a bad menu choice, before going to the loop failover destination
; vmxopts: This is the vm options to send to the voicemail command used when a specific
; voicemail destination is chosen (inidcated by ‘dovm’ in the ext field). This is
; typically either set to ‘s’ or left blank. When set to ‘s’ there will be no
; message played when entering the voicemail, just a beep. When blank, you will
; have Allison’s generic message played. It is not typical to play the greetings
; since they have been ‘hijacked’ for these IVR’s and from a caller’s perspecitive
; this system appears interconnected with the voicemail so instructions can be
; left there.
; timedest: The three variables: ext, context and pri are the goto destination if the caller
; enters no options and it timesout. None have to be set and a system default
; will be used. If just ext is set, then defaults will be used for context and
; pri, etc.
; loopdest: This is identical to timedest but used if the caller exceeds the maximum invalid
; menu choices.
; [0-9*]: The user can specify up to 11 ivr options, all as single digits from 0-9 or . The
; # key can not be used since it is used as a terminator key for the Read command
; and will never be returned. A minimum of the ext must be specified for each valid
; option and as above, the context and priority can also be specified if the default
; is not to be used.
; Option ‘0’ takes on a special meaning. Since a user is able to break out of the
; voicemail command once entering it with a 0, if specified, the 0 destination will
; be used.
; Option '
’ can also be used to breakout. It is undecided at this point whether
; providing that option will be used as well. (probably should).
;
;
; /AMPUSER//vmx/[busy|unavail]/state: enabled|disabled
; /AMPUSER//vmx/[busy|unavail]/repeat: n (times to repeat message)
; /AMPUSER//vmx/[busy|unavail]/timeout: n (timeout to wait for digit)
; /AMPUSER//vmx/[busy|unavail]/loops: n (loop returies for invalid entries)
; /AMPUSER//vmx/[busy|unavail]/vmxopts/dovm: vmoptions (if ext is dovm)
; /AMPUSER//vmx/[busy|unavail]/vmxopts/timeout: vmoptions (if timeout)
; /AMPUSER//vmx/[busy|unavail]/vmxopts/loops: vmoptions (if loops)
; /AMPUSER//vmx/[busy|unavail]/timedest/ext: extension (if timeout)
; /AMPUSER//vmx/[busy|unavail]/timedest/context: context (if timeout)
; /AMPUSER//vmx/[busy|unavail]/timedest/pri: priority (if timeout)
; /AMPUSER//vmx/[busy|unavail]/loopdest/ext: extension (if too many failures)
; /AMPUSER//vmx/[busy|unavail]/loopdest/context: context (if too many failures)
; /AMPUSER//vmx/[busy|unavail]/loopdest/pri: priority (if too many failures)
; /AMPUSER//vmx/[busy|unavail]/[0-9*]/ext: extension (dovm for vm access)
; /AMPUSER//vmx/[busy|unavail]/[0-9*]/context: context
; /AMPUSER//vmx/[busy|unavail]/[0-9*]/pri: priority
;------------------------------------------------------------------------
[macro-vm]
; ARG1 - extension
; ARG2 - DIRECTDIAL/BUSY
exten => s,1,Macro(user-callerid,SKIPTTL)
exten => s,n,Set(VMGAIN=${IF($[“foo${VM_GAIN}”!=“foo”]?“g(${VM_GAIN})”:"")})
;
; If BLKVM_OVERRIDE is set, then someone told us to block calls from going to
; voicemail. This variable is reset by the answering channel so subsequent
; transfers will properly function.
;
exten => s,n,GotoIf($[“foo${DB(${BLKVM_OVERRIDE})}” != “fooTRUE”]?vmx,1)
;
; we didn’t branch so block this from voicemail
;
exten => s,n,Noop(CAME FROM: ${NODEST} - Blocking VM cause of key: ${DB(BLKVM_OVERRIDE)})

; If vmx not enabled for the current mode,then jump to normal voicemail behavior
; also - if not message (no-msg) is requested, straight to voicemail
;
exten => vmx,1,GotoIf($["${ARG2}"=“NOMESSAGE”]?s-${ARG2},1)
exten => vmx,n,Set(MODE=${IF($["${ARG2}"=“BUSY”]?busy:unavail)})
exten => vmx,n,GotoIf($["${ARG2}" != “DIRECTDIAL”]?notdirect)
exten => vmx,n,Set(MODE=${IF($["${REGEX("[b]" ${VM_DDTYPE})}" = “1”]?busy:${MODE})})
exten => vmx,n(notdirect),Noop(Checking if ext ${ARG1} is enabled: ${DB(AMPUSER/${ARG1}/vmx/${MODE}/state)})
exten => vmx,n,GotoIf($["${DB(AMPUSER/${ARG1}/vmx/${MODE}/state)}" != “enabled”]?s-${ARG2},1)

; If the required voicemail file does not exist, then abort and go to normal voicemail behavior
;
; TODO: there have been errors using System() with jump to 101 where asterisk works fine at the begining and
; then starts to jump to 101 even on success. This new mode is being tried with the SYSTEM Status which
; returns SUCCESS when the command returned succcessfully with a 0 app return code.
;
exten => vmx,n,Macro(get-vmcontext,${ARG1})
;exten => vmx,n,TrySystem(/bin/ls ${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}.[wW][aA][vV])
exten => vmx,n,AGI(checksound.agi,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE})
exten => vmx,n,GotoIf($["${SYSTEMSTATUS}" != “SUCCESS”]?nofile)

; Get the repeat, timeout and loop times to use if they are overriden form the global settings
;
exten => vmx,n,Set(LOOPCOUNT=0)
exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/repeat)}" = “0”]?vmxtime)
exten => vmx,n,Set(VMX_REPEAT=${DB_RESULT})
exten => vmx,n(vmxtime),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timeout)}" = “0”]?vmxloops)
exten => vmx,n,Set(VMX_TIMEOUT=${DB_RESULT})
exten => vmx,n(vmxloops),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/loops)}" = “0”]?vmxanswer)
exten => vmx,n,Set(VMX_LOOPS=${DB_RESULT})
exten => vmx,n(vmxanswer),Answer()

; Now play the users voicemail recording as the basis for their ivr, the Read command will repeat as needed and if it timesout
; then we go to the timeout. Otherwise handle invalid options by looping until the limit until a valid option is played.
;
exten => vmx,n(loopstart),Read(ACTION,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE},1,skip,${VMX_REPEAT},${VMX_TIMEOUT})
exten => vmx,n,GotoIf($["${EXISTS(${ACTION})}" = “1”]?checkopt)

; If we are here we timed out, go to the required destination
;
exten => vmx,n(noopt),Noop(Timeout: going to timeout dest)
exten => vmx,n,Set(VMX_OPTS=${VMX_OPTS_TIMEOUT})
exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/vmxopts/timeout)}" = “0”]?chktime)
exten => vmx,n,Set(VMX_OPTS=${DB_RESULT})
exten => vmx,n(chktime),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timedest/ext)}" = “0”]?dotime)
exten => vmx,n,Set(VMX_TIMEDEST_EXT=${DB_RESULT})
exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timedest/context)}" = “0”]?timepri)
exten => vmx,n,Set(VMX_TIMEDEST_CONTEXT=${DB_RESULT})
exten => vmx,n(timepri),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timedest/pri)}" = “0”]?dotime)
exten => vmx,n,Set(VMX_TIMEDEST_PRI=${DB_RESULT})
exten => vmx,n(dotime),Goto(${VMX_TIMEDEST_CONTEXT},${VMX_TIMEDEST_EXT},${VMX_TIMEDEST_PRI&#

it is not a freepbx forum, ask there or in irc channel efnode #freepbx. The reason why i wont answer you is simple as it is written in irc of #asterisk It is made up of complex dialplans and scripts which can’t be easily supported by people who aren’t deeply involved.