<div>Actually you have no other way except parsing channel events not only from parent channel but from child channels too since there can be many child channels in bridge attempt.</div>
<div>Actually, FS doesn&#39;t have a direct method like Asterisk DIALSTATUS. If you answer incoming call and then doing bridge to some endpoint, you will see ANSWER in disposition variables even in channel events.</div>
<div>I can be wrong, but I haven&#39;t found any other way as to parse hangup / hangup_complete / answer events of parent and child channels to correctly determine disposition, cause codes and so on in all cases.<br><br>
</div>
<div class="gmail_quote">2011/7/25 Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>&gt;</span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">What you are trying to do is not possible in this fashion. The bridge occurs in the same thread as the perl script. The thread can only do one thing at a time.  
<div><br></div>
<div>If you need to know the dial status while the thread is still running you&#39;ll want a separate event socket app running and listening for channel status events. If you just need to know the dial status once the bridge is complete (i.e. once the call ends) then just use a api_hangup_hook chan var to launch a script to do whatever it is that you need done.</div>

<div><br></div>
<div><font color="#888888">-MC</font> 
<div>
<div></div>
<div class="h5"><br><br>
<div class="gmail_quote">On Sun, Jul 24, 2011 at 11:45 AM, Sam <span dir="ltr">&lt;<a href="mailto:lakersman2006@yahoo.com" target="_blank">lakersman2006@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">For the life of me I am still unable to get the bridged call status, when I subscribe to an &quot;event&quot; I am not here is my perl code snippet below, what am I doing wrong?<br><br><br>my $fs = new ESL::ESLconnection($host, $port, $password);<br>
<br>$session-&gt;answer();<br><br>if ($session-&gt;ready ()) <br>{<br>    #set bridge settings<br>    $session-&gt;execute(&quot;set&quot;, &quot;ringback=$ringback_tone&quot;);   <br>    $session-&gt;execute(&quot;set&quot;, &quot;instant_ringback=true&quot;);        <br>
    $session-&gt;execute(&quot;set&quot;, &quot;ignore_early_media=false&quot;); <br>    $session-&gt;execute(&quot;set&quot;, &quot;call_timeout=60&quot;);                            <br>    $session-&gt;execute(&quot;set&quot;, &quot;progress_timeout=15&quot;);<br>
    $session-&gt;execute(&quot;set&quot;, &quot;origination_caller_id_number=$caller_id&quot;);<br>    $session-&gt;execute(&quot;set&quot;, &quot;continue_on_fail=false&quot;);<br>    $session-&gt;execute(&quot;bridge&quot;, &quot;sofia/gateway/provider1/$destination_number&quot;);<br>
     <br>    $fs-&gt;sendRecv(&quot;event plain ALL&quot;);<br>    $fs-&gt;send(&quot;linger&quot;);<br>    <br>    while($fs-&gt;connected())<br>    {<br>        $data = $fs-&gt;recvEvent();<br>        <br>        if ( $data =~ m/Answered-State: (\w+)/m ) <br>
        {<br>           my $state = $1;<br>        <br>           #print &quot;Channel state is $state\n&quot;;<br>        <br>           if ( $state eq &#39;answered&#39; ) {<br>        <br>             freeswitch::consoleLog(&quot;INFO&quot;, &quot;CALL ANSWERED\n&quot;);<br>
        <br>           }<br>           else<br>           {<br>                freeswitch::consoleLog(&quot;INFO&quot;, &quot;NO CALLS ANSWERED\n&quot;);<br>           }<br>         }    <br>    }<br>}<br>   <br>$session-&gt;hangup();<br>
 <br>return 1; 
<div><br><br>--- On <b>Fri, 7/22/11, Hector Geraldino <i>&lt;<a href="mailto:Hector.Geraldino@ip-soft.net" target="_blank">Hector.Geraldino@ip-soft.net</a>&gt;</i></b> wrote:<br></div>
<blockquote style="BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px">
<div><br>From: Hector Geraldino &lt;<a href="mailto:Hector.Geraldino@ip-soft.net" target="_blank">Hector.Geraldino@ip-soft.net</a>&gt;<br>Subject: Re: [Freeswitch-users] Asterisk dial status<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: Friday, July 22, 2011, 2:28 PM 
<div>
<div></div>
<div><br><br>
<div>
<div>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt">It does.</span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt">You can check the events by connecting to FS on inbound mode, or using FS outbound socket connection to an application designed by you. </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt">As you already have a perl script to interact with FS, you can modify it to connect to FS (inbound mode) and listen for events. You can subscribe to the events of a particular call, or filter an specific set of events. I haven’t used Asterisk before so I’m not sure how the AGI fits on the FS architecture.</span></p>

<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt">You can get more info at:</span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"><a href="http://wiki.freeswitch.org/wiki/Mod_event_socket" rel="nofollow" target="_blank">http://wiki.freeswitch.org/wiki/Mod_event_socket</a></span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt">And a working demo at:</span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"><a href="http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example" rel="nofollow" target="_blank">http://wiki.freeswitch.org/wiki/Perl_freeswitch_client_example</a></span></p>

<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<p><b><span style="FONT-SIZE: 10pt">From:</span></b><span style="FONT-SIZE: 10pt"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>On Behalf Of </b>Sam<br>
<b>Sent:</b> Friday, July 22, 2011 4:23 PM<br><b>To:</b> FreeSWITCH Users Help<br><b>Subject:</b> Re: [Freeswitch-users] Asterisk dial status</span></p></div>
<p> </p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; PADDING-TOP: 0in" valign="top">
<p>Sam,<br><br>Does this require event sockets? Or how would I check these events?<br><br>--- On <b>Fri, 7/22/11, Hector Geraldino <i>&lt;<a href="mailto:Hector.Geraldino@ip-soft.net" target="_blank">Hector.Geraldino@ip-soft.net</a>&gt;</i></b> wrote:</p>

<p style="MARGIN-BOTTOM: 12pt"><br>From: Hector Geraldino &lt;<a href="mailto:Hector.Geraldino@ip-soft.net" target="_blank">Hector.Geraldino@ip-soft.net</a>&gt;<br>Subject: Re: [Freeswitch-users] Asterisk dial status<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>Date: Friday, July 22, 2011, 11:57 AM</p>
<div>
<div>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt">Hi Sam,</span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt">My guess is that you can subscribe to the events of the channel and evaluate the channel events. Look at:</span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"><a href="http://wiki.freeswitch.org/wiki/Event_List" rel="nofollow" target="_blank">http://wiki.freeswitch.org/wiki/Event_List</a></span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt">specifically the channel events list.</span></p>
<p><span style="COLOR: #1f497d; FONT-SIZE: 11pt"> </span></p>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<p><b><span style="FONT-SIZE: 10pt">From:</span></b><span style="FONT-SIZE: 10pt"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>On Behalf Of </b>Sam<br>
<b>Sent:</b> Friday, July 22, 2011 2:32 PM<br><b>To:</b> <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br><b>Subject:</b> [Freeswitch-users] Asterisk dial status</span></p>
</div>
<p> </p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; PADDING-TOP: 0in" valign="top">
<p>Hi,<br><br>I am trying to port over an Asterisk AGI script that does a call bridge to Freeswitch using perl, I wanted to know what is the equivalent of the asterisk dial status like: ANSWER, NO_ANSWER, CANCEL, BUSY, CONGESTION, CHANUNAVAIL ? I wanted to know if what methods can be used to gets these statues?</p>
</td></tr></tbody></table>
<p><span style="FONT-SIZE: 10pt"> </span></p></div></div>
<p style="MARGIN-BOTTOM: 12pt"><br>-----Inline Attachment Follows-----</p>
<div>
<p>_______________________________________________<br>Join us at ClueCon 2011, Aug 9-11, Chicago<br><a href="http://www.cluecon.com/" rel="nofollow" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br><br>FreeSWITCH-users mailing list<br>
<a rel="nofollow">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org/" rel="nofollow" target="_blank">http://www.freeswitch.org</a></p>
</div></td></tr></tbody></table>
<p><span style="FONT-SIZE: 10pt"> </span></p></div></div><br>-----Inline Attachment Follows-----<br><br>
<div>_______________________________________________<br>Join us at ClueCon 2011, Aug 9-11, Chicago<br><a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br><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></td></tr></tbody></table><br>_______________________________________________<br>Join us at ClueCon 2011, Aug 9-11, Chicago<br><a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>FreeSWITCH-users mailing list<br><a href="mailto: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>
<br></blockquote></div><br></div></div></div><br>_______________________________________________<br>Join us at ClueCon 2011, Aug 9-11, Chicago<br><a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<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><br clear="all"><br>-- <br>Best regards,<br><br>Dmitry Sytchev,<br>IT Engineer<br>