diff --git a/lib/electric_slide/call_queue.rb b/lib/electric_slide/call_queue.rb index f024013..cb814ce 100644 --- a/lib/electric_slide/call_queue.rb +++ b/lib/electric_slide/call_queue.rb @@ -389,7 +389,9 @@ def call_agent(agent, queued_call) agent_call.on_unjoined do ignoring_ended_calls { agent_call.hangup } - ignoring_ended_calls { queued_call.hangup } + ignoring_ended_calls do + queued_call.hangup if queued_call[:call_transferring_to].blank? + end end # Track whether the agent actually talks to the queued_call @@ -403,7 +405,7 @@ def call_agent(agent, queued_call) # Ensure we don't return an agent that was removed or paused old_call = agent.call conditionally_return_agent agent - agent.call = nil if agent_return_method == :manual || agent.call == old_call + agent.call = nil if agent_return_method == :manual || agent.call == old_call agent.callback :disconnect, queue, agent_call, queued_call