<div dir="ltr"><div dir="ltr"><div class="gmail-preformatted gmail-panel" style="border-width:1px"><div class="gmail-preformattedHeader gmail-panelHeader" style="border-bottom-width:1px">From the indicated wiki page:</div><div class="gmail-preformattedHeader gmail-panelHeader" style="border-bottom-width:1px"><br></div><div class="gmail-preformattedHeader gmail-panelHeader" style="border-bottom-width:1px"><b></b></div><div class="gmail-preformattedHeader gmail-panelHeader" style="border-bottom-width:1px"><b>Pop a hangup handler off a channel and optionally push a replacement</b></div><div class="gmail-preformattedContent gmail-panelContent">
<pre>same => n,Set(CHANNEL(hangup_handler_pop)=[[[context,]exten,]priority[(arg1[,...][,argN])]]);
</pre>
</div><div class="gmail-preformattedContent gmail-panelContent"><div class="gmail-preformatted gmail-panel" style="border-width:1px"><div class="gmail-preformattedHeader gmail-panelHeader" style="border-bottom-width:1px"><b>Pop all hangup handlers off a channel and optionally push a replacement</b></div><div class="gmail-preformattedContent gmail-panelContent">
<pre>same => n,Set(CHANNEL(hangup_handler_wipe)=[[[context,]exten,]priority[(arg1[,...][,argN])]]);
</pre>
</div></div></div></div></div><div><br></div><div>What the syntax above is indicating is that the value to assign is <b>optional</b>. Thus to only pop or wipe hangup handlers you <b>do not</b> provide a new handler to push.</div><div><div><br></div><div>[hdlr1]</div><div>exten = s,1,NoOp()</div><div>same = n,Return()</div></div><div><div><br></div><div>[hdlr2]</div><div>exten = s,1,NoOp()</div><div>same = n,Return()</div></div><div><div><br></div><div>[hdlr3]</div><div>exten = s,1,NoOp()</div><div>same = n,Return()</div></div><div><br></div><div>[my_new_handler_context]</div><div>exten = my_new_handler_exten,3,NoOp()</div><div>same = n,Return()<br></div><div><div><br></div></div><div>[my_current_context]</div><div>...<br></div><div>; This wipes all set hangup handlers because we are not providing an optional replacement handler to push onto the empty stack.<br></div><div><div>same = n,NoOp() ; <-- At this point we may or may not have hangup handlers set on the channel<br></div>same = n,Set(CHANNEL(hangup_handler_wipe)=)</div><div>same = n,NoOp() ; <-- At this point we have no hangup handlers on the channel<br></div><div><br></div><div>; This wipes all set hangup handlers and pushes a new one onto the empty stack.</div><div><div>same = n,NoOp() ; <-- At this point we may or may not have hangup handlers set on the channel<br></div>same = n,Set(CHANNEL(hangup_handler_wipe)=my_new_handler_context,my_new_handler_exten,3)</div><div>same = n,NoOp() ; <-- At this point we have only the one hangup handler we just pushed: my_new_handler_context,my_new_handler_exten,3</div><div><br></div><div>; Hangup handler test dialplan<br></div><div>exten = 101,1,NoOp()</div><div>same = n,Set(CHANNEL(hangup_handler_push)=hdlr1,s,1)</div><div><div><div>same = n,Set(CHANNEL(hangup_handler_push)=hdlr2,s,1)</div><div>same = n,Set(CHANNEL(hangup_handler_push)=hdlr3,s,1)</div>; What is the hangup handler stack when the channel is in the Echo application?<br></div>same = n,Echo()</div><div>same = n,Hangup()<br></div><div><div><br></div><div>exten = 102,1,NoOp()</div><div>same = n,Set(CHANNEL(hangup_handler_push)=hdlr1,s,1)</div><div>same = n,Set(CHANNEL(hangup_handler_push)=hdlr2,s,1)</div><div>same = n,Set(CHANNEL(hangup_handler_push)=hdlr3,s,1)</div><div>same = n,Set(CHANNEL(hangup_handler_pop)=my_new_handler_context,my_new_handler_exten,3)</div><div>; What is the hangup handler stack when the channel is in the Echo application?<br></div>same = n,Echo()<div>same = n,Hangup()<br></div></div><div><div><div><br></div><div>exten = 103,1,NoOp()</div><div>same = n,Set(CHANNEL(hangup_handler_push)=hdlr1,s,1)</div><div>same = n,Set(CHANNEL(hangup_handler_push)=hdlr2,s,1)</div><div>same = n,Set(CHANNEL(hangup_handler_push)=hdlr3,s,1)</div><div>same = n,Set(CHANNEL(hangup_handler_pop)=my_new_handler_context,my_new_handler_exten,3)</div>; What is the hangup handler stack when the channel is in the Echo application?<br>same = n,Echo()<div>same = n,Hangup()<br></div></div></div><div><br></div><div>You can enter the test dialplan portion above. Then call the test extensions to see what is on the channel's hangup handler stack while the channel is in the Echo application by using the command line commands mentioned on the wiki page.<br></div><div><br></div><div>Richard<br></div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 3, 2020 at 7:26 PM David P <<a href="mailto:davidswalkabout@gmail.com">davidswalkabout@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>Please point me to samples of popping and wiping hangup handlers. I don't need to use the values returned; I just need to clear any handlers before I push a new one.</div><div><br></div><div>It's not clear at <a href="https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers+Specification" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers+Specification</a> how to provide vars on the right-hand side.</div><div><br></div><div>Cheers,</div><div>David</div></div></div>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.org/</a><br>
<br>
New to Asterisk? Start here:<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></blockquote></div></div>