<br><br><div class="gmail_quote">2013/3/25 Olivier <span dir="ltr">&lt;<a href="mailto:oza_4h07@yahoo.fr" target="_blank">oza_4h07@yahoo.fr</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote"><div class="im">2013/3/25 Matthew Jordan <span dir="ltr">&lt;<a href="mailto:mjordan@digium.com" target="_blank">mjordan@digium.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>On 03/25/2013 05:17 PM, Olivier wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I&#39;m giving  hangup-handlers a try on a new Asterisk 11.2.1 setup.<br>
&gt; My plan is to use this handler to update my CDRs with values such as<br>
&gt; Asterish and Tech cause (see function HANGUP_CAUSE).<br>
&gt; I want to have my custom hangup-handler be run only once and when &quot;the<br>
&gt; second channel&quot; hangs up.<br>
&gt;<br>
&gt; At the moment, I&#39;m issuing a couple of  &quot;channel originate<br>
&gt; Local/1@mycontext1 extension 123456789@mycontext2&quot; commands.<br>
&gt;<br>
&gt; I&#39;m observing that as I&#39;m using expressions such as Local/1@mycontext1,<br>
&gt; a Local &lt;ZOMBIE&gt; channel is hanged before the second channel stops ringing.<br>
&gt; When the second channel itself ends, my  handler is not run anymore.<br>
&gt;<br>
&gt;<br>
&gt; What would you suggest me to do ?<br>
&gt; Should I delay my Set(CHANNEL(hangup_handler_wipe)= ...) statement till<br>
&gt; both channels are bridged together ?<br>
&gt;<br>
<br>
</div></div>It is hard to say without seeing the dialplan that you&#39;re using. Most<br>
likely, the hangup handler has been attached to one half of the Local<br>
channel as opposed to the channel you want it attached to. Can you<br>
include the full dialplan that you&#39;re using?<br></blockquote></div><div><br>Yes, of course.<br>I&#39;ll simplify it and post it here ASAP.<br></div></div></blockquote><div><br>Here it is:<br><br>[hangup-handler]<br>exten =&gt; s,1,Verbose(0,Entering context ${CONTEXT} in channel ${CHANNEL} with EXTEN and CID set to ${EXTEN} and ${CALLERID(num)})<br>
<br><br>[to-foobar]<br>exten =&gt; _X.,1,Verbose(0,Entering context ${CONTEXT} with EXTEN and CID set to ${EXTEN} and ${CALLERID(num)})<br>  same =&gt; n, Set(CHANNEL(hangup_handler_push)=hangup-handler,s,1)<br>  same =&gt; n, Dial(SIP/foobar/${EXTEN})<br>
  same =&gt; n, Hangup()<br><br><br>[from-foobar]<br>exten =&gt; _X.,1,Verbose(0,Entering context ${CONTEXT} with EXTEN and CID set to ${EXTEN} and ${CALLERID(num)})<br>  same =&gt; n, Dial(SIP/foobar/${EXTEN})<br>  same =&gt; n, Hangup() <br>
<br><br>The command I used is :<br>channel originate Local/7005@from-foobar extension 7003@to-foobar<br><br>Console prints:<br>Entering context from-foobar with EXTEN and CID set to 7005 and <br>Entering context to-foobar with EXTEN and CID set to 7003 and <br>
Entering context hangup-handler in channel Local/7005@from-foobar-00000008;1&lt;ZOMBIE&gt; with EXTEN and CID set to s and <br><br>The first line is printed at soon as Enter key is pressed.<br>The second and third lines are printed when originating channel answers (here extension SIP/foobar/7005)<br>
<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div> </div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<br>
Matt<br>
<br>
--<br>
Matthew Jordan<br>
Digium, Inc. | Engineering Manager<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>
Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> &amp; <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br>
<br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</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" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</blockquote></div></div><br>
</blockquote></div><br>