浏览代码

Update destinations.php

FusionPBX 5 年之前
父节点
当前提交
2937cfe8a6
共有 1 个文件被更改,包括 17 次插入0 次删除
  1. 17 0
      resources/classes/destinations.php

+ 17 - 0
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
 		*/