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

Eric "ManxPower" Wieling eric at fnords.org
Tue Feb 6 09:23:00 MST 2007


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.


More information about the asterisk-users mailing list