diff --git a/app/dialplan/dialplan_edit.php b/app/dialplan/dialplan_edit.php index e3b5771578..a5c23af242 100644 --- a/app/dialplan/dialplan_edit.php +++ b/app/dialplan/dialplan_edit.php @@ -670,7 +670,22 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //data echo "\n"; if ($element['hidden']) { - echo " \n"; + if ($dialplan_detail_type == 'bridge') { + // parse out gateway uuid + $bridge_statement = explode('/', $dialplan_detail_data); + if ($bridge_statement[0] == 'sofia' && $bridge_statement[1] == 'gateway') { + $gateway_uuid = $bridge_statement[2]; + } + // retrieve gateway name from db + $sql = "select gateway from v_gateways where gateway_uuid = '".$gateway_uuid."' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + if (count($result) > 0) { $gateway_name = $result[0]['gateway']; } + unset ($prep_statement, $sql); + } + $dialplan_detail_data_mod = ($gateway_name != '') ? str_replace($gateway_uuid, $gateway_name, $dialplan_detail_data) : $dialplan_detail_data; + echo " \n"; } echo " \n"; echo "\n";