Macro within Hangup Function

Hello,

Upon Answer I have:

same => n,Set(CHANNEL(hangup_handler_push)=disconnect,s,1(args))

Then upon Hangup I have:

[disconnect]
exten => s,1,NoOp()
same => n,MacroExclusive(reset-common,${port})
same => n,Return()

The ‘reset-common’ macro never gets called. I tried using just Macro as well. Anything else I put within that extension gets called fine. Is this just not allowed? Any alternatives? Im trying to stay away from having the same blocks of code everywhere.

P.S. I am using MacroExclusive because I understand that it prevents channels from tripping over themselves. Please correct me if I’m wrong.

Many Thanks!

Would be helpful, see your cli output ,when asterisk execute your dial plan. Related to

MacroExclusive() It executes a previously defined macro but allows only a single instance of the macro to execute at any given point in time. If the same macro is called at the same time from elsewhere in the dialplan, this second instance must wait until the first instance has completed.

[quote=“ambiorixg12”]Would be helpful, see your cli output ,when asterisk execute your dial plan. Related to

MacroExclusive() It executes a previously defined macro but allows only a single instance of the macro to execute at any given point in time. If the same macro is called at the same time from elsewhere in the dialplan, this second instance must wait until the first instance has completed.[/quote]

Right so basically its a locking mechanism. I would show you some CLI output but there is none when it hits that function. The skies are clear. Unless I need to set some debug mode.

I wouldn’t call setting one global variable an excessive delay

I don’t know exactly what your full dial plan is, but a Macro’s that you call with macroExclusive should run quickly or you will clog up your Asterisk system.

voip-info.org/wiki/view/Aste … oExclusive

Anyway I don’t use macro too often I rather prefer gosub()

I was looking at gosub but I’m not sure how to continue my app where it left off after the gosub.

Figured out the solution using Gosub.

Thanks!