Beispiel #1
0
 protected function viewSetup()
 {
     parent::viewSetup();
     // Load the states array to the view
     $this->subview->test = "Welcome email";
     return TRUE;
 }
Beispiel #2
0
 protected function viewSetup()
 {
     parent::viewSetup();
     // Load the states array to the view
     $this->subview->states = self::$states;
     return TRUE;
 }
Beispiel #3
0
 protected function viewSetup()
 {
     if (!parent::viewSetup()) {
         return FALSE;
     }
     $this->subview->render_conditional = array('qtipAjaxForm' => FALSE, 'ajax' => FALSE);
     return TRUE;
 }
Beispiel #4
0
 public function addPluginData()
 {
     parent::addPluginData();
     $device = $this->base;
     if (isset($device['plugins']['endpointdevice']['mac_address']) && $device['plugins']['endpointdevice']['mac_address'] != "") {
         include_once MODPATH . 'endpointmanager-1.1' . DIRECTORY_SEPARATOR . "functions.php";
         $endpoint = new endpointman();
         $phone_info = array();
         if ($endpoint->mac_check_clean($device['plugins']['endpointdevice']['mac_address'])) {
             $dns = $device['User']['Location']['domain'];
             $key = explode("|", $device['plugins']['endpointdevice']['brand']);
             $phone_info['brand'] = $key[0];
             $phone_info['family'] = $key[1];
             $phone_info['model'] = $key[2];
             $phone_info['mac'] = $endpoint->mac_check_clean($device['plugins']['endpointdevice']['mac_address']);
             $phone_info['line'][1]['line'] = 1;
             $phone_info['line'][1]['ext'] = $device['plugins']['sip']['username'];
             $phone_info['line'][1]['description'] = $device['plugins']['endpointdevice']['display_name'];
             $phone_info['line'][1]['secret'] = $device['plugins']['sip']['password'];
             $phone_info['line'][1]['subscribe_mwi'] = 1;
             // Todo - map this properly to voicemail boxes
             $phone_info['host'] = $dns;
             $phone_info['port'] = 5060;
             $phone_info['options'] = array();
             // Is a Redbox or proxy in use?
             if (arr::get($device, 'plugins', 'endpointdevice', 'proxy_ip')) {
                 $phone_info['line'][1]['options']['enable_outbound_proxy_server'] = 1;
                 $phone_info['line'][1]['options']['outbound_proxy_server'] = arr::get($device, 'plugins', 'endpointdevice', 'proxy_ip');
                 $phone_info['line'][1]['options']['outbound_proxy_server_port'] = ($port = arr::get($device, 'plugins', 'endpointdevice', 'proxy_port')) ? $port : 5060;
                 $vlan_enable = arr::get($device, 'plugins', 'endpointdevice', 'vlan');
                 $phone_info['options']['voice_vlan_enable'] = $vlan_enable ? $vlan_enable : '0';
                 $phone_info['options']['voice_vlan_id'] = ($voice_vlan = arr::get($device, 'plugins', 'endpointdevice', 'voice_vlan')) ? $voice_vlan : '0';
                 $phone_info['options']['data_vlan_enable'] = $vlan_enable ? $vlan_enable : '0';
                 $phone_info['options']['data_vlan_id'] = ($data_vlan = arr::get($device, 'plugins', 'endpointdevice', 'data_vlan')) ? $data_vlan : '4095';
             } else {
                 $phone_info['line'][1]['options']['enable_outbound_proxy_server'] = 0;
                 $phone_info['options']['voice_vlan_enable'] = 0;
                 $phone_info['options']['data_vlan_enable'] = 0;
             }
             $phone_info['options']['update_mode'] = 4;
             $phone_info['options']['update_frequency'] = 5;
             // every 5 minutes
             $phone_info['options']['update_method'] = 'http';
             // todo: make this configurable
             $phone_info['options']['update_server'] = 'http://' . $dns . '/provision/';
             // todo: make this match blue.box, not the DNS name?
             $phone_info['timezone'] = "-8";
             $endpoint->prepare_configs($phone_info);
         } else {
             return false;
         }
     }
     return true;
 }
Beispiel #5
0
 protected function viewSetup()
 {
     parent::viewSetup();
     $dropdown = array();
     $rec = Doctrine::getTable('Grouping')->findOneBylevel(0);
     $dropdown[$rec->grouping_id] = str_repeat(" ", $rec->level * 5) . $rec->name;
     foreach ($rec->getNode()->getDescendants() as $desc) {
         //$dropdown[$desc->grouping_id]=$desc->name;
         $dropdown[$desc->grouping_id] = str_repeat(" ", $desc->level * 5) . $desc->name;
     }
     // Load the states array to the view
     $this->subview->groupings = $dropdown;
     return TRUE;
 }
Beispiel #6
0
 protected function delete_succeeded(&$object)
 {
     parent::delete_succeeded($object);
     $identifier = $object->identifier();
     // One of those nasty but functionaly things...
     $trunks = Doctrine::getTable('Trunk')->findAll();
     foreach ($trunks as $trunk) {
         /*
                     if (!isset($trunk['plugins']['simpleroute']['patterns'][$identifier['simple_route_id']]))
                     {
                         $patterns = $trunk['plugins']['simpleroute']['patterns'];
         
                         unset($patterns[$identifier['simple_route_id']]);
         
                         $trunk['plugins']['simpleroute']['patterns'] = $patterns;
                     }
         */
         kohana::log('debug', 'Rebuilding trunk ' . $trunk['trunk_id'] . ' to remove simple route ' . $identifier['simple_route_id']);
         $trunk->save();
     }
 }
Beispiel #7
0
 /**
  * Helper function for plugins. If a plugin is instantiated as a singleton, we automatically provide a getInstance() method.
  * Set properties in the main application if they are defined there but not in the local plugin class
  * @return object Instance of self
  */
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         $class = __CLASS__;
         self::$instance = new $class();
     }
     return self::$instance;
 }
Beispiel #8
0
 protected function addSubView()
 {
     $this->subview->outboundPatterns = Doctrine::getTable('SimpleRoute')->findAll(Doctrine::HYDRATE_ARRAY);
     $this->subview->contexts = Doctrine::getTable('Context')->findAll(Doctrine::HYDRATE_ARRAY);
     parent::addSubView();
 }
Beispiel #9
0
 protected function addSubView()
 {
     $this->subview->outboundPatterns = kohana::config('simpleroute.outbound_patterns');
     $this->subview->contexts = Doctrine::getTable('Context')->findAll(Doctrine::HYDRATE_ARRAY);
     parent::addSubView();
 }