<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><span style="font-family: verdana,helvetica,sans-serif;">Hi, </span><br style="font-family: verdana,helvetica,sans-serif;"><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">I
am receiving the inbound call and i am bridging that call with some
other number. But i need to know whether the bridged call (dial out
call) has been ringing or answering. </span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;"><br>I am using the ESL connection method to communicate with the Freeswitch. Here is the snapshot of my code.<br><br><span style="font-weight: bold;">Receiving inbound call </span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @sd = s<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @con = ESL::ESLconnection.new(s.to_i)<br>&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; @con.execute("linger")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @con.setEventLock("true")<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @con.sendRecv("myevents")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @con.execute("answer")<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ....<br><br>After that i am playing and receiving input from the caller then i am bridging the call with some other number. <br><br><span style="font-weight: bold;">Bridge Call:</span><br>&nbsp;@con.execute("bridge", "sofia/gateway/junctionnetworks//#{@destination_number}")&nbsp;&nbsp;&nbsp; <br><br>and waiting for the bridge event <br><br><span style="font-weight: bold;">WaitForBridgeEvent:</span><br>def 
waitForBridge</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while @con.connected</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e = 
@con.recvEvent()</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; next if e == nil</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
printEventData(e)</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; handleHangup if 
hangupOccurred(e)</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if e.getHeader("Event-Name") 
== "CHANNEL_BRIDGE" &amp;&amp;</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
e.getHeader("Channel-State") == "CS_EXECUTE" </span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
answer_state = e.getHeader("Answer-State")</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if answer_state == 
"answered"</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
call_answer_time = e.getHeader("answered_time")</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
end_point_disp = e.getHeader("endpoint_disposition")</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
var_end_point_disp = e.getHeader("var_endpoint_dispoisition")</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
return call_answer_time, end_point_disp, var_end_point_disp</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end</span><span style="font-family: verdana,helvetica,sans-serif;"><br>end</span><br style="font-family: verdana,helvetica,sans-serif;"><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">In this code the answer_state
 is always returning the answered. Also there is always no value for call_answer_time,
 end_point_disp, var_end_point_disp. Bridging is happening and i have no problem with bridging the call.<br><br>Please
let me know whether the answer-state is returned in this case is for
the inbound call or outbound call. (because i am wondering how it is
always answered?). Also please help me to get the bridged call status
(whether answered, ringing or others)<br><br><br></span><font style="font-family: verdana,helvetica,sans-serif;" size="1" color="#0000ff" face="verdana"><div class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: blue;">Thanks and Regards, <br><span style="border-bottom: 2px dotted rgb(54, 99, 136); cursor: pointer;" class="yshortcuts" id="lw_1275590026_0">Thirupathi</span></span><span style="font-size: 10pt; color: blue; font-family: Verdana;"></span></div></font></td></tr></table><br>