<br><br><div class="gmail_quote">On 15 September 2010 16:10, Nigel Kent <span dir="ltr">&lt;<a href="mailto:ktngl@yahoo.co.uk">ktngl@yahoo.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">I think I am undertaning better now what you said.<div><br></div><div>For a call( connected between both ends) that gets disconnected there will be seperate hang up events genereated, one from each leg and each leg has its own<span style="font-family: arial,helvetica,clean,sans-serif; border-collapse: collapse; line-height: 15px;"> UUID </span></div>
</td></tr></tbody></table></blockquote><div><br>Yes, that&#39;s correct. Each leg is a separate channel which are really separate calls from the caller to freeswitch, and from freeswitch to the caller. Each has it&#39;s own UUID and events. You join the two together by bridging them, at which point their signalling and media are joined together.<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;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">
<div><br></div><div>In that case I understand the incoming is assigned a <span style="font-family: arial,helvetica,clean,sans-serif; border-collapse: collapse; line-height: 15px;">UUID as soon as it comes in.</span></div>
</td></tr></tbody></table></blockquote><div><br>Yes. The UUID is assigned as soon as the channel is created.<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;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top"><div><br></div><div>In regards to my original needs in identifity the
 legs, I am thinking I could set a channel variable to indicate the leg. This could be done as soon as the call is anwsered for the a leg.</div></td></tr></tbody></table></blockquote><div><br>This already exists. There is a direction variable which will be set to inbound on the A-leg and outbound on the B-leg. AFAIK it exists as soon as the channel is created.<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">
<div><br></div><div>So now I am trying to work out how to access the b leg variables?</div></td></tr></tbody></table></blockquote><div><br>The variables will be in the CHANNEL_HANGUP_COMPLETE event for the B-Leg. If you want variable_sip_hangup_disposition you only need it for one of the legs:<br>
<br>A-Leg:<br>
cancel : caller hung up before the call was answered<br>recv_bye : was answered, caller (aleg) hung up<br>send_bye : was answered, callee (bleg) hung up<br><br>B-Leg (bye direction swapped compared to aleg)<br>
cancel : caller hung up before the call was answered<br>recv_bye : was answered, callee (aleg) hung up<br>send_bye : was answered, caller (bleg) hung up<br><br>-Steve <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;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top"><div><div class="im"> <br><br>--- On <b>Wed, 15/9/10, Steven Ayre <i>&lt;<a href="mailto:steveayre@gmail.com" target="_blank">steveayre@gmail.com</a>&gt;</i></b> wrote:<br>
</div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div class="im"><br>From: Steven Ayre &lt;<a href="mailto:steveayre@gmail.com" target="_blank">steveayre@gmail.com</a>&gt;<br>
Subject: Re: [Freeswitch-users] Getting call leg details<br>To: &quot;FreeSWITCH Users Help&quot; &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>
</div>Date: Wednesday, 15 September, 2010, 12:24<div><div></div><div class="h5"><br><br><div><br><br><div>On 15 September 2010 10:05, Nigel Kent <span dir="ltr">&lt;<a rel="nofollow" href="http://mc/compose?to=ktngl@yahoo.co.uk" target="_blank">ktngl@yahoo.co.uk</a>&gt;</span>
 wrote:<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top"><div><br></div><div>Thanks for the  info, I have a few further questions</div><div><br></div><div>Is it on the execution of the bridge that generates the CHANNEL_HANGUP_COMPLETE for the first leg.</div>

</td></tr></tbody></table></blockquote><div><br>No, it&#39;s after the channel hangs up (CHANNEL_HANGUP being sent when it starts to hang up).<br>If the caller on the A-leg initiates the hangup, then the B-Leg will hangup when the A-Leg hangs up.<br>

If the callee on the B-leg initiates the hangup, then the A-Leg will either hangup (if hangup_on_bridge=true) or return to the dialplan and hangup when it has no more applications to run.<br><br>If you want to know when the bridge starts/finishes look for CHANNEL_BRIDGE and CHANNEL_UNBRIDGE.<br>

<br></div><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">

<div><br></div><div>If so how does it carry the call on to the second leg because I thought that CHANNEL_HANGUP_COMPLETE is sent after a call disconnected.</div></td></tr></tbody></table></blockquote><div><br>It is sent then. Not sure I understand what you mean by &#39;carry the call on&#39;?<br>

<br>-Steve<br><br><br> </div><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">

<div><br></div><div><br></div><div><br></div>--- On <b>Sun, 12/9/10, Steven Ayre <i>&lt;<a rel="nofollow" href="http://mc/compose?to=steveayre@gmail.com" target="_blank">steveayre@gmail.com</a>&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">

<br>From: Steven Ayre &lt;<a rel="nofollow" href="http://mc/compose?to=steveayre@gmail.com" target="_blank">steveayre@gmail.com</a>&gt;<br>Subject: Re: [Freeswitch-users] Getting call leg details<br>To: &quot;FreeSWITCH Users Help&quot; &lt;<a rel="nofollow" href="http://mc/compose?to=freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>

Date: Sunday, 12 September, 2010, 21:43<div><div></div><div><br><br><div>Both the A-Leg
 and B-Leg will generate a CHANNEL_HANGUP_COMPLETE event. Each will have a different UUID so you&#39;ll only get both events if you&#39;re watching both/all UUIDs.<br><br><div>On 12 September 2010 20:53, Nigel Kent <span dir="ltr">&lt;<a rel="nofollow" href="http://mc/compose?to=ktngl@yahoo.co.uk" target="_blank">ktngl@yahoo.co.uk</a>&gt;</span> wrote:<br>


<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">
I have a event socket listener that catches CHANNEL_HANGUP_COMPLETE events and I want to verify the call leg details<br><br>1. Did the call end in aleg or bleg<br></td></tr></tbody></table></blockquote><div><br>Check variable_sip_hangup_disposition. Values will be recv_bye, send_bye or cancel. Not sure how to do it if you have something other than sofia on either leg.<br>


How to interpret the value probably depends on whether it&#39;s on the A or B leg.<br> <br></div><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top"><br>2. What was the call durations in each of the legs<br></td></tr></tbody></table></blockquote><div><br>Check variable_duration<br>


<br><a rel="nofollow" href="http://wiki.freeswitch.org/wiki/Event_list#CHANNEL_HANGUP_COMPLETE" target="_blank">http://wiki.freeswitch.org/wiki/Event_list#CHANNEL_HANGUP_COMPLETE</a> contains an example of the event which will be generated, and includes many of the channel variables, including several useful timestamp and durations. For example there are timestamps for the call starting, ringing (progress), answered, and hangup, and a billsec variable as well as the duration (which should be the same in almost all cases).<br>


 </div><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">
<br>I am not sure if I am applying the terminology of call legs in the proper way but<br>what I mean by aleg is that the incoming call was  not bridged and bleg after being bridged<br></td></tr></tbody></table><br></blockquote>


<div><br>That&#39;s the correct terminology. :)<br><br>-Steve<br> </div><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



      <br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a rel="nofollow" href="http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a rel="nofollow" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div><br></div></div>-----Inline Attachment Follows-----<div><br><br><div>_______________________________________________<br>FreeSWITCH-users mailing list<br><a rel="nofollow" href="http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>

<a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>

<a rel="nofollow" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></div></div></blockquote></td></tr></tbody></table><br>



      <br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a rel="nofollow" href="http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a rel="nofollow" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div><br>-----Inline Attachment Follows-----<br><br><div>_______________________________________________<br>FreeSWITCH-users mailing list<br><a href="http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></div></div></div></blockquote></div></td></tr></tbody></table><br>



      <br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>