<br><br><div class="gmail_quote">2013/3/25 Olivier <span dir="ltr"><<a href="mailto:oza_4h07@yahoo.fr" target="_blank">oza_4h07@yahoo.fr</a>></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"><<a href="mailto:mjordan@digium.com" target="_blank">mjordan@digium.com</a>></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>
> Hello,<br>
><br>
> I'm giving hangup-handlers a try on a new Asterisk 11.2.1 setup.<br>
> My plan is to use this handler to update my CDRs with values such as<br>
> Asterish and Tech cause (see function HANGUP_CAUSE).<br>
> I want to have my custom hangup-handler be run only once and when "the<br>
> second channel" hangs up.<br>
><br>
> At the moment, I'm issuing a couple of "channel originate<br>
> Local/1@mycontext1 extension 123456789@mycontext2" commands.<br>
><br>
> I'm observing that as I'm using expressions such as Local/1@mycontext1,<br>
> a Local <ZOMBIE> channel is hanged before the second channel stops ringing.<br>
> When the second channel itself ends, my handler is not run anymore.<br>
><br>
><br>
> What would you suggest me to do ?<br>
> Should I delay my Set(CHANNEL(hangup_handler_wipe)= ...) statement till<br>
> both channels are bridged together ?<br>
><br>
<br>
</div></div>It is hard to say without seeing the dialplan that you'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're using?<br></blockquote></div><div><br>Yes, of course.<br>I'll simplify it and post it here ASAP.<br></div></div></blockquote><div><br>Here it is:<br><br>[hangup-handler]<br>exten => 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 => _X.,1,Verbose(0,Entering context ${CONTEXT} with EXTEN and CID set to ${EXTEN} and ${CALLERID(num)})<br> same => n, Set(CHANNEL(hangup_handler_push)=hangup-handler,s,1)<br> same => n, Dial(SIP/foobar/${EXTEN})<br>
same => n, Hangup()<br><br><br>[from-foobar]<br>exten => _X.,1,Verbose(0,Entering context ${CONTEXT} with EXTEN and CID set to ${EXTEN} and ${CALLERID(num)})<br> same => n, Dial(SIP/foobar/${EXTEN})<br> same => 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<ZOMBIE> 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> & <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>