Maximum PBX stack exceeded

We are currently running a new install of FreePBX version 10.13.66-5 with Asterisk 13. We have 676 inbound DID, 430 Extensions, 287 Outbound routes, 224 Queues and 1 Trunk. The Outbound routes are configured to mask the CID of the area code being dialed to simulate a local call. The sequence order is alphabetical by state with the outbound “catch all” at the bottom of the list. I can enable up to 137 of the outbound routes for any given extension, with the “catch all” being one of them, without any issues. Once I enable one more of them the calls will not connect and the Maximum PBX stack exceeded message scrolls through the asterisk log. I understand that we can pick and choose with outbound routes are used for each extension but we have agents who are regularly obtaining new licenses in various states. This would make for maintaining this a cumbersome task. I have attempted to disable the custom content per another forum posting, this has not resolved the issue. I am hoping someone can explain to me what I am doing wrong and how I should go about resolving this issue.

That sounds extremely cumbersome no matter how you do it. :blush: Do you actually have DID’s in all those area codes and is that why you have all the outbound routes? Otherwise, there are probably ways to consolidate your outbound routes down if you simply want to send 7 digit caller id - especially if you have the same 7 digit DID in different area codes. If you absolutely can’t, you might have to look at using the commercial ‘class of service’ module instead of extension routes which might be more robust at handling what you are trying to do.

Yes we own 1 DID for every US based area code and one DID for each extension as we use these to handle faxing capabilities to the extensions as well. The numbers specified within the outbound rules are directed to an inbound queue of screeners who distribute the calls according to area and product type. This is not including the numerous DIDs we use for various marketing campaigns. We do not mind purchasing the ‘class of service’ module but it seems that it is a more in-depth version of ‘Extension Routes’ and I am concerned it will not resolve the underlying issue as I can limit the outbound routes currently that they can access but this is not effective for our agents who hold licenses in more than 15 states.

It sounds like the error you get is a hard limit within asterisk itself, probably because it becomes inefficient to sift through that much stuff for every outbound call, especially on a busy system, so it is very likely Co’s module won’t fix this. I guess everything has a limit. So, you might have to use multiple PBX instances based on region or like I said earlier, find a way to consolidate your outbound routes. Frankly it just doesn’t sound like a single freepbx is the most efficient tool for the job you are trying to make it do. Had you considered the possibility of these limitations prior to choosing fpbx? Did you upgrade from a previous version of asterisk that did work this way or did you come from a completely different pbx platform?

It might be more efficient to dynamically change ${CALLERID(number)} in [macro-dialout-trunk-predial-hook] and/or [from-internal-custom] depending on ${EXTEN}

see /etc/asterisk/extensions.conf for the basic rules, it could save a lot of effort and maintenance.

Perhaps [ext-did-custom] also for inbound routing perhaps with a set of asteriskdb put/get’s to so redirect/distribute the inbound calls. It would dramatically reduce your dialplan which is the root of your problem but at the loss of a GUI to do it with.

1 Like

FreePBX was the company solution prior to me taking over this position. I am attempting to acclimate myself to a system that I am not familiar with and execute the requests of management simultaneously.

I have decided to abandon this project for now until I can better understand what needs to be done. I am sure that [quote=“dicko, post:5, topic:32576”]
t might be more efficient to dynamically change ${CALLERID(number)} in [macro-dialout-trunk-predial-hook] and/or [from-internal-custom] depending on ${EXTEN
[/quote] could be the solution for my problem but do not feel comfortable making changes to the dialplan that I do not understand.

Thank you for your assistance.

Settings -> Advanced settings-> Disable -custom Context Include = yes

If you are not using custom contexts.

This was already disabled prior to starting this string.

It seems that this project is now moving to a full fledged necessity. Does anyone have any thoughts on executing this in a workable fashion.

Maybe disabling any modules you do not use?

You have a couple of recourses:-

a) reduce your dial plan complexity, perhaps as I suggested previously.
b) redefine AST_PBX_MAX_STACK in the source file “include/asterisk/pbx.h” and “include/asterisk/extconf.h” and recompile/reinstall asterisk

Both require some “understanding” :slight_smile: