Hi,

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.

I am using the ESL connection method to communicate with the Freeswitch. Here is the snapshot of my code.

Receiving inbound call :
        @sd = s
        @con = ESL::ESLconnection.new(s.to_i)
        @con.execute("linger")
        @con.setEventLock("true")


        @con.sendRecv("myevents")
        @con.execute("answer")

          ...

          ....

After that i am playing and receiving input from the caller then i am bridging the call with some other number.

Bridge Call:
 @con.execute("bridge", "sofia/gateway/junctionnetworks//#{@destination_number}")   

and waiting for the bridge event

WaitForBridgeEvent:
def waitForBridge

        while @con.connected
            e = @con.recvEvent()
            next if e == nil
            printEventData(e)
            handleHangup if hangupOccurred(e)
            if e.getHeader("Event-Name") == "CHANNEL_BRIDGE" &&
                e.getHeader("Channel-State") == "CS_EXECUTE"
                answer_state = e.getHeader("Answer-State")
                if answer_state == "answered"
                    call_answer_time = e.getHeader("answered_time")
                    end_point_disp = e.getHeader("endpoint_disposition")
                    var_end_point_disp = e.getHeader("var_endpoint_dispoisition")
                    return call_answer_time, end_point_disp, var_end_point_disp
                end
            end
        end
end


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.

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)


Thanks and Regards,
Thirupathi