Hello, I have a dialplan where I get the incoming call to lua script <extension name="ext_call"> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="ignore_early_media=false"/> <condition field="destination_number" expression="\d{7,}"/>. <condition field="${sip_from_host}" expression="^(10\.9\.0\.25)$">. <action application ="lua" data="answer.lua"/>. </condition> </extension> and then I have answering in answer.lua: =========================== session:preAnswer(); [...accessing to DB...] if (session:ready()) then repeat index = index + 1; session_call = string.format("[leg_timeout=30,ignore_early_media=true,hangup_after_bridge=true,origination_caller_id_number=".. cid .."]sofia/gateway/%s/%s",gwlist[index],dn); legB = freeswitch.Session(session_call); until ((hcause == 'USER_BUSY') or (hcause == 'SUCCESS') or (hcause == 'NO_ANSWER') or (index == #gwlist) or(session:ready() == false)) if (legB:ready()) then. freeswitch.bridge(session, legB) end =========================== But I have a one problem, when the initial legA was disconnected before legB was answered. It it still continued to call legB (during the leg_timeout). Could you please explain, how I can cancel legB right after I got disconnect on legA in this case? Thank you. -- Nikolay