[asterisk-users] Re: 'h' extension and which one applies?

Tony Mountifield tony at softins.clara.co.uk
Tue Feb 6 03:37:24 MST 2007


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.

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