<?php
class ExtensionManager {
	
	public static function doesExtensionExists($exten, &$type) {
		
		//FIXME: Check if user exists
		$model = User::model()->findByAttributes(array("extension" => $exten));
		if ($model != NULL) {
			return TRUE;
		}
		
		//FIXME: Check if IVR exists
		/*
		$model = IVR::model()->findByAttributes(array("extension" => $exten));
		if ($model != NULL) {
			return TRUE;
		}
    	*/
		
		
		// Further: Check if Queue exists
		// Further: Check if Conference exists
		// Further: Check if Huntgroup exists

		//FIXME: is there any other type of extensions?
		
		return FALSE;
	}
	
	
	
}