<div dir="ltr"><div dir="ltr">On Tue, Sep 13, 2022 at 11:49 AM Antony Stone <<a href="mailto:Antony.Stone@asterisk.open.source.it">Antony.Stone@asterisk.open.source.it</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi.<br>
<br>
I have a dialplan which accepts an inbound call and dials out to another <br>
number, automatically bridging the channels together when the second call is <br>
answered.<br>
<br>
I then have a facility for the caller to put the call on hold (which uses <br>
ChannelRedirect() in the dialplan to play music on hold to the callee, and <br>
some beeps to the caller), and resume it again (which uses Bridge() in the <br>
dialplan to re-join the two channels).<br>
<br>
This works fine.<br>
<br>
If the calleR hangs up (after resuming the call again, so the channels are <br>
bridged) the dialplan somewhat unexpectedly (to me) goes to the h@Hold <br>
extension (where Hold is the context I use to do the ChannelRedirect()s on the <br>
two legs of the call).<br>
<br>
I can cope with this; at least it tells me the call has been hung up and <br>
allows the dialplan to do some "end of call" processing.<br>
<br>
However, if the calleE hangs up instead, no hangup extension is called at all, <br>
so my dialplan cannot tell that the call has ended (which is important, <br>
because it has to send data to another application at both call start and call <br>
end).<br>
<br>
The only thing I do see is the h@Hold extension being activated, but at the <br>
time when the channels are bridged back together again to resume the call, and <br>
the channel name which is passed to h@Hold is a Surrogate/... channel.<br>
<br>
I guess it's correct that when hold music stops and the channels are re-<br>
bridged, the Surrogate channel has in fact hung up, but the timing of this is <br>
nothing to do with the actual end of the call.<br>
<br>
What do I need to do to get dialplan control passed to somewhere or other when <br>
the "real" callee channel hangs up?<br>
<br>
<br>
Incidentally, if the call comes in, gets answered, and then the callee hangs <br>
up, without the channels ever having been put on hold, the dialplan does go to <br>
the h@DialOn extension (where DialOn is the context in which the second call <br>
is dialled out to the callee).  This doesn't happen if the channels have been <br>
redirected and then bridged back together again, though.<br>
<br>
<br>
I know there is an F() parameter to the Dial() command which can pass the <br>
callee to a context/extension when the caller hangs up, but I don't see any <br>
equivalent for when the callee hangs up.<br>
<br>
<br>
Does anyone have some helpful ideas on how to detect callee hangup in this <br>
situation?<br></blockquote><div><br></div><div>Do hangup handlers[1] work for the situation? They follow channels as things move around, including masquerades and such.</div><div><br></div><div>[1] <a href="https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers">https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers</a></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><font color="#073763">Joshua C. Colp</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Asterisk Project Lead</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Sangoma Technologies</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Check us out at <a href="http://www.sangoma.com" target="_blank">www.sangoma.com</a> and <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a></font><br></div></div></div></div></div></div></div></div></div></div></div>