On Tue, Oct 14, 2014 at 9:57 AM, Daniel Gonzalez <[email protected]> wrote:
> Hi all,
>
> According to the documentation
> (http://www.voip-info.org/wiki/view/Asterisk+h+extension):
>
> Be aware: Macros require their own h extension as they do not make use of
> the calling context's h extension!
>
> Does this apply to subroutines too? I am unable to find the corresponding
> explanation.

No. A channel that is hung up within a subroutine is treated exactly
the same as if it was hung up in any other extension, i.e., the
channel will execute the 'h' extension in the context that the
subroutine is in.

>
> If not: what happens when a call is hanged-up during the execution of a
> subroutine? Is the h extension in the parent triggered?
>
> And also: what happens if, in a stack of subroutines, each calling
> subroutine has an h extension, like this:
>
> sub1,h
>   sub2,h
>     sub3,h
>
> If we are in sub3 and the call is hanged up, will all h extensions for the
> calling stack be triggered?

No. There is no unraveling of the stack when a channel is hung up. A
hang up cancels the execution of standard dialplan and does two
things:
(1) Executes the 'h' extension in the current context, if available
(2) Executes any hang up handler subroutines that were attached to the channel

For more information on the latter, see the documentation on Hangup Handlers:

https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers

Matt

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to