From d7ac761b4eeac99d0264be6d7959beb912480fea Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 29 Jan 2020 23:45:55 -0700 Subject: [PATCH] Update destinations.php --- resources/classes/destinations.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/resources/classes/destinations.php b/resources/classes/destinations.php index 240054856d..e45b66bc42 100644 --- a/resources/classes/destinations.php +++ b/resources/classes/destinations.php @@ -500,6 +500,23 @@ if (!class_exists('destinations')) { return $array; } + /** + * valid destination + */ + public function valid($destination) { + $destinations = $this->all('dialplan'); + foreach($destinations as $category => $array) { + if (is_array($array)) { + foreach ($array as $key => $value) { + if ($destination == $value) { + return true; + } + } + } + } + return false; + } + /** * delete records */