<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi!<br>
      <br>
      But if I change the code to scenario 1, no h-exten is run, is this
      the intended behaviour?<br>
      <br>
      <br>
      context conference {<br>
          incoming => {<br>
            &testmacro();<br>
          }<br>
      <br>
          h => {<br>
            Noop(Called from the context that invokes the macro - THIS
      DOESN'T WORK);<br>
          }<br>
        }<br>
      <br>
        macro testmacro() {<br>
          Noop(Running testmacro!);<br>
          Wait(20);<br>
        }<br>
      <br>
      <br>
    </tt><tt>Connected to Asterisk 1.8.9.2 currently running on dev01
      (pid = 3762)<br>
          -- Executing [incoming@conference:1]
      Gosub("SIP/trunk-00000000", "testmacro,~~s~~,1") in new stack<br>
          -- Executing [~~s~~@testmacro:1] NoOp("SIP/trunk-00000000",
      "ning testmacro!") in new stack<br>
          -- Executing [~~s~~@testmacro:2] Wait("SIP/trunk-00000000",
      "20") in new stack<br>
        == Spawn extension (testmacro, ~~s~~, 2) exited non-zero on
      'SIP/trunk-00000000'<br>
      <br>
      <br>
      <br>
      I like your hangup-handlers-patch, it seems like a nice solution.<br>
      Right now I can't use macros in ael where it's important to run
      the code in the hangup exten, so I use gosub insted and use h
      => { goto main_context,h,1 }.<br>
      However, this is quite hackish and the ael parser try to advice me
      otherwise on every reload ("gosub affects call flow...").<br>
      <br>
      <br>
    </tt><tt>/Johan<br>
    </tt>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <br>
    2012-02-22 23:35, Mark Murawski skrev:
    <blockquote cite="mid:4F456DB3.3020403@intellasoft.net" type="cite">I
      agree.  This is not a bug.
      <br>
      <br>
      >>      -- Executing [h@testmacro:1]
      NoOp("SIP/trunk-00000002", "h catched in testmacro - OK!") in new
      stack
      <br>
      <br>
      Looks like the h exten executed exactly where it should have.
      <br>
      <br>
      Only the inner-most h will execute on hangup.
      <br>
      <br>
      You can check out my hangup handlers patch at
      <a class="moz-txt-link-freetext" href="https://reviewboard.asterisk.org/r/1230/">https://reviewboard.asterisk.org/r/1230/</a>
      <br>
      <br>
      I'm getting back in the swing of things in my development, so this
      and other projects will be committed within the next month.
      <br>
      <br>
      <br>
      On 02/22/12 15:38, Johan Wilfer wrote:
      <br>
      <blockquote type="cite">I've noticed that the h exten isn't
        executed if using AEL and a call is
        <br>
        currently in a macro. (ASTERISK-19336)
        <br>
        <br>
        Maybe I was unclear in the bugreport, but I described two
        scenarios.
        <br>
        1) ael context with h-exten (not executed on hangup) calling
        macro
        <br>
        2) ael context with h-exten (not executed on hangup) calling
        macro with
        <br>
        catch h { ... } (executed on hangup)
        <br>
        <br>
        The issue was closed, refering to scenario 2.
        <br>
        <br>
        Can this issue be reopened? Because in scenario 1 not a single
        h-exten
        <br>
        is executed..
        <br>
        <br>
        Thanks!
        <br>
        <br>
        /Johan
        <br>
        <br>
        <br>
        -------- Ursprungligt meddelande --------
        <br>
        Ämne:     [JIRA] Closed: (ASTERISK-19336) h exten is not run in
        the context
        <br>
        that calls a AEL macro
        <br>
        Datum:     Fri, 10 Feb 2012 08:36:19 -0600 (CST)
        <br>
        Från:     Matt Jordan (JIRA) <a class="moz-txt-link-rfc2396E" href="mailto:noreply@issues.asterisk.org"><noreply@issues.asterisk.org></a>
        <br>
        Till:     <a class="moz-txt-link-abbreviated" href="mailto:johan@wilfer.se">johan@wilfer.se</a>
        <br>
        <br>
        <br>
        <br>
             
        [<a class="moz-txt-link-freetext" href="https://issues.asterisk.org/jira/browse/ASTERISK-19336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel">https://issues.asterisk.org/jira/browse/ASTERISK-19336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel</a> 
        ]
        <br>
        <br>
        Matt Jordan closed ASTERISK-19336.
        <br>
        ----------------------------------
        <br>
        <br>
             Resolution: Not A Bug
        <br>
        <br>
        Only one hangup handler will ever be called.  The hangup handler
        that is called will be the one closest in scope to the current
        location of the executing call.
        <br>
        <br>
        Note that there is a proposed feature that would allow for a
        stack of hangup handlers to be called; however, that would be a
        new feature and not a bug.
        <br>
        <br>
        <blockquote type="cite"> h exten is not run in the context that
          calls a AEL macro
          <br>
           --------------------------------------------------------
          <br>
          <br>
                           Key: ASTERISK-19336
          <br>
                          
          URL:<a class="moz-txt-link-freetext" href="https://issues.asterisk.org/jira/browse/ASTERISK-19336">https://issues.asterisk.org/jira/browse/ASTERISK-19336</a>
          <br>
                       Project: Asterisk
          <br>
                    Issue Type: Bug
          <br>
                Security Level: None
          <br>
                    Components: PBX/pbx_ael
          <br>
              Affects Versions: 1.8.9.2
          <br>
                      Reporter: Johan Wilfer
          <br>
          <br>
           I expect the h exten to be run both in the macro catch-block
          and in the context calling the macro. This is not the case.
          <br>
           The following code:
          <br>
           {code:xml}
          <br>
             context conference {
          <br>
               incoming =>  {
          <br>
                 &testmacro();
          <br>
               }
          <br>
               h =>  {
          <br>
                 Noop(Called from the context that invokes the macro -
          THIS DOESN'T WORK);
          <br>
               }
          <br>
             }
          <br>
             macro testmacro() {
          <br>
               Noop(Running testmacro!);
          <br>
               Wait(20);
          <br>
               catch h {
          <br>
                 Noop(h catched in testmacro - OK!);
          <br>
               }
          <br>
             }
          <br>
           {code}
          <br>
           Creates this output:
          <br>
           {code:xml}
          <br>
               -- Executing [incoming@conference:1]
          Gosub("SIP/trunk-00000002", "testmacro,~~s~~,1") in new stack
          <br>
               -- Executing [~~s~~@testmacro:1]
          NoOp("SIP/trunk-00000002", "Running testmacro!") in new stack
          <br>
               -- Executing [~~s~~@testmacro:2]
          Wait("SIP/trunk-00000002", "20") in new stack
          <br>
             == Spawn extension (testmacro, ~~s~~, 2) exited non-zero on
          'SIP/trunk-00000002'
          <br>
               -- Executing [h@testmacro:1] NoOp("SIP/trunk-00000002",
          "h catched in testmacro - OK!") in new stack
          <br>
           {code}
          <br>
           The h-exten in the calling context is never called..
          <br>
           The issue is the same with 1.6.2.20, and it's also the same
          if you remove the "catch h { ... } "-block in the macro - the
          context that calls the macro never executes it's h-exten.
          <br>
        </blockquote>
        <br>
        --
        <br>
        This message is automatically generated by JIRA.
        <br>
        For more information on JIRA,
        see:<a class="moz-txt-link-freetext" href="http://www.atlassian.com/software/jira">http://www.atlassian.com/software/jira</a>
        <br>
        <br>
        <br>
        <br>
        This body part will be downloaded on demand.
        <br>
      </blockquote>
      <br>
      <br>
      <br>
      --
      <br>
_____________________________________________________________________
      <br>
      -- Bandwidth and Colocation Provided by <a class="moz-txt-link-freetext" href="http://www.api-digital.com">http://www.api-digital.com</a>
      --
      <br>
      <br>
      asterisk-dev mailing list
      <br>
      To UNSUBSCRIBE or update options visit:
      <br>
        <a class="moz-txt-link-freetext" href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a>
      <br>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Med vänlig hälsning
Johan Wilfer                 email: <a class="moz-txt-link-abbreviated" href="mailto:johan@jttech.se">johan@jttech.se</a>
JT Tech | Utvecklare         webb: <a class="moz-txt-link-freetext" href="http://jttech.se">http://jttech.se</a>
direkt: +46 31 380 91 01  support: +46 31 380 91 00</pre>
  </body>
</html>