Hi,

I'm trying to bridge 2 openzap channels, one is inbound call, another is outbound call.

Below is the Lua script which originates the outbound call in the inbound call dialplan.

If the "transfer" line is commented out, bridge is working fine. I suspect it is about call legs, but I can find the proper way to set then up. Could anyone please help, thanks.
 
-------------------------------------------------------------------------------------

session_orig = freeswitch.Session("OpenZAP/2/a/98877666")

while session:getState()~="CS_HANGUP" do
    os.execute("usleep 500000")
    if session_orig:answered() then
        break
    end
end

-- need to play message to called party before bridge
-- comment out the below line, then bridge is working
session_orig:transfer("orig_ext", "xml", "default")

freeswitch.bridge(session, session_orig)

-------------------------------------------------------------------------------------

Regards,
Tony