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 [55539222@custom-restricted-trunk1:1] NoOp(“Local/55539222@custom-restricted-trunk1-0000000e;2”, “Testing for Call Restriction 1 TRUE”) in new stack
[2015-03-03 09:26:42] VERBOSE[19824][C-000000b6] pbx.c: – Executing [55539222@custom-restricted-trunk1:2] GotoIf(“Local/55539222@custom-restricted-trunk1-0000000e;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 [55539222@custom-restricted-trunk1:3] NoOp(“Local/55539222@custom-restricted-trunk1-0000000e;2”, “Call blocked due to call restriction: 1”) in new stack
[2015-03-03 09:26:42] VERBOSE[19824][C-000000b6] pbx.c: – Executing [55539222@custom-restricted-trunk1:4] Playback(“Local/55539222@custom-restricted-trunk1-0000000e;2”, “feature-not-avail-line,noanswer”) in new stack
[2015-03-03 09:26:42] VERBOSE[19824][C-000000b6] file.c: – <Local/55539222@custom-restricted-trunk1-0000000e;2> Playing ‘feature-not-avail-line.gsm’ (language ‘en’)
[2015-03-03 09:26:44] VERBOSE[19824][C-000000b6] pbx.c: – Executing [55539222@custom-restricted-trunk1:5] Goto(“Local/55539222@custom-restricted-trunk1-0000000e;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 [congestion@app-blackhole:1] NoOp(“Local/55539222@custom-restricted-trunk1-0000000e;2”, “Blackhole Dest: Congestion”) in new stack
[2015-03-03 09:26:44] VERBOSE[19824][C-000000b6] pbx.c: – Executing [congestion@app-blackhole:2] PlayTones(“Local/55539222@custom-restricted-trunk1-0000000e;2”, “congestion”) in new stack
[2015-03-03 09:26:44] VERBOSE[19824][C-000000b6] pbx.c: – Executing [congestion@app-blackhole:3] Congestion(“Local/55539222@custom-restricted-trunk1-0000000e;2”, “20”) in new stack
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] app_dial.c: – Local/55539222@custom-restricted-trunk1-0000000e;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 [s@macro-dialout-trunk: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 [s@macro-dialout-trunk: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 [s-CONGESTION@macro-dialout-trunk:1] Set(“SIP/1001-000000f3”, “RC=0”) in new stack
[2015-03-03 09:26:44] VERBOSE[19823][C-000000b6] pbx.c: – Executing [s-CONGESTION@macro-dialout-trunk: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 [0@macro-dialout-trunk: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 [continue@macro-dialout-trunk: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.