Extension forwarded to an already forwarded extension

I have an extension (x220) forwarded to the receptionist (x200) that forward her calls to x201 on some occasions. The problem I have, when this happen, is calls to x220 get an error “Macro Limit Reached. Aborting Call” in the logs and the call hangup.

It seems related to the MACRO_DEPTH not being “smaller” than 6 in “macro-user-callerid”
/etc/asterisk/extensions_additional.conf:exten => s,n,GotoIf($[“${MACRO_DEPTH}” = “” | ${MACRO_DEPTH} < 6 ]?report2:macroerror)

When call comes in I see in the log

pbx.c: Executing [[email protected]:28] NoOp(“SIP/trunk-0000b181”, “Macro Depth is 2”) in new stack

Then after the first forward:

pbx.c: Executing [[email protected]:28] NoOp(“SIP/trunk-0000b181”, “Macro Depth is 4”) in new stack

After the second forward:

pbx.c: Executing [[email protected]:28] NoOp(“SIP/trunk-0000b181”, “Macro Depth is 6”) in new stack
pbx.c: Executing [[email protected]:29] GotoIf(“SIP/trunk-0000b181”, “0?report2:macroerror”) in new stack
pbx_builtins.c: Goto (macro-user-callerid,s,39)
pbx.c: Executing [[email protected]:39] NoOp(“SIP/trunk-0000b181”, “Macro Limit Reached. Aborting Call”) in new stack

As a temporary fix I changed the line checking MACRO_DEPTH in:

$ext->add($context, $exten, ‘’, new \ext_gotoif(‘$[“${MACRO_DEPTH}” = “” | ${MACRO_DEPTH} < 8 ]’, ‘report2’,‘macroerror’));

It works and, at least for now, I can make changes and reload.

Any idea how this can be prevented?


You are better off right now. The Macro application is deprecated. FreePBX should have moved from it years ago. In Asterisk v21 it gets removed. It wont be used in future versions of FreePBX like v17.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.