Custom extension not accessible?

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.

; 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] ==–;

You need to write custom stuff in extensions_custom.conf

Asterisk dialplan does not know to look for something in your context if you didn’t tell it to.

That didn’t work, maybe because my script is under it’s own context. There must be some file in /etc/asterisk/ where I need to declare the existence my context which is [app-ecfu-external] and somehow attach it to [from-internal-custom] but in a way that doesn’t suddenly make all my variables and subroutines GLOBAL.

The only file read by asterisk is /etc/asterisk/extensions.conf
includes are prefixed with #include and also so prioritized .

so you need to “include” [app-ecfu-external] to have *3238 ‘included’

it is usually easier to add [*3238] to a readily includable context like in /etc/asterisk/extensions_custom.conf

But you also could ‘include’ all your ‘includes’ into an already ‘included’ context :wink:

Put your script in extensions_custom.conf, then in the GUI:
Add a Custom Destination with Target: app-ecfu-external,*3238,1 and Description: ecfu
Add a Misc Application with Feature Code: *3238 and Destination: Custom Destinations ecfu

Thanks guys, it’s working FANTASTICALLY WELL now, look:

$ /etc/asterisk $ asterisk -rx ‘dialplan show’ | grep app-ecfu-external
2. Goto(app-ecfu-external,*3238,1) [extensions_additional.conf:5799]
3. Goto(app-ecfu-external,*3238,1) [extensions_additional.conf:1996]
[ Context ‘app-ecfu-external’ created by ‘pbx_config’ ]
Include => ‘app-ecfu-external-custom’ [pbx_config]

Question though: How come my code doesn’t work from within extensions_override_freepbx.conf even though the code which comes pre-installed with FreePBX/asterisk works fine from there?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.