[asterisk-users] Re: 'h' extension and which one applies?
Tony Mountifield
tony at softins.clara.co.uk
Tue Feb 6 09:43:18 MST 2007
In article <45C8AB64.5050800 at fnords.org>,
Eric \"ManxPower\" Wieling <eric at fnords.org> wrote:
> Tony Mountifield wrote:
> > In article <45C7FC57.7070302 at fnords.org>,
> > Eric \"ManxPower\" Wieling <eric at fnords.org> wrote:
> >> Steve Davies wrote:
> >>> I have a problem understanding which 'h' (hangup) extension is used in
> >>> which case - It seems to vary depending on channel type.
> >> It doesn't. It depends on which side of the call hangs up. "h" is
> >> executed when the callER hangs up.
> >>
> >> If you want to handle instances of the callEE hanging up, then look at
> >> the "g" option to Dial(). "show application dial"
> >
> > That's not my experience, and I've just tried it again to confirm.
> >
> > Say I have two SIP phones, extensions 2000 and 2002, which sip.conf
> > puts into context sipphone, and extensions.conf contains:
> >
> > [sipphone]
> > exten => 2000,1,Dial(SIP/2000)
> > exten => 2002,1,Dial(SIP/2002)
> > exten => h,1,NoOp(Hangup in context ${CONTEXT})
> >
> > I then pick up phone 2000, dial 2002 and pick up 2002 to answer.
> >
> > It then doesn't matter which phone I put down, the caller or the callee,
> > the 'h' extension gets executed on the calling channel (SIP/2000-xxxxxxxx)
> > in BOTH cases.
> >
> > I believe that for any channel that is executing in the dialplan, when it
> > is hung up, either directly or due to its peer hanging up, it will execute
> > the 'h' extension, if any, in whatever is its current context.
> >
> > Unfortunately, I don't have an answer for the original poster of this thread,
> > but I wanted to correct Eric's statement.
>
> If you don't use "g" option to Dial then of course it will disconnect
> the callER when the callEE hangs up.
But what I thought you were originally saying was that the 'h' extension
would NOT be executed if the callee hung up, and that it was necessary
instead to use the 'g' option to continue in the dial plan in order to do
whatever would otherwise have been done in the 'h' extension.
My experiment was to demonstrate that this is not the case, and that the 'h'
extension is available to the calling channel whichever end initiates the
hangup.
Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
More information about the asterisk-users
mailing list