Quantcast
Channel: FreePBX - FreePBX Community Forums
Viewing all articles
Browse latest Browse all 17433

Custom Context Extension Blocks

$
0
0

@adtopkek wrote:

I'm having an issue with some custom context's I created. They worked well for a while but now I am getting an asterisk error that I believe is related to having too much includes in my contexts.

[2017-05-16 13:30:31] WARNING[32615][C-00002516]: pbx.c:2461 pbx_find_extension: Maximum PBX stack exceeded

I'm trying to isolate certain extension blocks from being able to call one another. Ex 1XX cannot call anyone outside of the 1XX extension range, 2XX can only dial 2XX numbers without getting a "not in service" error.

I start with an extension block context that I set as the context to every extension in said range. It allows certain calls to go to from-internal and work like normal:

[fourhundred-firewall]
; Allows these extensions and these extension star codes
exten => _4XX,1,Goto(from-internal,${EXTEN},1)
exten => _*4XX,1,Goto(from-internal,${EXTEN},1)
include => template-firewall

That inherits/includes a general context that they all inherit/include. This is designed to allow 7+ digit dialing to go through along with some exceptions then block everything else.

[template-firewall]
; Allows 7 digit numbers and above
exten => _XXXXXX.,1,Goto(from-internal,${EXTEN},1)

; Allows Certian Special Numbers
exten => _911,1,Goto(from-internal,${EXTEN},1)
exten => _933,1,Goto(from-internal,${EXTEN},1)

; Denies All Regular Numbers
exten => _X.,1,Answer(10)
exten => _X.,n,playback(ss-noservice)
exten => _X.,n,Hangup()

; Allows Certain feature codes to dial through
exten => _[*]2[789].,1,Goto(from-internal,${EXTEN},1)
exten => _[*]8[56]XX.,1,Goto(from-internal,${EXTEN},1)
exten => _[*]21XX.,1,Goto(from-internal,${EXTEN},1)

; Deny access to voicemails/Feature Codes
exten => *XXX,1,Answer(10)
exten => _*XXX,n,playback(ss-noservice)
exten => _*XXX,n,Hangup()
exten => *XXXX,1,Answer(10)
exten => _*XXXX,n,playback(ss-noservice)
exten => _*XXXX,n,Hangup()
exten => *XXXXX,1,Answer(10)
exten => _*XXXXX,n,playback(ss-noservice)
exten => _*XXXXX,n,Hangup()
include => from-internal

This was working well and didn't mess up the BLF keys and dialing worked exactly as I wanted it to. Then I started getting the error:

[2017-05-16 13:30:31] WARNING[32615][C-00002516]: pbx.c:2461 pbx_find_extension: Maximum PBX stack exceeded

I think it is related to too many includes but I am having trouble getting anything else to work that doesn't mess up BLF keys or work like this context does.

I'm relatively new at adding contexts to asterisk and I am wondering if I am doing this the proper way or if I am doing some overly elaborate method when there is a much better way of doing it that I don't know about. Wouldn't be the first time that happened.

Any advice or code critique?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17433

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>