From bb3353e75698427c63ce009e1cfd29e05115d5db Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 25 Oct 2012 05:54:23 +0000 Subject: [PATCH] Add a select box for inbound routes with a list of the inbound destination numbers aka DID/DDI, DNIS... --- app/dialplan_inbound/dialplan_inbound_add.php | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php index e01c5cf616..1e693dcb41 100644 --- a/app/dialplan_inbound/dialplan_inbound_add.php +++ b/app/dialplan_inbound/dialplan_inbound_add.php @@ -671,12 +671,32 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { else { echo "\n"; echo "\n"; - echo " Destination Number:\n"; + echo " Destination Number:\n"; echo "\n"; echo "\n"; - echo " \n"; - echo "
\n"; - echo "Please enter the destination number. In North America this is usually a 10 or 11 digit number.\n"; + + $sql = "select * from v_destinations "; + $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "and destination_type = 'inbound' "; + $sql .= "order by destination_number asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); + if (count($result) > 0) { + echo " \n"; + echo "
\n"; + echo "Select the inbound destination number.\n"; + } + else { + echo " \n"; + } + unset ($prep_statement); + echo "\n"; echo "\n"; }