I created another test, hangup at level 2 or level 5 triggers the same infinite loop ------------------------------------------------------------------------------------------------ context macrotest { s => { Answer(); ¯o_level1(); } h => { Noop(Catch h in context that invokes the macro); } } /* success */ macro macro_level1() { Noop(Running macro level 1); Noop(Hangup in macro_level1 should run h in context that invokes the macro); Wait(10); ¯o_level2(); } /* FAIL */ macro macro_level2() { Noop(Running macro level 2); Noop(Hangup in macro_level2 should run h in context that invokes the macro); Wait(10); ¯o_level3(); } /* success */ macro macro_level3() { Noop(Running macro level 3); Noop(Hangup in macro_level3 should run catch h in macro_level3); Wait(10); ¯o_level4(); catch h { Noop(catch h in macro level 3); } } /* success */ macro macro_level4() { Noop(Running macro level 4); Noop(Hangup in macro_level4 should run catch h in macro_level3); Wait(10); ¯o_level5(); } /* FAIL */ macro macro_level5() { Noop(Running macro level 5); Noop(Hangup in macro_level5 should run catch h in macro_level3); Wait(20); } ------------------------------------------------------------------------------------------------ -- Executing [s@macrotest:1] Answer("SIP/trunk-00000000", "") in new stack -- Executing [s@macrotest:2] Gosub("SIP/trunk-00000000", "macro_level1,~~s~~,1") in new stack -- Executing [~~s~~@macro_level1:1] NoOp("SIP/trunk-00000000", "Running macro level 1") in new stack -- Executing [~~s~~@macro_level1:2] NoOp("SIP/trunk-00000000", "Hangup in macro_level1 should run h in context that invokes the macro") in new stack -- Executing [~~s~~@macro_level1:3] Wait("SIP/trunk-00000000", "10") in new stack -- Executing [~~s~~@macro_level1:4] Gosub("SIP/trunk-00000000", "macro_level2,~~s~~,1") in new stack -- Executing [~~s~~@macro_level2:1] NoOp("SIP/trunk-00000000", "Running macro level 2") in new stack -- Executing [~~s~~@macro_level2:2] NoOp("SIP/trunk-00000000", "Hangup in macro_level2 should run h in context that invokes the macro") in new stack -- Executing [~~s~~@macro_level2:3] Wait("SIP/trunk-00000000", "10") in new stack -- Executing [~~s~~@macro_level2:4] Gosub("SIP/trunk-00000000", "macro_level3,~~s~~,1") in new stack -- Executing [~~s~~@macro_level3:1] NoOp("SIP/trunk-00000000", "Running macro level 3") in new stack -- Executing [~~s~~@macro_level3:2] NoOp("SIP/trunk-00000000", "Hangup in macro_level3 should run catch h in macro_level3") in new stack -- Executing [~~s~~@macro_level3:3] Wait("SIP/trunk-00000000", "10") in new stack -- Executing [~~s~~@macro_level3:4] Gosub("SIP/trunk-00000000", "macro_level4,~~s~~,1") in new stack -- Executing [~~s~~@macro_level4:1] NoOp("SIP/trunk-00000000", "Running macro level 4") in new stack -- Executing [~~s~~@macro_level4:2] NoOp("SIP/trunk-00000000", "Hangup in macro_level4 should run catch h in macro_level3") in new stack -- Executing [~~s~~@macro_level4:3] Wait("SIP/trunk-00000000", "10") in new stack -- Executing [~~s~~@macro_level4:4] Gosub("SIP/trunk-00000000", "macro_level5,~~s~~,1") in new stack -- Executing [~~s~~@macro_level5:1] NoOp("SIP/trunk-00000000", "Running macro level 5") in new stack -- Executing [~~s~~@macro_level5:2] NoOp("SIP/trunk-00000000", "Hangup in macro_level5 should run catch h in macro_level3") in new stack -- Executing [~~s~~@macro_level5:3] Wait("SIP/trunk-00000000", "20") in new stack == Spawn extension (macro_level5, ~~s~~, 3) exited non-zero on 'SIP/trunk-00000000' -- Executing [h@macro_level5:1] GotoIf("SIP/trunk-00000000", "1?macro_level4,h,1") in new stack -- Goto (macro_level4,h,1) -- Executing [h@macro_level4:1] GotoIf("SIP/trunk-00000000", "1?macro_level4,h,1") in new stack -- Goto (macro_level4,h,1) -- Executing [h@macro_level4:1] GotoIf("SIP/trunk-00000000", "1?macro_level4,h,1") in new stack -- Goto (macro_level4,h,1) -- Executing [h@macro_level4:1] GotoIf("SIP/trunk-00000000", "1?macro_level4,h,1") in new stack -- Goto (macro_level4,h,1) -- Executing [h@macro_level4:1] GotoIf("SIP/trunk-00000000", "1?macro_level4,h,1") in new stack -- Goto (macro_level4,h,1) -- Executing [h@macro_level4:1] GotoIf("SIP/trunk-00000000", "1?macro_level4,h,1") in new stack -- Goto (macro_level4,h,1) -- Executing [h@macro_level4:1] GotoIf("SIP/trunk-00000000", "1?macro_level4,h,1") in new stack . . .