<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> @sd = s<br> @con = ESL::ESLconnection.new(s.to_i)<br>
@con.execute("linger")<br> @con.setEventLock("true")<br><br><br> @con.sendRecv("myevents")<br> @con.execute("answer")<br><br> ... <br><br> ....<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> @con.execute("bridge", "sofia/gateway/junctionnetworks//#{@destination_number}") <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;"> while @con.connected</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;"> e =
@con.recvEvent()</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;"> next if e == nil</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">
printEventData(e)</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;"> handleHangup if
hangupOccurred(e)</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;"> if e.getHeader("Event-Name")
== "CHANNEL_BRIDGE" &&</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">
e.getHeader("Channel-State") == "CS_EXECUTE" </span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">
answer_state = e.getHeader("Answer-State")</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;"> if answer_state ==
"answered"</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">
call_answer_time = e.getHeader("answered_time")</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">
end_point_disp = e.getHeader("endpoint_disposition")</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">
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;">
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;"> end</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;"> end</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;"> 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;" color="#0000ff" face="verdana" size="1"><div class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: blue;">Thanks and Regards, <br>Thirupathi</span><span style="font-size: 10pt;"></span></div></font></td></tr></table><br>