Asterisk
  1. Asterisk
  2. ASTERISK-13256

[patch] Macro execution doesn't get to "h" extension

    Details

    • Type: Bug Bug
    • Status: Closed
    • Severity: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Applications/app_macro
    • Labels:
      None
    • Mantis ID:
      14122
    • Regression:
      Yes

      Description

      In asterisk-1.4.23-rc3 (and in SVN 1.4 branch) execution of macro context interrupted by hangup never gets to "h" context defined by "catch h =>". Instead of this, execution returns to "h" extension of calling context. In asterisk-1.4.23-rc2 and earlier, execution was finishing in macro "catch h =>" branch.

                • ADDITIONAL INFORMATION ******

      Dialplan:
      context outgoing
      {
      123 =>

      { &test(); }

      h =>

      { NoOp(HANGUP); }

      }

      macro test()
      {
      SayDigits($

      {MACRO_EXTEN}

      );

      catch h

      { NoOp(CATCH HANGUP); }

      }

      When I hang up during playback of digits:

      In asterisk-1.4.23-rc2:
      – Executing [123@outgoing:1] Macro("SIP/111-09335600", "test") in new stack
      – Executing [s@macro-test:1] SayDigits("SIP/111-09335600", "123") in new stack
      – <SIP/111-09335600> Playing 'digits/1' (language 'en')
      – <SIP/111-09335600> Playing 'digits/2' (language 'en')
      == Spawn extension (macro-test, s, 1) exited non-zero on 'SIP/111-09335600' in macro 'test'
      == Spawn extension (macro-test, s, 1) exited non-zero on 'SIP/111-09335600'
      – Executing [h@macro-test:1] NoOp("SIP/111-09335600", "CATCH HANGUP") in new stack

      asterisk-1.4.23-rc3:
      – Executing [123@outgoing:1] Macro("SIP/111-09e78680", "test") in new stack
      – Executing [s@macro-test:1] SayDigits("SIP/111-09e78680", "123") in new stack
      – <SIP/111-09e78680> Playing 'digits/1' (language 'en')
      – <SIP/111-09e78680> Playing 'digits/2' (language 'en')
      == Spawn extension (macro-test, s, 1) exited non-zero on 'SIP/111-09e78680' in macro 'test'
      == Spawn extension (outgoing, 123, 1) exited non-zero on 'SIP/111-09e78680'
      – Executing [h@outgoing:1] NoOp("SIP/111-09e78680", "HANGUP") in new stack

        Activity

        Hide
        Andrew Lindh added a comment -

        It worked before (1.4.17). The Macro does not exit, ARG is used in the 'h' extension in the macro.

        Show
        Andrew Lindh added a comment - It worked before (1.4.17). The Macro does not exit, ARG is used in the 'h' extension in the macro.
        Hide
        Tilghman Lesher added a comment -

        Actually, the macro DID exit in prior versions. The bug was that it left those variables on the stack, which it should not have.

        Show
        Tilghman Lesher added a comment - Actually, the macro DID exit in prior versions. The bug was that it left those variables on the stack, which it should not have.
        Hide
        Andrew Lindh added a comment -

        I see the macro exit now, I did not notice it... I guess ARG working was a "feature".

        Workaround: I just set another variable to the value of the ARG I needed to use later in 'h'.

        Testing in branch 1.4 is ok for me (in extensions.conf).

        Show
        Andrew Lindh added a comment - I see the macro exit now, I did not notice it... I guess ARG working was a "feature". Workaround: I just set another variable to the value of the ARG I needed to use later in 'h'. Testing in branch 1.4 is ok for me (in extensions.conf).
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 174885

        U branches/1.4/apps/app_macro.c
        U branches/1.4/main/pbx.c

        ------------------------------------------------------------------------
        r174885 | tilghman | 2009-02-11 14:54:19 -0600 (Wed, 11 Feb 2009) | 13 lines

        Restore a behavior that was recently changed, when we fixed issue ASTERISK-13115 and
        issue ASTERISK-12632 (related to issue ASTERISK-6019). When a hangup occurs during a Macro
        execution in earlier 1.4, the h extension would execute within the Macro
        context, whereas it was always supposed to execute only within the main context
        (where Macro was called). So this fix checks for an "h" extension in the
        deepest macro context where a hangup occurred; if it exists, that "h" extension
        executes, otherwise the main context "h" is executed.
        (closes issue ASTERISK-13256)
        Reported by: wetwired
        Patches:
        20090210__bug14122.diff.txt uploaded by Corydon76 (license 14)
        Tested by: andrew

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=174885

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 174885 U branches/1.4/apps/app_macro.c U branches/1.4/main/pbx.c ------------------------------------------------------------------------ r174885 | tilghman | 2009-02-11 14:54:19 -0600 (Wed, 11 Feb 2009) | 13 lines Restore a behavior that was recently changed, when we fixed issue ASTERISK-13115 and issue ASTERISK-12632 (related to issue ASTERISK-6019 ). When a hangup occurs during a Macro execution in earlier 1.4, the h extension would execute within the Macro context, whereas it was always supposed to execute only within the main context (where Macro was called). So this fix checks for an "h" extension in the deepest macro context where a hangup occurred; if it exists, that "h" extension executes, otherwise the main context "h" is executed. (closes issue ASTERISK-13256 ) Reported by: wetwired Patches: 20090210__bug14122.diff.txt uploaded by Corydon76 (license 14) Tested by: andrew ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=174885
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 174886

        _U trunk/

        ------------------------------------------------------------------------
        r174886 | tilghman | 2009-02-11 14:55:47 -0600 (Wed, 11 Feb 2009) | 19 lines

        Blocked revisions 174885 via svnmerge

        ........
        r174885 | tilghman | 2009-02-11 14:54:18 -0600 (Wed, 11 Feb 2009) | 13 lines

        Restore a behavior that was recently changed, when we fixed issue ASTERISK-13115 and
        issue ASTERISK-12632 (related to issue ASTERISK-6019). When a hangup occurs during a Macro
        execution in earlier 1.4, the h extension would execute within the Macro
        context, whereas it was always supposed to execute only within the main context
        (where Macro was called). So this fix checks for an "h" extension in the
        deepest macro context where a hangup occurred; if it exists, that "h" extension
        executes, otherwise the main context "h" is executed.
        (closes issue ASTERISK-13256)
        Reported by: wetwired
        Patches:
        20090210__bug14122.diff.txt uploaded by Corydon76 (license 14)
        Tested by: andrew
        ........

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=174886

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 174886 _U trunk/ ------------------------------------------------------------------------ r174886 | tilghman | 2009-02-11 14:55:47 -0600 (Wed, 11 Feb 2009) | 19 lines Blocked revisions 174885 via svnmerge ........ r174885 | tilghman | 2009-02-11 14:54:18 -0600 (Wed, 11 Feb 2009) | 13 lines Restore a behavior that was recently changed, when we fixed issue ASTERISK-13115 and issue ASTERISK-12632 (related to issue ASTERISK-6019 ). When a hangup occurs during a Macro execution in earlier 1.4, the h extension would execute within the Macro context, whereas it was always supposed to execute only within the main context (where Macro was called). So this fix checks for an "h" extension in the deepest macro context where a hangup occurred; if it exists, that "h" extension executes, otherwise the main context "h" is executed. (closes issue ASTERISK-13256 ) Reported by: wetwired Patches: 20090210__bug14122.diff.txt uploaded by Corydon76 (license 14) Tested by: andrew ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=174886

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development