No application 'MacroExit'

Hello,
I 'm restoring a version of FreePBX 14 to a new FreePBX 17 installation. I’m testing outbound calls to another internal FreePBX over an IAX2 trunk. I’m getting a call failed and busy dial tone when outbound calling from the new restored PBX to another PBX version 16 via extension. This is the message I get when I try to make the call.

WARNING[13036][C-0000000f]: pbx.c:2942 pbx_extension_helper: No application ‘MacroExit’ for extension (macro-dialout-trunk-predial-hook, s, 11)
== Spawn extension (macro-dialout-trunk-predial-hook, s, 11) exited non-zero on ‘PJSIP/6626-00000010’

app_macro doesn’t exist in Asterisk v21 which is what FreePBX v17 defaults to. Why you still have it in the dialplan is beyond me. It should be generating proper dialplan with no calls to Macro() or MacroExit()

Although the hooks still have “macro” in their name, that hook is called as GoSub(macro-dialout-trunk-predial-hook, s, 1) and needs a Return call, to end it.

1 Like

I think that’s one that is manually done by the user, not generated.

Yes. The change to gosub is done by FreePBX, but the actual code that is called, including the final exit, have to be provided by the user.

Is there something I can do to fix this?

Fix the hook you setup to be a Gosub rather than Macro.

I’m not familiar with how to do this. Is there instructions somewhere on how to do that?

It depends on what the hook does. For the specific error message, use Return, rather than MacroExit, but your code may be doing other things that only work in a macro.

I tried downgrading the Asterisk version on FreePBX 17 to version 18. I’m now seeing this error when trying to do an outbound call on an extension to a FreePBX 16 with Asterisk version 16.

[2025-04-28 16:08:53] WARNING[23433][C-00000006]: pbx.c:4573 __ast_pbx_run: Timeout, but no rule ‘t’ or ‘e’ in context ‘macro-dialout-trunk-predial-hook’

Are there configurations that need to be done to get calling working between these two versions? Any help would be greatly appreciated. Thank you

I can’t think of any reason why changing Asterisk version would fix you macro problem, given that macro was deprecated some time ago, so I can’t think of a good reason for FreePBX 17 to generate macro calls for an supported version of Asterisk. I think you need to provide full logs, with verbosity at least five, to understand what is happening here.

I also can’t think of a valid reason why predial hook would be written in a way that t or e was possible, but that is user provided code, so we don’t know what it does unless you provide its source code to us.

Here is a call to an extension on another Freepbx version 16 that fails.

Connected to Asterisk 18.26.1 currently running on SR-S-PBX2 (pid = 3480)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [59202@from-internal:1] Gosub(“SIP/6626-00000009”, “macro-user-callerid,s,1(LIMIT)”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/6626-00000009”, “TOUCH_MONITOR=1745928265.10”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/6626-00000009”, “CHANCONTEXT=”) in new stack
– Executing [s@macro-user-callerid:3] Set(“SIP/6626-00000009”, “CHANCONTEXT=”) in new stack
– Executing [s@macro-user-callerid:4] Set(“SIP/6626-00000009”, “CHANEXTENCONTEXT=6626-00000009”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/6626-00000009”, “CHANEXTEN=6626-00000009”) in new stack
– Executing [s@macro-user-callerid:6] Set(“SIP/6626-00000009”, “CALLERID(number)=6626”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/6626-00000009”, “AMPUSER=6626”) in new stack
– Executing [s@macro-user-callerid:8] Set(“SIP/6626-00000009”, “HOTDESCKCHAN=6626-00000009”) in new stack
– Executing [s@macro-user-callerid:9] Set(“SIP/6626-00000009”, “HOTDESKEXTEN=6626”) in new stack
– Executing [s@macro-user-callerid:10] Set(“SIP/6626-00000009”, “HOTDESKCALL=0”) in new stack
– Executing [s@macro-user-callerid:11] ExecIf(“SIP/6626-00000009”, “0?Set(HOTDESKCALL=1)”) in new stack
– Executing [s@macro-user-callerid:12] ExecIf(“SIP/6626-00000009”, “0?Set(CALLERID(name)=)”) in new stack
– Executing [s@macro-user-callerid:13] GotoIf(“SIP/6626-00000009”, “0?report”) in new stack
– Executing [s@macro-user-callerid:14] ExecIf(“SIP/6626-00000009”, “1?Set(REALCALLERIDNUM=6626)”) in new stack
– Executing [s@macro-user-callerid:15] Set(“SIP/6626-00000009”, “AMPUSER=6626”) in new stack
– Executing [s@macro-user-callerid:16] GotoIf(“SIP/6626-00000009”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:17] Set(“SIP/6626-00000009”, “AMPUSERCIDNAME=Aaron - softphone”) in new stack
– Executing [s@macro-user-callerid:18] ExecIf(“SIP/6626-00000009”, “0?Set(__CIDMASQUERADING=TRUE)”) in new stack
– Executing [s@macro-user-callerid:19] GotoIf(“SIP/6626-00000009”, “0?report”) in new stack
– Executing [s@macro-user-callerid:20] Set(“SIP/6626-00000009”, “AMPUSERCID=6626”) in new stack
– Executing [s@macro-user-callerid:21] Set(“SIP/6626-00000009”, “__DIAL_OPTIONS=tTrWw”) in new stack
– Executing [s@macro-user-callerid:22] Set(“SIP/6626-00000009”, “CALLERID(all)=“Aaron - softphone” <6626>”) in new stack
– Executing [s@macro-user-callerid:23] ExecIf(“SIP/6626-00000009”, “0?Set(CUSDIAL=)”) in new stack
– Executing [s@macro-user-callerid:24] ExecIf(“SIP/6626-00000009”, “0?Set(CALLERID(all)=“Aaron - softphone” <6626>)”) in new stack
– Executing [s@macro-user-callerid:25] GotoIf(“SIP/6626-00000009”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:26] ExecIf(“SIP/6626-00000009”, “1?Set(GROUP(concurrency_limit)=6626)”) in new stack
– Executing [s@macro-user-callerid:27] NoOp(“SIP/6626-00000009”, “Macro depricated!! To keep the same line numbers”) in new stack
– Executing [s@macro-user-callerid:28] NoOp(“SIP/6626-00000009”, “Macro depricated !! To keep the same line numbers”) in new stack
– Executing [s@macro-user-callerid:29] GotoIf(“SIP/6626-00000009”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,47)
– Executing [s@macro-user-callerid:47] Set(“SIP/6626-00000009”, “CALLERID(number)=6626”) in new stack
– Executing [s@macro-user-callerid:48] Set(“SIP/6626-00000009”, “CALLERID(name)=Aaron - softphone”) in new stack
– Executing [s@macro-user-callerid:49] GotoIf(“SIP/6626-00000009”, “0?cnum”) in new stack
– Executing [s@macro-user-callerid:50] Set(“SIP/6626-00000009”, “__MCNUM=6626”) in new stack
– Executing [s@macro-user-callerid:51] Set(“SIP/6626-00000009”, “__MCNAME=Aaron - softphone”) in new stack
– Executing [s@macro-user-callerid:52] Set(“SIP/6626-00000009”, “__MCEXTEN=6626”) in new stack
– Executing [s@macro-user-callerid:53] Set(“SIP/6626-00000009”, “__MCORGCHAN=SIP/6626-00000009”) in new stack
– Executing [s@macro-user-callerid:54] Set(“SIP/6626-00000009”, “CDR(cnam)=Aaron - softphone”) in new stack
– Executing [s@macro-user-callerid:55] Set(“SIP/6626-00000009”, “CDR(cnum)=6626”) in new stack
– Executing [s@macro-user-callerid:56] Return(“SIP/6626-00000009”, “”) in new stack
– Executing [59202@from-internal:2] Set(“SIP/6626-00000009”, “ROUTEUSER=6626”) in new stack
– Executing [59202@from-internal:3] Set(“SIP/6626-00000009”, “ROUTEUSER=6626”) in new stack
– Executing [59202@from-internal:4] GotoIf(“SIP/6626-00000009”, “1?notblind”) in new stack
– Goto (from-internal,59202,7)
– Executing [59202@from-internal:7] GotoIf(“SIP/6626-00000009”, “1?restrictedroute-05c5486220d0c45ce44ec5b5af25f033,59202,2:outbound-allroutes,59202,2”) in new stack
– Goto (restrictedroute-05c5486220d0c45ce44ec5b5af25f033,59202,2)
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:2] Gosub(“SIP/6626-00000009”, “sub-record-check,s,1(out,59202,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“SIP/6626-00000009”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“SIP/6626-00000009”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“SIP/6626-00000009”, “NOW=1745928265”) in new stack
– Executing [s@sub-record-check:4] Set(“SIP/6626-00000009”, “__DAY=29”) in new stack
– Executing [s@sub-record-check:5] Set(“SIP/6626-00000009”, “__MONTH=04”) in new stack
– Executing [s@sub-record-check:6] Set(“SIP/6626-00000009”, “__YEAR=2025”) in new stack
– Executing [s@sub-record-check:7] Set(“SIP/6626-00000009”, “__TIMESTR=20250429-080425”) in new stack
– Executing [s@sub-record-check:8] Set(“SIP/6626-00000009”, “__FROMEXTEN=6626”) in new stack
– Executing [s@sub-record-check:9] Set(“SIP/6626-00000009”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“SIP/6626-00000009”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“SIP/6626-00000009”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“SIP/6626-00000009”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“SIP/6626-00000009”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“SIP/6626-00000009”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“SIP/6626-00000009”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“SIP/6626-00000009”, “Outbound Recording Check from 6626 to 59202”) in new stack
– Executing [out@sub-record-check:2] Set(“SIP/6626-00000009”, “RECMODE=dontcare”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“SIP/6626-00000009”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“SIP/6626-00000009”, “recordcheck,1(dontcare,out,59202)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“SIP/6626-00000009”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“SIP/6626-00000009”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“SIP/6626-00000009”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“SIP/6626-00000009”, “”) in new stack
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:3] Set(“SIP/6626-00000009”, “_ROUTEID=11”) in new stack
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:4] Set(“SIP/6626-00000009”, “_ROUTENAME=SR2WS”) in new stack
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:5] Set(“SIP/6626-00000009”, “INTRACOMPANYROUTE=YES”) in new stack
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:6] Set(“SIP/6626-00000009”, “MOHCLASS=default”) in new stack
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:7] Set(“SIP/6626-00000009”, “_CALLERIDNAMEINTERNAL=Aaron - softphone”) in new stack
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:8] Set(“SIP/6626-00000009”, “_CALLERIDNUMINTERNAL=6626”) in new stack
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:9] Set(“SIP/6626-00000009”, “_EMAILNOTIFICATION=FALSE”) in new stack
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:10] Set(“SIP/6626-00000009”, “_NODEST=”) in new stack
– Executing [59202@restrictedroute-05c5486220d0c45ce44ec5b5af25f033:11] Gosub(“SIP/6626-00000009”, “macro-dialout-trunk,s,1(10,59202,on)”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/6626-00000009”, “DIAL_TRUNK=10”) in new stack
– Executing [s@macro-dialout-trunk:2] ExecIf(“SIP/6626-00000009”, “0?Set(DIAL_OPTIONS=trWw)”) in new stack
– Executing [s@macro-dialout-trunk:3] ExecIf(“SIP/6626-00000009”, “0?Set(DIAL_OPTIONS=TrWw)”) in new stack
– Executing [s@macro-dialout-trunk:4] ExecIf(“SIP/6626-00000009”, “0?Set(DIAL_OPTIONS=trWw)”) in new stack
– Executing [s@macro-dialout-trunk:5] GosubIf(“SIP/6626-00000009”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:6] ExecIf(“SIP/6626-00000009”, “0?Set(CALLERID(num)=6626)”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/6626-00000009”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:8] Set(“SIP/6626-00000009”, “DIAL_NUMBER=59202”) in new stack
– Executing [s@macro-dialout-trunk:9] Set(“SIP/6626-00000009”, “DIAL_TRUNK_OPTIONS=tTrWw”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/6626-00000009”, “OUTBOUND_GROUP=OUT_10”) in new stack
– Executing [s@macro-dialout-trunk:11] Set(“SIP/6626-00000009”, “DIAL_TRUNK_OPTIONS=tTWw”) in new stack
– Executing [s@macro-dialout-trunk:12] ExecIf(“SIP/6626-00000009”, “0?Set(DIAL_TRUNK_OPTIONS=tWw)”) in new stack
– Executing [s@macro-dialout-trunk:13] GotoIf(“SIP/6626-00000009”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,15)
– Executing [s@macro-dialout-trunk:15] GotoIf(“SIP/6626-00000009”, “1?skipoutcid”) in new stack
– Goto (macro-dialout-trunk,s,17)
– Executing [s@macro-dialout-trunk:17] GosubIf(“SIP/6626-00000009”, “0?sub-flp-10,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:18] Set(“SIP/6626-00000009”, “OUTNUM=959202”) in new stack
– Executing [s@macro-dialout-trunk:19] Set(“SIP/6626-00000009”, “custom=IAX2/SR2WS”) in new stack
– Executing [s@macro-dialout-trunk:20] ExecIf(“SIP/6626-00000009”, “0?Set(DIAL_TRUNK_MOH=default)”) in new stack
– Executing [s@macro-dialout-trunk:21] ExecIf(“SIP/6626-00000009”, “0?Set(DIAL_TRUNK_OPTIONS=tTWwU(macro-confirm))”) in new stack
– Executing [s@macro-dialout-trunk:22] Gosub(“SIP/6626-00000009”, “macro-dialout-trunk-predial-hook,s,1()”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] NoOp(“SIP/6626-00000009”, “Test Track Outbound”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:2] NoOp(“SIP/6626-00000009”, “Trunk is IAX2/SR2WS”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:3] NoOp(“SIP/6626-00000009”, “Dialout number is 959202”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:4] NoOp(“SIP/6626-00000009”, “Dial options are tTWw”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:5] Set(“SIP/6626-00000009”, “QDIALER_AGENT=Aaron - softphone”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:6] GotoIf(“SIP/6626-00000009”, “1?nextcheck”) in new stack
– Goto (macro-dialout-trunk-predial-hook,s,9)
– Executing [s@macro-dialout-trunk-predial-hook:9] GotoIf(“SIP/6626-00000009”, “0?bypass”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:10] NoOp(“SIP/6626-00000009”, “NO ACCOUNTCODE, exit normally with no tracking outbound”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:11] MacroExit(“SIP/6626-00000009”, “”) in new stack
[2025-04-29 08:04:30] WARNING[93893][C-0000000a]: pbx.c:4573 __ast_pbx_run: Timeout, but no rule ‘t’ or ‘e’ in context ‘macro-dialout-trunk-predial-hook’

Whilst I don’t understand exactly why it produces that message, it will be because you are using MacroExit in something that is not a macro.

As I said, version 17 has no need to use macro, to work with any supported version of Asterisk, so doesn’t use macro.

Post 3 contains the solution.

I appreciate you helping me out. I just don’t know where to go to fix this error. Is there a configuration file I need to edit to change Macro to GoSub?

macro-dialout-trunk-predial-hook << That is an empty context that just issues a Return() or in older versions MacroExit(). In order for you to use it, you need to add it to an config file. That is most likely going to be extensions_custom.conf. I would look in that file for the context override.

The code that is failing is not part of FreePBX; it is part of a customisation, that your organisation has made to FreePBX. Only you have access to exactly what it does and why it does it. The custom configuration file is a likely location, but the person who made the customisation should have documented it, for you.

Because is it a local change we can only tell you what to do in general terms, at least not without seeing the source code for it, and, in the most general cases, we would need the design specification.

It looks like it relates to account codes. Are you using any third party call accounting software?

On our PBX it did have Asternic setup.

If you’re not longer using it, sounds like the code is still in one of the extensions conf files. Since that hook exists in the dialplan, it will be run and it’s using Macro() causing your issues on Asterisk v21 or higher.

You need to remove the Asternic override conf file or any dialplan added to extensions_custom.conf, etc.

Thank you so much! I found this in the extensions_custom.conf
#include extensions_custom_asternic_outbound_freepbx_failover.conf
I removed it and rebooted and now it is working. Thank you for everyone’s help figuring this out.

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