[SOLVED]Freepbx suddenly stop match prefix for outbound routes

Hi,
I’m using prefix freepbx verstion 2.11.0.38. It works fine in general, but sometimes is happening some prefix to stop working.
Then I have to delete the outbound route with non working prefix and create it again in order to get the prefix back to work.
And this happens 2 to 3 times per week.
Bellow is cli log showing where the calls stop. Any ideas are wellcome:

-- Executing [[email protected]:1] Macro("SIP/201-0000155e", "user-callerid,LIMIT,EXTERNAL,") in new stack
-- Executing [[email protected]:1] Set("SIP/201-0000155e", "TOUCH_MONITOR=1406727896.5470") in new stack
-- Executing [[email protected]:2] Set("SIP/201-0000155e", "AMPUSER=201") in new stack
-- Executing [[email protected]:3] GotoIf("SIP/201-0000155e", "0?report") in new stack
-- Executing [[email protected]:4] ExecIf("SIP/201-0000155e", "1?Set(REALCALLERIDNUM=201)") in new stack
-- Executing [[email protected]:5] Set("SIP/201-0000155e", "AMPUSER=201") in new stack
-- Executing [[email protected]:6] GotoIf("SIP/201-0000155e", "0?limit") in new stack
-- Executing [[email protected]:7] Set("SIP/201-0000155e", "AMPUSERCIDNAME=Tri") in new stack
-- Executing [[email protected]rid:8] GotoIf("SIP/201-0000155e", "0?report") in new stack
-- Executing [[email protected]:9] Set("SIP/201-0000155e", "AMPUSERCID=201") in new stack
-- Executing [[email protected]:10] Set("SIP/201-0000155e", "__DIAL_OPTIONS=Tt") in new stack
-- Executing [[email protected]:11] Set("SIP/201-0000155e", "CALLERID(all)="Tri" <201>") in new stack
-- Executing [[email protected]:12] GotoIf("SIP/201-0000155e", "0?limit") in new stack
-- Executing [[email protected]:13] ExecIf("SIP/201-0000155e", "1?Set(GROUP(concurrency_limit)=201)") in new stack
-- Executing [[email protected]:14] GosubIf("SIP/201-0000155e", "7?sub-ccss,s,1(from-internal,6359899141767)") in new stack
-- Executing [[email protected]:1] ExecIf("SIP/201-0000155e", "0?Return()") in new stack
-- Executing [[email protected]:2] Set("SIP/201-0000155e", "CCSS_SETUP=TRUE") in new stack
-- Executing [[email protected]:3] GosubIf("SIP/201-0000155e", "0?monitor_config,1(from-internal,6359899141767):monitor_default,1(from-internal,6359899141767)") in new stack
-- Executing [[email protected]:1] GotoIf("SIP/201-0000155e", "0?is_exten") in new stack
-- Executing [[email protected]:2] StackPop("SIP/201-0000155e", "") in new stack
-- Executing [[email protected]:3] Return("SIP/201-0000155e", "FALSE") in new stack
-- Executing [[email protected]:15] GotoIf("SIP/201-0000155e", "1?continue") in new stack
-- Goto (macro-user-callerid,s,28)
-- Executing [[email protected]:28] Set("SIP/201-0000155e", "CALLERID(number)=201") in new stack
-- Executing [[email protected]:29] Set("SIP/201-0000155e", "CALLERID(name)=Trifon") in new stack
-- Executing [[email protected]:30] Set("SIP/201-0000155e", "CDR(cnum)=201") in new stack
-- Executing [[email protected]:31] Set("SIP/201-0000155e", "CDR(cnam)=Trifon") in new stack
-- Executing [[email protected]:32] Set("SIP/201-0000155e", "CHANNEL(language)=en") in new stack

[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
[2014-07-30 16:44:57] WARNING[22943]: pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded
– Auto fallthrough, channel ‘SIP/201-0000155e’ status is ‘UNKNOWN’
– Executing [[email protected]:1] Hangup(“SIP/201-0000155e”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/201-0000155e’

When delete it and recreate the route with desired prefix it works well until some other prefix fails.
Thanks in advance for any ideas.

Regards,

I.

Do you have custom contexts installed?

Hi,
No, no custom contexts installed.

For some reason you have an extremely large amount of includes. Are you using any custom code through custom files?

Hi,
No no custom code or includes. However it is not standard freepbx iso installation.
I installed debian asterisk and freepbx manually and since day 1 I got these messages.

  1. You must go to the menu item “Settings” → “Disable -custom Context Includes” and set it to the “TRUE”. Apply Config.
  2. Try the system.

If you know what you are doing

You can recompile asterisk from the source.

1 Like

Hi Alexey,
Did you find solution of your issue ?
I tried

You must go to the menu item “Settings” -> “Disable -custom Context Includes” and set it to the “TRUE”. Apply Config

But still got messages :

pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded

My situation is near that you mentioned in your post - 95 trunks over 300 extensions and 95 outbound/inbound routes.
95 trunks are needed because we have 95 DID numbers and 95 outbound routes in order to able to dialout form each DID and 95 inbound routes in order these 95 DIDs to be reachable from outside.
In the end of dialplan show I got this:
-= 2175 extensions (9695 priorities) in 412 contexts. =-

Accordigt to the post ot tm1000

this is the limit of context of Asterisk?!
Probably will try recompile the latest asterisk form source, not using apt-get command.
Thanks to you and tm1000 for your advises.

Yes it is a limit of Asterisk itself and compiling from scratch won’t increase that limit you need to re-think your dialplan. You can do dialpattern matching in inbound routes so that you don’t have 95 inbound routes and your outbound routes can also be setup so that each extension can be assigned a DID (if that works for you)

Also 95 DIDs does NOT equal 95 trunks! I have 20 DIDs and only two trunks! That is what a trunk is, it is not mapped to a single DID.

You will not be able to get around this by recompiling, that is not a solution. Try to remove modules you aren’t using, like parking lots or anything else you can think of.

  1. Disable -custom Context Includes + You can try to disable some freepbx modules step-by-step (like DND), because they generate contexts.

  2. You can try to register all of your trunks by the cisco router (or another vendor).
    Something like this. I think community can help with some settings. Freepbx would be operate only one trunk to your router.

dial-peer voice 31 voip
destination-pattern 31T
voice-class codec 1
session target ipv4:10.45.255.241
dtmf-relay h245-alphanumeric
fax rate 14400
fax protocol t38 ls-redundancy 5 hs-redundancy 2 fallback pass-through g711alaw
ip qos dscp cs5 media
ip qos dscp cs5 signaling

voice service voip
ip address trusted list ! IOS >= 15.1
ipv4 0.0.0.0 0.0.0.0 ! IOS >= 15.1
no ip address trusted authenticate ! IOS >= 15.1

allow-connections h323 to h323
allow-connections h323 to sip
allow-connections sip to h323
allow-connections sip to sip
fax protocol t38 ls-redundancy 5 hs-redundancy 2 fallback none
h323
no call service stop
sip
no call service stop
!
voice class codec 1 !
codec preference 1 g729br8 !
codec preference 2 g729r8 !
codec preference 3 g723r63
codec preference 4 g723r53
codec preference 5 g728
codec preference 6 g711alaw
codec preference 7 g711ulaw
!
!
!
dial-peer voice XXXXXXX voip CHANGE IT
permission orig
huntstop
voice-class codec 1
incoming called-number ^XXXX…T ! CHANGE IT
!

Hello,
Thanks for your advises.
Unfortunately I can’t make less than 95 outbound and inbound routes. Every number is from different country and for different product that my company sale. So every number goes to specific ringgroup that has specific extensions/operators/ responsible for that product in the desired country.
I will try to disable some of the modules that we don’t use, try to convince the DID provider to authorize us via IP address and let you know of the result.

Disabling modules unused modules does the trick.
No such error pbx.c:2749 pbx_find_extension: Maximum PBX stack exceeded and non working route mentioned in the first post start working without recreating it.
Next step is to reduce the trunks.

Thanks alexeynikolaev and tm1000 :smile:

Hello Ivani,

A have the same problems you had. Can you tell me witch modules did you disable.
Thanks.
I’m using FreePBX 2.11