From 5edcafef1aaf8c48d4d2a64929db143765100c0e Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 18 Oct 2012 19:46:38 +0000 Subject: [PATCH] Fix a bug with ring group where when sending the call from an IVR Menu where answer was called then the ring group timeout was not working. Now using last_bridge_hangup_cause to know whether the call was answered already or whether to send the call to the timeout destination. --- includes/install/scripts/ring_group.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/install/scripts/ring_group.lua b/includes/install/scripts/ring_group.lua index 60b8f62976..51e728ed8f 100644 --- a/includes/install/scripts/ring_group.lua +++ b/includes/install/scripts/ring_group.lua @@ -93,7 +93,9 @@ session:execute("set", "hangup_after_bridge=true"); session:execute("set", "continue_on_fail=true"); session:execute("bridge", app_data); - if (not session:answered()) then + if (session:getVariable("last_bridge_hangup_cause") == "NORMAL_CLEARING") then + --ring group was answered + else session:execute(ring_group_timeout_app, ring_group_timeout_data); end end