I put this into extensions_override_freepbx.conf but I can’t get it to invoke via *3238. Requesting help on how to register it with Asterisk please.
[app-ecfu-external]
;--------------------------------------------------------------------------------;
; Password protected External Call Forward Unforward (*3238) for use via IVR ;
; (this one doesn’t replace existing functionality so install it per below) ;
;--------------------------------------------------------------------------------;
; Append this script to the end of: /etc/asterisk/extensions_custom.conf ;
; Admin / Custom Destinations / Add… Target: app-ecfu-external,*3238,1 ;
; Description: ECFU ;
; Applications / Misc Applications / Add… Feature Code: *3238 ;
; Destination: Custom Destinations ;
; ECFU ;
; Troubleshoot with: asterisk -rx ‘dialplan show app-ecfu-external’ ;
; Users who call in from outside will be prompted for their extension password. ;
; To forward the extension you are calling from you can just press pound #. ;
; To cancel a call-forward simply press pound # without an extension number. ;
; Password prompting is configurable as explained in the commented lines below. ;
; Based on [app-cf-off] and [app-ecfu-external] in extensions_additional.conf ;
;--------------------------------------------------------------------------------;
include => app-ecfu-external-custom
exten => lang-playback,1,GosubIf($[${DIALPLAN_EXISTS(app-ecfu-external,${CHANNEL(language)})}]?app-ecfu-external,${CHANNEL(language)},${ARG1}():app-ecfu-external,en,${ARG1}())
exten => lang-playback,n,Return()
exten => *3238,1,Answer
exten => *3238,n,Wait(1)
exten => *3238,n,Macro(user-callerid,)
exten => *3238,n(fromread),Gosub(app-ecfu-external,lang-playback,1(hook_0))
exten => *3238,n,Set(fromext=${IF($[“foo${fromext}”=“foo”]?${AMPUSER}:${fromext})})
exten => *3238,n,GotoIf($["${DB_EXISTS(AMPUSER/${fromext}/followme/ddial)}"=“0”]?fromread)
exten => *3238,n,Wait(1)
; Uncomment if internal users may forward their own extension without a password:
exten => *3238,n,GotoIf($["${AMPUSER}"="$fromext"]?authok)
; Uncomment if interinal users may forward any extension without a password:
exten => *3238,n,GotoIf($[“foo${AMPUSER}”!=“foo”]?authok)
; Uncomment two lines if external users must enter extension passwords:
exten => *3238,n,VMAuthenticate(${fromext})
exten => *3238,n,Wait(1)
; End of configurable section. Comment out sections above as desired.
exten => *3238,n(authok),GotoIf($["${DB_EXISTS(CF/${fromext})}"=“0”]?saydis)
exten => *3238,n,Set(toext=${DB_RESULT})
exten => *3238,n,Gosub(app-ecfu-external,lang-playback,1(hook_2))
exten => *3238,n,Wait(1)
exten => *3238,n(startread),Gosub(app-ecfu-external,lang-playback,1(hook_1))
exten => *3238,n,Wait(1)
exten => *3238,n,GotoIf($[“foo${toext}”=“foo”]?cfoff)
exten => *3238,n,Set(DB(CF/${fromext})=${toext})
exten => *3238,n,Set(STATE=BUSY)
exten => *3238,n,Gosub(app-ecfu-external,sstate,1())
exten => *3238,n,Gosub(app-ecfu-external,lang-playback,1(hook_2))
exten => *3238,n,Macro(hangupcall,)
exten => *3238,n(saydis),Gosub(app-ecfu-external,lang-playback,1(hook_3))
exten => *3238,n,Goto(startread)
exten => *3238,n(cfoff),Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
exten => *3238,n,Set(STATE=NOT_INUSE)
exten => *3238,n,Gosub(app-ecfu-external,sstate,1())
exten => *3238,n,Gosub(app-ecfu-external,lang-playback,1(hook_3))
exten => *3238,n,Macro(hangupcall,)
exten => sstate,1,Set(DEVICE_STATE(Custom:CF${fromext})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${fromext}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = “” ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVCF${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()
exten => en,1(hook_0),Read(fromext,please-enter-your-extension-then-press-pound,)
exten => en,n,Return()
exten => en,n(hook_1),Read(toext,agent-newlocation,)
exten => en,n,Return()
exten => en,n(hook_2),Playback(call-fwd-unconditional&for&extension)
exten => en,n,SayDigits(${fromext})
exten => en,n,Playback(is-set-to)
exten => en,n,SayDigits(${toext})
exten => en,n,Return()
exten => en,n(hook_3),Playback(call-fwd-unconditional&for&extension)
exten => en,n,SayDigits(${fromext})
exten => en,n,Playback(is-set-to&de-activated)
exten => en,n,Return()
exten => ja,1(hook_0),Read(fromext,extension&please-enter-your&vm-press-pound,)
exten => ja,n,Return()
exten => ja,n(hook_1),Read(toext,ent-target-attendant&vm-press-pound,)
exten => ja,n,Return()
exten => ja,n(hook_2),Playback(extension)
exten => ja,n,SayDigits(${fromext})
exten => ja,n,Playback(jp-no&call-fwd-unconditional&jp-wo)
exten => ja,n,SayDigits(${toext})
exten => ja,n,Playback(is-set-to)
exten => ja,n,Return()
exten => ja,n(hook_3),Playback(extension)
exten => ja,n,SayDigits(${fromext})
exten => ja,n,Playback(jp-no&call-fwd-unconditional&jp-wo&de-activated&is-set-to)
exten => ja,n,Return()
;–== end of [app-ecfu-external] ==–;