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 */