Restrict outbound calling from specific extensions

Hi,

I am following this guide;
http://www.freepbx.org/support/documentation/howtos/how-to-give-a-particular-extension-different-or-restricted-trunk-access
In order to restrict specific extensions from dialling external numbers.

So far, the dial plan is working. In logs I can see the call being marked as restricted, and the logs even indicate that an error is being played back. However, the call is not hung up because it fails over to the next trunk, and places the call successfully.

How can I get this to NOT failover, should the call be restricted? Or, why isn’t the dialplan actually hanging up the call, like it should be?

Appreciate the help, guys :smile:

edit: I’m on asterisk 11 with freepbx 2.11

edit 2: here’s a snippet of the logs, showing the call failing over to the next trunk

[2015-03-03 09:26:42] VERBOSE[19824][C-000000b6] pbx.c: – Executing [[email protected]:1] NoOp(“Local/[email protected];2”, “Testing for Call Restriction 1 TRUE”) in new stack
[2015-03-03 09:26:42] VERBOSE[19824][C-000000b6] pbx.c: – Executing [[email protected]:2] GotoIf(“Local/[email protected];2”, “1?restrict1:norestrict1”) in new stack
[2015-03-03 09:26:42] VERBOSE[19824][C-000000b6] pbx.c: – Goto (custom-restricted-trunk1,55539222,3)
[2015-03-03 09:26:42] VERBOSE[19824][C-000000b6] pbx.c: – Executing [[email protected]:3] NoOp(“Local/[email protected];2”, “Call blocked due to call restriction: 1”) in new stack
[2015-03-03 09:26:42] VERBOSE[19824][C-000000b6] pbx.c: – Executing [[email protected]:4] Playback(“Local/[email protected];2”, “feature-not-avail-line,noanswer”) in new stack
[2015-03-03 09:26:42] VERBOSE[19824][C-000000b6] file.c: – <Local/[email protected];2> Playing ‘feature-not-avail-line.gsm’ (language ‘en’)
[2015-03-03 09:26:44] VERBOSE[19824][C-000000b6] pbx.c: – Executing [[email protected]:5] Goto(“Local/[email protected];2”, “app-blackhole,congestion,1”) in new stack
[2015-03-03 09:26:44] VERBOSE[19824][C-000000b6] pbx.c: – Goto (app-blackhole,congestion,1)
[2015-03-03 09:26:44] VERBOSE[19824][C-000000b6] pbx.c: – Executing [[email protected]:1] NoOp(“Local/[email protected];2”, “Blackhole Dest: Congestion”) in new stack
[2015-03-03 09:26:44] VERBOSE[19824][C-000000b6] pbx.c: – Executing [[email protected]:2] PlayTones(“Local/[email protected];2”, “congestion”) in new stack
[2015-03-03 09:26:44] VERBOSE[19824][C-000000b6] pbx.c: – Executing [[email protected]:3] Congestion(“Local/[email protected];2”, “20”) in new stack
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] app_dial.c: – Local/[email protected];1 is circuit-busy
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] app_dial.c: == Everyone is busy/congested at this time (1:0/1/0)
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Executing [[email protected]:31] NoOp(“SIP/1001-000000f3”, “Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 0”) in new stack
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Executing [[email protected]:32] GotoIf(“SIP/1001-000000f3”, “0?continue,1:s-CONGESTION,1”) in new stack
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Goto (macro-dialout-trunk,s-CONGESTION,1)
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Executing [[email protected]:1] Set(“SIP/1001-000000f3”, “RC=0”) in new stack
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Executing [[email protected]:2] Goto(“SIP/1001-000000f3”, “0,1”) in new stack
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Goto (macro-dialout-trunk,0,1)
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Executing [[email protected]:1] Goto(“SIP/1001-000000f3”, “continue,1”) in new stack
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Goto (macro-dialout-trunk,continue,1)
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Executing [[email protected]:1] NoOp(“SIP/1001-000000f3”, “TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 0 - failing through to other trunks”) in new stack

I’m playing around with the custom contexts module now…

I have achieved what I want so far so I guess I’ll just stick with this…

The Commercial (but $0 - free) extension routes module does exactly this.