Calls Disconnecting After Selection Is Made In IVR (Just Backed Up & Restored to FreePBX 17)

Pretty much the title. Just Migrated this server to freepbx 17 from 16. Now using asterisk 22.
Here is a call example: FreePBX Inbound After Migration - Pastebin.com

This doesn’t look good:

33432 [2025-02-28 21:02:19] WARNING[20884][C-00000020] pbx.c: No application 'MacroExit' for extension (macro-dial-ringall-predial-hook, s, 3)

Macro() & MacroExit() applications were deprecated removed (EDIT: see below) in Asterisk 21. You’ll need to update your custom dialplan to use Gosub() & Return(). Please refer to some of the FreePBX 17 release notes.

You are not alone with this challenge, and it is a bit confusing because the FreePBX dialplan contexts are still named macro-* but that is different than the dialplan applications.

You might consider posting the relevant portions of your extensions_custom.conf file for further assistance.

1 Like

I very much appreciate your response. This is what the extensions_custom.conf file has:

;Adding the missed calls hangup handler using Macro() which current versions of FreePBX support.
[macro-dialout-one-predial-hook]
exten => s,1,Noop(Entering user defined context in extensions_custom.conf to add missed calls hangup handler)
exten => s,n,Set(CHANNEL(hangup_handler_push)=missed-calls-email,s,1)
exten => s,n,MacroExit()

;Adding the missed calls hangup handler using GoSub() which will hopefully be supported soon.
[sub-dialout-one-predial-hook]
exten => s,1,Noop(Entering user defined context in extensions_custom.conf to add missed calls hangup handler)
exten => s,n,Set(CHANNEL(hangup_handler_push)=missed-calls-email,s,1)
exten => s,n,Return()

;Removing the hangup handler for Ring Group calls using Macro() which current versions of FreePBX support.
;[macro-dial-ringall-predial-hook]
;exten => s,1,Noop(Entering user defined context in extensions_custom.conf to remove the hangup handler)
;exten => s,n,Set(CHANNEL(hangup_handler_pop)=)
;exten => s,n,MacroExit()

;Removing the hangup handler for Ring Group calls using GoSub() which will hopefully be supported soon.
;[sub-dial-ringall-predial-hook]
;exten => s,1,Noop(Entering user defined context in extensions_custom.conf to remove the hangup handler)
;exten => s,n,Set(CHANNEL(hangup_handler_pop)=)
;exten => s,n,Return()

;Adding the missed calls hangup handler using Macro() which current versions of FreePBX support.\n
[macro-dial-ringall-predial-hook]\n
exten => s,1,Noop(Entering user defined context in extensions_custom.conf to add missed calls hangup handler)
exten => s,n,Set(CHANNEL(hangup_handler_push)=missed-calls-email,s,1)
exten => s,n,MacroExit()

[missed-calls-email]
exten => s,1,Noop(Entering user defined context in extensions_custom.conf to process an email alert for missed calls)
exten => s,n,Noop(DEBUG: Called user: ${EXTTOCALL}, Channel is: ${CHANNEL}, Dial Status is: ${DIALSTATUS}, Voicemail status is: ${VMSTATUS}, Device Tech: ${DB(DEVICE/${EXTTOCALL}/tech)})
;Check if the call was answered or the caller left a voicemail if either is true then exit.
exten => s,n,ExecIf($[$["${DIALSTATUS}" = "ANSWER"] | $["${VMSTATUS}" = "SUCCESS"]]?Return())
;OPTIONAL: if you want to control this from the GUI for selective extensions...
;Add, under each extension's accountcode, the value of 'MissedCallsAlert' without the quotes. 
;Uncomment the next ExecIf to enable it.
;You may also use it the opposite way with != to rather exclude certian extensions.
;exten => s,n,ExecIf($["${CALLEE_ACCOUNCODE}" = "MissedCallsAlert"]?Noop(Validated the AccountCode, continuing...):Return())
;Check if the extension is offline and if true include that in the email.
exten => s,n,ExecIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?Set(offlinePhone=Additional Info: Your phone is OFFLINE, you may want to contact support))
;Check if the callee is an actual extension, if not, exit.
exten => s,n,ExecIf($[$["${DB(DEVICE/${EXTTOCALL}/tech)}" != "pjsip"] & $["${DB(DEVICE/${EXTTOCALL}/tech)}" != "sip"]]?Return())
;Determine if this is a queue call and add the queue information.
;If you don't want emails sent for queue calls, uncomment the next line.
;exten => s,n,ExecIf($["${REGEX("queue" ${CHANNEL})}" = "1"]?Return())
exten => s,n,ExecIf($["${REGEX("queue" ${CHANNEL})}" = "1"]?Set(QueueInfo=Additional Info: Call from Queue ${NODEST}))
;Set the from email and name.
exten => s,n,Set([email protected])
exten => s,n,Set(from_name=Missed Calls Notifications)
;Get the callee's email address, if it cannot find it, set a default email.
exten => s,n,Set(email=${IF($["empty${VM_INFO(${EXTTOCALL},email)}" = "empty"][email protected]:${VM_INFO(${EXTTOCALL},email)})})
;Send the email.
exten => s,n,System(echo "Hello ${DB(AMPUSER/${EXTTOCALL}/cidname)}, \n\nYou have missed a call. \nRecived on Date: ${STRFTIME(${EPOCH},,%A %b %d %Y \nTime: %H:%M:%S)} \nCaller ID Number: ${CALLERID(num)} \nCaller ID Name: ${CALLERID(name)} \n\n${QueueInfo} \n${offlinePhone} \n\nThis is an automated email, contact support for assistance" | mail -s "Phone System Missed Call - ${STRFTIME(${EPOCH},,%A %b %d %H:%M:%S)}" -r "${from_name}<${from_email}>" ${email})
exten => s,n,Return()

Based on what I see, and what you told me, I should replace the MacroExit() with Return(). Is it more complicated than that? Is it that simple? I am doubting myself lol

You’ve found your answer.
Thank you for sharing your time.
Please leave likes and such.

1 Like

Yay!! It worked!! Thank you so much, I very much appreciate it!! You are a godsend!

1 Like

:pray: happy to help

2 Likes

They were removed completely in version 21. They were actually deprecated in 1.6, but the deprecation notice was re-issued when deprecation processes were better formalised.

I know that it was deprecated by 1.6.2 as I asked a question in relation to that, about how preserve the ${EXTEN} value for CDRs when implementing the deprecation changes.

There are no supported versions of Asterisk in which they are present but not formally deprecated.

1 Like

My mistake, thank you. Post edited. :beers:

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