When I was using old version of asterisk,the below context works for me. It helps me to prevent extensions under emergency-from-internal context to dial authorized trunks. When i use the same with new Freepbx, it doesn’t work. Please help me on this.

;allow phones to use applications
;Followiwing lines added for VoiceMail Retrieval (MWI)
#exten => default,1,VoiceMailMain(${CALLERID(num)})
#exten => asterisk,1,VoiceMailMain(${CALLERID(num)})
#xten => unknown,1,VoiceMailMain(${CALLERID(num)})
#exten => Unknown,1,VoiceMailMain(${CALLERID(num)})
include => app-vmmain
include => app-userlogonoff
include => app-directory
include => app-dnd
include => app-callforward
include => app-callwaiting
include => app-messagecenter
include => app-calltrace
include => parkedcalls
include => from-internal-custom
;allow phones to dial other extensions
include => ext-fax
include => ext-local
#include => ext-group
include => ext-queues
include => ext-zapbarge
include => ext-meetme
include => ext-record
include => ext-test
;allow phones to access trunks
include => outbound-allroutes
include => outrt-4
include => outrt-5
include => outrt-6
include => outrt-7
exten => _9.,1,Macro(emergency) ; Authorised for internal and outgoing emergency calls only.
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)



; is to denote a comment

is to to include another file.

Asterisk = The Engine
FreePBX = the cockpit with all the knobs dials and flashy lights.

What did you change exactly… versions that work? current versions?

Note things do get deprecated by Asterisk. Under the hood we generate different dialplan for different Asterisk versions based on that versions needs.

In addition to the syntax errors the code in general doesn’t pass sanity check. The default, Asterisk, unknown and Unknown sequence ID’s are probably unreasolved.

Also do you have a macro called “emergency”

I think if you take a look at the wiki
at the extension routing and outbound route modules you can achieve what you want without any custom extensions.