From 682fee7f9597af8906c627f2a0d2afe48e9fc1e9 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 20 Sep 2012 18:56:17 +0000 Subject: [PATCH] Add call flows to the switch_select_destination list. --- includes/lib_switch.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/includes/lib_switch.php b/includes/lib_switch.php index 422e1bc570..ec268acbe9 100644 --- a/includes/lib_switch.php +++ b/includes/lib_switch.php @@ -524,6 +524,41 @@ function switch_select_destination($select_type, $select_label, $select_name, $s } unset ($prep_statement); + //list call flows + if ($select_type == "dialplan" || $select_type == "ivr") { + $sql = "select * from v_call_flows "; + $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "order by call_flow_extension asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); + echo "\n"; + foreach ($result as &$row) { + $call_flow_name = $row["call_flow_name"]; + $call_flow_extension = $row["call_flow_extension"]; + $call_flow_context = $row["call_flow_context"]; + if ("transfer $call_flow_extension XML ".$call_flow_context == $select_value || "transfer:".$call_flow_extension." XML ".$call_flow_context == $select_value) { + if ($select_type == "ivr") { + echo " \n"; + } + if ($select_type == "dialplan") { + echo " \n"; + } + $selection_found = true; + } + else { + if ($select_type == "ivr") { + echo " \n"; + } + if ($select_type == "dialplan") { + echo " \n"; + } + } + } + echo "\n"; + unset ($prep_statement, $call_flow_extension); + } + //list call groups $sql = "select distinct(call_group) from v_extensions "; $sql .= "where domain_uuid = '$domain_uuid' ";