From 99aa4971c43589c590f7ef85df74d81b4622efab Mon Sep 17 00:00:00 2001 From: Diederik de Groot Date: Thu, 9 Apr 2020 10:16:15 +0000 Subject: [PATCH] Fix Spelling Sccp_manager.class.php Switch to using camelCase for functions in Sccp_manager.class.php Remove old TODO comments Remove comments that don't add information Signed-off-by: Diederik de Groot --- Sccp_manager.class.php | 553 ++++++------------ .../aminterface/aminterface.class.php | 2 +- .../aminterface/oldinterface.class.php | 2 +- Sccp_manager.inc/dbinterface.class.php | 2 +- Sccp_manager.inc/sipconfigs.class.php | 2 +- Sccp_manager.inc/srvinterface.class.php | 22 +- Sccp_manager.inc/xmlinterface.class.php | 2 +- conf/sccpgeneral.xml.v433 | 12 +- install.php | 6 +- page.sccp_adv.php | 4 +- page.sccp_phone.php | 4 +- views/form.adddevice.php | 18 +- views/form.addruser.php | 4 +- views/form.addsdevice.php | 20 +- views/form.buttons.php | 6 +- views/form.dptemplate.php | 10 +- views/form.sbuttons.php | 6 +- views/formShow.php | 2 +- views/server.advanced.php | 4 +- views/server.datetime.php | 4 +- views/server.device.php | 14 +- views/server.info.php | 4 +- views/server.setting.php | 14 +- 23 files changed, 272 insertions(+), 445 deletions(-) diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index d11029b..c1772e4 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -15,17 +15,15 @@ * + Cisco Format Mac * + Model Information * + Device Right Menu - - - - - + * - Dial Templates are not really needed for skinny, skinny get's direct feed back from asterisk per digit --> + * - If your dialplan is finite (completely fixed length (depends on your country dialplan) dialplan, then dial templates are not required) --> + * - As far as i know FreePBX does also attempt to build a finite dialplan --> + * - Having to maintain both an asterisk dialplan and these skinny dial templates is annoying --> * + Dial Templates + Configuration * + Dial Templates in Global Configuration ( Enabled / Disabled ; default template ) * ? Dial Templates - Howto IT Include in XML.Config ??????? * + Dial Templates - SIP Device * - Dial Templates in device Configuration ( Enabled / inheret / Disabled ; template ) - * - WiFi Config (Bulk Deployment Utility for Cisco 7921, 7925, 7926)????? * + Change internal use Field to _Field (new feature in chan_sccp (added for Sccp_manager)) * + Delete phone XML @@ -90,7 +88,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO // const General - sccp.conf[%keyset%] = '5'; NAME space // const General - sccp.conf[%keyset%] = '6'; data // const General - default.xml = '10'; -// const General - templet.xml = '20'; +// const General - template.xml = '20'; // const General - system_path = '2'; // const General - don't store = '99'; // private $SCCP_LANG_DICTIONARY = 'SCCP-dictionary.xml'; // CISCO LANG file search in /tftp-path @@ -145,7 +143,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $this->getSccpSettingFromDB(); // Overwrite Exist // $this->getSccpSetingINI(false); // get from sccep.ini - $this->init_sccp_path(); + $this->initializeSccpPath(); $this->initVarfromDefs(); $this->initTftpLang(); @@ -173,7 +171,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO * Generate Input elements in Html Code from sccpgeneral.xml */ - public function ShowGroup($grup_name, $heder_show, $form_prefix = 'sccp', $form_values = null) + public function showGroup($grup_name, $heder_show, $form_prefix = 'sccp', $form_values = null) { $htmlret = ""; if (empty($form_values)) { @@ -208,7 +206,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO /* * Load config vars from xml */ - public function initVarfromXml() { if ((array) $this->xml_data) { @@ -232,7 +229,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } if (empty($this->sccpvalues[(string) $value->name])) { $this->sccpvalues[(string) $value->name] = array('keyword' => (string) $value->name, 'data' => $datav, 'type' => $tp, 'seq' => $seq); -// $this->sccpvalues[] = array('keyword' => (string)$value->name, 'data' =>(string)$value->default, 'type'=> '0'); } } } @@ -244,10 +240,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } if (empty($this->sccpvalues[(string) $child->name])) { $this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq); -// $this->sccpvalues[] = array('keyword' => (string)$child->name, 'data' =>(string)$child-> default,'type'=>'0'); } } -// if ($child['type'] == 'SLD' || $child['type'] == 'SLS' || $child['type'] == 'SLT' || $child['type'] == 'SL' || $child['type'] == 'SLM' || $child['type'] == 'SLZ' || $child['type'] == 'SLZN' || $child['type'] == 'SLA') { if (in_array($child['type'], array('SLD', 'SLS', 'SLT', 'SL', 'SLM', 'SLZ', 'SLTZN', 'SLA'))) { if (empty($child->value)) { $datav = (string) $child->default; @@ -264,33 +258,28 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } } - /* unused */ - + /* unused but FPBX API requires it */ public function doConfigPageInit($page) { $this->doGeneralPost(); } - /* unused */ - + /* unused but FPBX API requires it */ public function install() { } - /* unused */ - + /* unused but FPBX API requires it */ public function uninstall() { } - /* unused */ - + /* unused but FPBX API requires it */ public function backup() { } - /* unused */ - + /* unused but FPBX API requires it */ public function restore($backup) { } @@ -373,15 +362,15 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO /* * Show form information - General */ - public function myShowPage() { $request = $_REQUEST; $action = !empty($request['action']) ? $request['action'] : ''; + /* if ($this->sccpvalues['sccp_compatible']['data'] >= '433') { -// $this->sccp_metainfo = $this->srvinterface->getеtestChanSCCP_GlablsInfo('general'); + $this->sccp_metainfo = $this->srvinterface->getGlobalsFromMetaData('general'); } - + */ if (!empty($this->sccpvalues['displayconfig'])) { if (!empty($this->sccpvalues['displayconfig']['data']) && ($this->sccpvalues['displayconfig']['data'] == 'sccpsimple')) { $this->pagedata = array( @@ -402,7 +391,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } if (empty($this->pagedata)) { -// $driver = $this->FreePBX->Config->get_conf_setting('ASTSIPDRIVER'); + //$driver = $this->FreePBX->Config->get_conf_setting('ASTSIPDRIVER'); $this->pagedata = array( "general" => array( "name" => _("General SCCP Settings"), @@ -441,7 +430,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $this->pagedata; } - public function InfoServerShowPage() + public function infoServerShowPage() { $request = $_REQUEST; $action = !empty($request['action']) ? $request['action'] : ''; @@ -462,13 +451,12 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $this->pagedata; } - public function AdvServerShowPage() + public function advServerShowPage() { $request = $_REQUEST; $action = !empty($request['action']) ? $request['action'] : ''; $inputform = !empty($request['tech_hardware']) ? $request['tech_hardware'] : ''; -// print_r($inputform); if (empty($this->pagedata)) { switch ($inputform) { case dialplan: @@ -509,16 +497,16 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $this->pagedata; } - public function PhoneShowPage() + public function phoneShowPage() { $request = $_REQUEST; $action = !empty($request['action']) ? $request['action'] : ''; $inputform = !empty($request['tech_hardware']) ? $request['tech_hardware'] : ''; + /* if ($this->sccpvalues['sccp_compatible']['data'] >= '433') { -// $this->sccp_metainfo = $this->srvinterface->getеtestChanSCCP_GlablsInfo('device'); + $this->sccp_metainfo = $this->srvinterface->getGlobalsFromMetaData('device'); } - -// print_r($inputform); + */ if (empty($this->pagedata)) { switch ($inputform) { case "cisco": @@ -549,18 +537,20 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO "name" => _("Sip device Buttons"), "page" => 'views/form.sbuttons.php' )); -// if ($this->sccpvalues['sccp_compatible']['data'] < '433') { -// $this->pagedata["sccpcodec"] = array( -// "name" => _("Device SCCP Codec"), -// "page" => 'views/server.codec.php' -// ); -// } + /* + if ($this->sccpvalues['sccp_compatible']['data'] < '433') { + $this->pagedata["sccpcodec"] = array( + "name" => _("Device SCCP Codec"), + "page" => 'views/server.codec.php' + ); + } + */ break; case "r_user": $this->pagedata = array( "general" => array( - "name" => _("Rouming User configuration"), + "name" => _("Roaming User configuration"), "page" => 'views/form.addruser.php' ), "buttons" => array( @@ -601,15 +591,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $this->pagedata; } - public function FormShowPage() + public function formShowPage() { $request = $_REQUEST; $action = !empty($request['action']) ? $request['action'] : ''; - if (empty($this->pagedata)) { -// $driver = $this->FreePBX->Config->get_conf_setting('ASTSIPDRIVER'); - + //$driver = $this->FreePBX->Config->get_conf_setting('ASTSIPDRIVER'); $this->pagedata = array( "general" => array( "name" => _("SCCP Extension"), @@ -674,6 +662,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return false; } + // !TODO!: this should go into it's only ajam.html.php file (see: dahdiconfig) public function ajaxHandler() { $request = $_REQUEST; @@ -683,105 +672,87 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO case 'savesettings': $action = isset($request['sccp_createlangdir']) ? $request['sccp_createlangdir'] : ''; if ($action == 'yes') { - $this->init_tftp_lang_path(); + $this->initializeTFtpLanguagePath(); } - $this->save_submit($request); - $this->sccp_db_save_setting(); -// $this->sccp_create_sccp_init(); - $this->sccp_create_tftp_XML(); + $this->handleSubmit($request); + $this->saveSccpSettings(); + //$this->createDefaultSccpConfig(); + $this->createDefaultSccpXml(); -// $res = $this->srvinterface->sccp_core_commands(array('cmd' => 'sccp_reload')); -// $res = $this->srvinterface->sccp_core_commands(array('cmd' => 'restart_phone')); $res = $this->srvinterface->sccp_reload(); $msg [] = 'Config Saved: ' . $res['Response']; $msg [] = 'Info :' . $res['data']; -// needreload(); -// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) + // !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) return array('status' => true, 'message' => $msg, 'reload' => true); break; case 'save_sip_hardware': case 'save_hardware': - $this->save_hw_phone($request); -// return array('status' => true, 'href' => 'config.php?display=sccp_phone', 'reload' => true); + $this->saveSccpDevice($request); return array('status' => true, 'search' => '?display=sccp_phone', 'hash' => 'sccpdevice'); - return $this->save_hw_phone($request); - break; case 'save_ruser': -// $res = $request; - $res = $this->save_rouming_users($request); + //$res = $request; + $res = $this->handleRoamingUsers($request); return array('status' => true, 'search' => '?display=sccp_phone', 'hash' => 'general'); - return array('status' => false, 'message' => print_r($res)); break; - /* !TODO!: -TODO-: dialplan templates should be removed (only required for very old devices (like ATA) */ -// ------------------------------- Old + Sip deviece support - In the development--- case 'save_dialplan_template': - $res = $this->save_DialPlan($request); + /* !TODO!: -TODO-: dialplan templates should be removed (only required for very old devices (like ATA) */ + // ------------------------------- Old + Sip device support - In the development--- + $res = $this->saveDialPlan($request); //public if (empty($res)) { return array('status' => true, 'search' => '?display=sccp_adv', 'hash' => 'sccpdialplan'); } else { -// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) return array('status' => false, 'message' => print_r($res)); } break; case 'delete_dialplan': if (!empty($request['dialplan'])) { $get_file = $request['dialplan']; - $res = $this->del_DialPlan($get_file); -// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) + $res = $this->deleteDialPlan($get_file); return array('status' => true, 'message' => 'Dial Template has been deleted ! ', 'table_reload' => true); } else { -// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) return array('status' => false, 'message' => print_r($res)); } break; -// ------------------------------- Old deviece support - In the development--- + // ------------------------------- Old device support - In the development--- case 'delete_hardware': if (!empty($request['idn'])) { foreach ($request['idn'] as $idv) { -// $msg = strpos($idv, 'SEP-'); if ($this->strpos_array($idv, array('SEP', 'ATA', 'VG')) !== false) { - $this->dbinterface->sccp_save_db('sccpdevice', array('name' => $idv), 'delete', "name"); - $this->dbinterface->sccp_save_db("sccpbuttons", array(), 'delete', '', $idv); - $this->sccp_delete_device_XML($idv); // Концы в вводу !! -// $this->sccp_core_commands(array('cmd' => 'reload_phone', 'name' => $idv)); -// $this->srvinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $idv)); - $this->srvinterface->sccp_device_reset($idv); + $this->dbinterface->write('sccpdevice', array('name' => $idv), 'delete', "name"); + $this->dbinterface->write("sccpbuttons", array(), 'delete', '', $idv); + $this->deleteSccpDeviceXML($idv); // Концы в вводу !! + $this->srvinterface->sccpDeviceReset($idv); } } -// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) return array('status' => true, 'table_reload' => true, 'message' => 'HW is Delete ! '); } break; -// ------------- Create device tftp configuration case 'create_hw_tftp': $ver_id = ' Test !'; if (!empty($request['idn'])) { $models = array(); foreach ($request['idn'] as $idv) { - $this->sccp_delete_device_XML($idv); + $this->deleteSccpDeviceXML($idv); $models [] = array('name' => $idv); } } else { - $this->sccp_delete_device_XML('all'); + $this->deleteSccpDeviceXML('all'); $models = $this->dbinterface->get_db_SccpTableData("SccpDevice"); } - $this->sccp_create_tftp_XML(); // Default XML + $this->createDefaultSccpXml(); // Default XML $ver_id = ' on found active model !'; - //return array('status' => false, 'message' => 'Error :'. print_r($models,1)); foreach ($models as $data) { - $ver_id = $this->sccp_create_device_XML($data['name']); + $ver_id = $this->createSccpDeviceXML($data['name']); }; if ($this->sccpvalues['siptftp']['data'] == 'on') { // Check SIP Support Enabled - $this->sccp_create_xmlSoftkey(); // Create Softkey Sets for SIP + $this->createSccpXmlSoftkey(); // Create Softkey Sets for SIP } - -// !TODO!: -TODO-: Do these returned message strings work with i18n ? -// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) + // !TODO!: -TODO-: Do these returned message strings work with i18n ? return array('status' => true, 'message' => 'Create new config files (version:' . $ver_id . ')'); break; @@ -795,17 +766,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $msg = strpos($idv, 'SEP-'); if (!(strpos($idv, 'SEP') === false)) { if ($cmd_id == 'reset_token') { -// $res = $this->srvinterface->sccp_core_commands(array('cmd' => 'reset_token', 'name' => $idv)); $res = $this->srvinterface->sccp_reset_token($idv); $msgr[] = $msg . ' ' . $res['Response'] . ' ' . $res['data']; } else { -// $res = $this->srvinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $idv)); - $res = $this->srvinterface->sccp_device_reset($idv); + $res = $this->srvinterface->sccpDeviceReset($idv); $msgr[] = $msg . ' ' . $res['Response'] . ' ' . $res['data']; } -// $msg = print_r($this->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $idv)), 1); -// $msg = $res['Response'] . ' ' . $res['data']; } if ($idv == 'all') { $dev_list = $this->srvinterface->sccp_get_active_device(); @@ -813,30 +780,21 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO if ($cmd_id == 'reset_token') { if (($data['token'] == 'Rej') || ($data['status'] == 'Token ')) { $res = $this->srvinterface->sccp_reset_token($idv); -// $res = $this->srvinterface->sccp_core_commands(array('cmd' => 'reset_token', 'name' => $key)); - // $msg .= 'Send Token reset to :' . $key . '
'; $msgr[] = 'Send Token reset to :' . $key; } } else { - $res = $this->srvinterface->sccp_device_reset($idv); -// $res = $this->srvinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $key)); -// $msg .= $res['Response'] . ' ' . $res['data'] . '
'; + $res = $this->srvinterface->sccpDeviceReset($idv); $msgr[] = $res['Response'] . ' ' . $res['data']; } -// $msg .= $res['Response'] . ' ' . $res['data'] . ' '; } } } } -// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) return array('status' => true, 'message' => $msgr, 'reload' => true); -// return array('status' => true, 'message' => 'Reset command send
' . $msg, 'reload' => true); -// } break; case 'update_button_label': $msg = ''; $hw_list = array(); -// return array('status' => false, 'message' => 'update_button_label send ' . $msg, 'reload' => false); if (!empty($request['name'])) { foreach ($request['name'] as $idv) { if (!(strpos($idv, 'SEP') === false)) { @@ -846,9 +804,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } } } - $res = $this->sccp_db_update_butons($hw_list); + $res = $this->updateSccpButtons($hw_list); $msg .= $res['Response'] . ' raw: ' . $res['data'] . ' '; -// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) return array('status' => true, 'message' => 'Update Butons Labels Complite ' . $msg, 'reload' => true); case 'model_add': @@ -868,7 +825,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $save_settings[$value] = $this->val_null; // null } } - $this->dbinterface->sccp_save_db('sccpdevmodel', $save_settings, $upd_mode, "model"); + $this->dbinterface->write('sccpdevmodel', $save_settings, $upd_mode, "model"); return array('status' => true, 'table_reload' => true); } return $save_settings; @@ -883,7 +840,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $save_settings = array(); if (!empty($request['model'])) { foreach ($request['model'] as $idv) { - $this->dbinterface->sccp_save_db('sccpdevmodel', array('model' => $idv, 'enabled' => $model_set), 'update', "model"); + $this->dbinterface->write('sccpdevmodel', array('model' => $idv, 'enabled' => $model_set), 'update', "model"); } } return array('status' => true, 'table_reload' => true); @@ -891,7 +848,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO break; case 'model_delete': if (!empty($request['model'])) { - $this->dbinterface->sccp_save_db('sccpdevmodel', array('model' => $request['model']), 'delete', "model"); + $this->dbinterface->write('sccpdevmodel', array('model' => $request['model']), 'delete', "model"); return array('status' => true, 'table_reload' => true); } break; @@ -900,7 +857,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO case 'all': case 'extension': case 'enabled': - $devices = $this->getSccp_model_information($request['type'], $validate = true); + $devices = $this->getSccpModelInformation($request['type'], $validate = true); break; } if (empty($devices)) { @@ -913,9 +870,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO if (!empty($request['softkey'])) { $id_name = $request['softkey']; unset($this->sccp_conf_init[$id_name]); - $this->sccp_create_sccp_init(); + $this->createDefaultSccpConfig(); $msg = print_r($this->srvinterface->sccp_reload(), 1); -// $msg = print_r($this->srvinterface->sccp_core_commands(array('cmd' => 'sccp_reload')), 1); return array('status' => true, 'table_reload' => true); } break; @@ -926,22 +882,15 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO foreach ($this->extconfigs->getextConfig('keyset') as $keyl => $vall) { if (!empty($request[$keyl])) { $this->sccp_conf_init[$id_name][$keyl] = $request[$keyl]; - } else { -// $this->sccp_conf_init[$id_name][$keyl] = ''; // ???? } } - $this->sccp_create_sccp_init(); + $this->createDefaultSccpConfig(); -// !TODO!: -TODO-: Check SIP Support Enabled - $this->sccp_create_xmlSoftkey(); + // !TODO!: -TODO-: Check SIP Support Enabled + $this->createSccpXmlSoftkey(); $msg = print_r($this->srvinterface->sccp_reload(), 1); -// $msg = print_r($this->srvinterface->sccp_core_commands(array('cmd' => 'sccp_reload')), 1); - return array('status' => true, 'table_reload' => true); -// return $this->sccp_conf_init[$id_name]; } - -// sccp_conf_init break; case 'getSoftKey': $result = array(); @@ -968,19 +917,20 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO if (empty($result)) { return array(); } - /* $res_info = $this->aminterface->core_list_all_exten('exten'); - if (!empty($res_info)) { - foreach ($result as $key => $value) { - $tpm_info = $res_info[$value['name']]; - if (!empty($tpm_info)) { - $result[$key]['line_status'] = $tpm_info['status']; - $result[$key]['line_statustext'] = $tpm_info['statustext']; - } else { - $result[$key]['line_status'] = ''; - $result[$key]['line_statustext'] = ''; - } - } - } + /* + $res_info = $this->aminterface->core_list_all_exten('exten'); + if (!empty($res_info)) { + foreach ($result as $key => $value) { + $tpm_info = $res_info[$value['name']]; + if (!empty($tpm_info)) { + $result[$key]['line_status'] = $tpm_info['status']; + $result[$key]['line_statustext'] = $tpm_info['statustext']; + } else { + $result[$key]['line_status'] = ''; + $result[$key]['line_statustext'] = ''; + } + } + } * */ return $result; @@ -996,7 +946,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO if (empty($result)) { $result = array(); } else { -// $staus = $this->sccp_get_active_device(); foreach ($result as &$dev_id) { $id_name = $dev_id['name']; if (!empty($staus[$id_name])) { @@ -1013,18 +962,16 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } } if (!empty($staus)) { -// Array ( [name] => SEP0004F2EDCBFD [mac] => SEP0004F2EDCBFD [type] => 7937 [button] => line,7818,default ) foreach ($staus as $dev_ids) { $id_name = $dev_ids['name']; if (empty($dev_ids['news'])) { $dev_data = $this->srvinterface->sccp_getdevice_info($id_name); if (!empty($dev_data['SCCP_Vendor']['model_id'])) { -// $dev_data = $this->sccp_getdevice_info($id_name); $dev_addon = $dev_data['SCCP_Vendor']['model_addon']; if (empty($dev_addon)) { $dev_addon = null; } - $dev_schema = $this->getSccp_model_information('byciscoid', false, "all", array('model' => $dev_data['SCCP_Vendor']['model_id'])); + $dev_schema = $this->getSccpModelInformation('byciscoid', false, "all", array('model' => $dev_data['SCCP_Vendor']['model_id'])); $result[] = array('name' => $id_name, 'mac' => $id_name, 'button' => '---', 'type' => $dev_schema[0]['model'], 'new_hw' => 'Y', 'description' => '*NEW* ' . $dev_ids['descr'], 'status' => '*NEW* ' . $dev_ids['status'], 'address' => $dev_ids['address'], 'addon' => $dev_addon); @@ -1034,17 +981,17 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } return $result; break; -// ------------------------------- Old deviece support - In the development--- case 'getDialTemplate': - $result = $this->get_DialPlanList(); + // ------------------------------- Old device support - In the development--- + $result = $this->getDialPlanList(); if (empty($result)) { $result = array(); } return $result; break; -// ------------------------------- Old deviece support - In the development--- case 'backupsettings': - $filename = $this->sccp_create_sccp_backup(); + // ------------------------------- Old device support - In the development--- + $filename = $this->createSccpBackup(); $file_name = basename($filename); header("Content-Type: application/zip"); @@ -1054,15 +1001,15 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO readfile($filename); unlink($filename); -// return array('status' => false, 'message' => $result); - // return $result; + // return array('status' => false, 'message' => $result); + return $result; break; } } public function doGeneralPost() { -// $this->FreePBX->WriteConfig($config); + // $this->FreePBX->WriteConfig($config); if (!isset($_REQUEST['Submit'])) { return; } @@ -1073,17 +1020,16 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO * * Save Hardware Device Information to Db + ???? Create / update XML Profile * */ - - function get_buttons_phone($get_settings, $ref_id = '', $ref_type = 'sccpdevice') + function getPhoneButtons($get_settings, $ref_id = '', $ref_type = 'sccpdevice') { -// Get Model Buttons info + // get Model Buttons info $res = array(); $def_feature = array('parkinglot' => array('name' => 'P.slot', 'value' => 'default'), 'devstate' => array('name' => 'Coffee', 'value' => 'coffee'), 'monitor' => array('name' => 'Record Calls', 'value' => '') ); -// $lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); + // $lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); $max_btn = ((!empty($get_settings['buttonscount']) ? $get_settings['buttonscount'] : 100)); $last_btn = $max_btn; for ($it = $max_btn; $it >= 0; $it--) { @@ -1108,7 +1054,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO switch ($btn_t) { case 'feature': $btn_f = $get_settings['button' . $it . '_feature']; -// $btn_opt = (empty($get_settings['button' . $it . '_fvalue'])) ? '' : $get_settings['button' . $it . '_fvalue']; + // $btn_opt = (empty($get_settings['button' . $it . '_fvalue'])) ? '' : $get_settings['button' . $it . '_fvalue']; $btn_n = (empty($get_settings['button' . $it . '_flabel'])) ? $def_feature[$btn_f]['name'] : $get_settings['button' . $it . '_flabel']; $btn_opt = $btn_f; if (!empty($def_feature[$btn_f]['value'])) { @@ -1150,7 +1096,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $btn_n = $get_settings['button' . $it . '_hline'] . '!silent'; $btn_opt = ''; } else { -// $btn_opt .= ',' . $get_settings['button' . $it . '_hline'] . $this->hint_context['default']; + // $btn_opt .= ',' . $get_settings['button' . $it . '_hline'] . $this->hint_context['default']; $btn_opt .= ',' . $get_settings['button' . $it . '_hline']; } } @@ -1190,7 +1136,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $res; } - function save_hw_phone($get_settings, $validateonly = false) + function saveSccpDevice($get_settings, $validateonly = false) { $hdr_prefix = 'sccp_hw_'; $hdr_arprefix = 'sccp_hw-ar_'; @@ -1245,7 +1191,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } else { $value = 'all'; // Bug If not System Codecs } -// } else $value = 'alaw;ulaw'; // Bug If not System Codecs break; case 'phonecodepage': $value = 'null'; @@ -1263,11 +1208,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $value = $get_settings[$hdr_prefix . 'netlang'] . ':' . $get_settings[$hdr_prefix . 'devlang']; } break; -// case '_json': -// foreach ($get_settings[$hdr_arprefix . $key.'_sip'] as $vkey => $vval) { -// } -// break; -// + /* + case '_json': + foreach ($get_settings[$hdr_arprefix . $key.'_sip'] as $vkey => $vval) { + } + break; + + */ default: if (!empty($get_settings[$hdr_prefix . $key])) { $value = $get_settings[$hdr_prefix . $key]; @@ -1282,7 +1229,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO case 'inherit': if ($vval == 'on') { $arr_clear = true; - // Злобный ХАК + // Злобный ХАК ?!TODO!? if ($key == 'permit') { $save_settings['deny'] = 'NONE'; } @@ -1319,31 +1266,21 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $save_settings[$key] = $value; } } -// Save / Updade Base - $this->dbinterface->sccp_save_db("sccpdevice", $save_settings, 'replace'); - -// Get Model Buttons info -// $save_buttons = $this-> get_buttons_phone($get_settings,$name_dev, 'sccpdevice'); - $save_buttons = $this->get_buttons_phone($get_settings, $name_dev, $hw_type); - -// Sace Buttons config - $this->dbinterface->sccp_save_db("sccpbuttons", $save_buttons, $update_hw, '', $name_dev); - -// Create Device XML - $this->sccp_create_device_XML($name_dev); + $this->dbinterface->write("sccpdevice", $save_settings, 'replace'); + $save_buttons = $this->getPhoneButtons($get_settings, $name_dev, $hw_type); + $this->dbinterface->write("sccpbuttons", $save_buttons, $update_hw, '', $name_dev); + $this->createSccpDeviceXML($name_dev); if ($hw_id == 'new') { -// $this->srvinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $name_dev)); - $this->srvinterface->sccp_device_reset($name_dev); + $this->srvinterface->sccpDeviceReset($name_dev); } else { - $this->srvinterface->sccp_device_restart($name_dev); -// $this->srvinterface->sccp_core_commands(array('cmd' => 'restart_phone', 'name' => $name_dev)); + $this->srvinterface->sccpDeviceRestart($name_dev); } return $save_settings; } - function save_submit($get_settings, $validateonly = false) + function handleSubmit($get_settings, $validateonly = false) { $hdr_prefix = 'sccp_'; $hdr_arprefix = 'sccp-ar_'; @@ -1426,16 +1363,16 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } } if (!empty($save_settings)) { - $this->sccp_db_save_setting($save_settings); + $this->saveSccpSettings($save_settings); $this->getSccpSettingFromDB(); -// $this->sccp_create_sccp_init(); + // $this->createDefaultSccpConfig(); } - $this->sccp_create_sccp_init(); // Rewrite Config. + $this->createDefaultSccpConfig(); // Rewrite Config. $save_settings[] = array('status' => true); return $save_settings; } - function save_rouming_users($get_settings, $validateonly = false) + function handleRoamingUsers($get_settings, $validateonly = false) { $hdr_prefix = 'sccp_ru_'; $hdr_arprefix = 'sccp_ru-ar_'; @@ -1447,14 +1384,14 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO 'devstate' => array('name' => 'Coffee', 'value' => 'coffee'), 'monitor' => array('name' => 'Record Calls', 'value' => '') ); - * */ $name_dev = ''; $db_field = $this->dbinterface->get_db_SccpTableData("get_colums_sccpuser"); -// $hw_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid']; -// $update_hw = ($hw_id == 'new') ? 'update' : 'clear'; + // $hw_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid']; + // $update_hw = ($hw_id == 'new') ? 'update' : 'clear'; $hw_prefix = 'SEP'; $name_dev = $get_settings[$hdr_prefix . 'id']; + $save_buttons = $this->getPhoneButtons($get_settings, $name_dev, 'sccpline'); foreach ($db_field as $data) { $key = (string) $data['Field']; @@ -1484,7 +1421,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO case 'inherit': if ($vval == 'on') { $arr_clear = true; - // Злобный ХАК + // Злобный ХАК ?!TODO!? if ($key == 'permit') { $save_settings['deny'] = 'NONE'; } @@ -1521,15 +1458,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $save_settings[$key] = $value; } } -// Save / Updade Base -// return $save_settings; - // $update_hw = ($hw_id == 'new') ? 'update' : 'clear'; - - $this->dbinterface->sccp_save_db("sccpuser", $save_settings, 'replace', 'name'); - - $save_buttons = $this->get_buttons_phone($get_settings, $name_dev, 'sccpline'); -// Sace Buttons config - $this->dbinterface->sccp_save_db("sccpbuttons", $save_buttons, 'clear', '', $name_dev); + $this->dbinterface->write("sccpuser", $save_settings, 'replace', 'name'); + $this->dbinterface->write("sccpbuttons", $save_buttons, 'clear', '', $name_dev); return $save_buttons; return $save_settings; @@ -1546,7 +1476,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO public function getMyConfig($var = null, $id = "noid") { -// $final = false; switch ($var) { case "voicecodecs": $val = explode(";", $this->sccpvalues['allow']['data']); @@ -1583,8 +1512,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO public function getCodecs($type, $showDefaults = false) { $allSupported = array(); -// $Sccp_Codec = array('gsm','slin16','allow','ulaw','g722','g723','g726','g728','g729','ilibc','isac','opus','h224','aac','h264','h263','h265','h261'); - $Sccp_Codec = array('gsm', 'slin16', 'alaw', 'ulaw', 'g722', 'g723', 'g726', 'g728', 'g729', 'ilibc', 'opus', 'h264', 'h263', 'h265', 'h261'); + $Sccp_Codec = array('alaw', 'ulaw', 'g722', 'g723', 'g726', 'g729', 'gsm', 'ilbc', 'h264', 'h263', 'h261'); switch ($type) { case 'audio': $lcodecs = $this->getMyConfig('voicecodecs'); @@ -1635,7 +1563,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $codecs; } else { - //Remove all non digits + //Remove non digits $final = array(); foreach ($codecs as $codec => $order) { $order = trim($order); @@ -1691,29 +1619,28 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } /* - function soundlang_hookGet_config($engine) { + function soundlang_hookGet_config($engine) { - global $core_conf; - $this->debugdata($engine); + global $core_conf; + $this->debugdata($engine); - switch ($engine) { - case "asterisk": - // if (isset($core_conf) && is_a($core_conf, "core_conf")) { - // $language = FreePBX::Soundlang()->getLanguage(); - // if ($language != "") { - // $core_conf->addSipGeneral('language', $language); - // $core_conf->addIaxGeneral('language', $language); - // } - // } - break; - } - } + switch ($engine) { + case "asterisk": + if (isset($core_conf) && is_a($core_conf, "core_conf")) { + $language = FreePBX::Soundlang()->getLanguage(); + if ($language != "") { + $core_conf->addSipGeneral('language', $language); + $core_conf->addIaxGeneral('language', $language); + } + } + break; + } + } */ /** * Retrieve Active Codecs * return fiends Lag pack - * */ public function getTftpLang() { @@ -1751,8 +1678,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO /* * Check tftp/xml file path and permissions */ - - private function init_tftp_lang_path() + private function initializeTFtpLanguagePath() { $dir = $this->sccppath["tftp_lang_path"]; foreach ($this->extconfigs->getextConfig('sccp_lang') as $lang_key => $lang_value) { @@ -1768,16 +1694,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO /* * Check file paths and permissions */ - -// !TODO!: -TODO-: This function is getting a little big. Might be possible to sperate tftp work into it's own file/class. Initially, you need to remove the not working section and commented out section - - function init_sccp_path() + // !TODO!: -TODO-: This function is getting a little big. Might be possible to sperate tftp work into it's own file/class. Initially, you need to remove the not working section and commented out section + function initializeSccpPath() { global $db; global $amp_conf; $driver_revision = array('0' => '', '430' => '.v431', '431' => '.v432', '432' => '.v432', '433' => '.v433'); - $confDir = $amp_conf["ASTETCDIR"]; if (empty($this->sccppath["asterisk"])) { if (strlen($confDir) < 1) { @@ -1805,11 +1728,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } } -// $this->sccpvalues['sccp_compatible'] = '11'; $this->sccpvalues['sccp_compatible'] = array('keyword' => 'compatible', 'data' => $ver_id, 'type' => '1', 'seq' => '99'); - $this->sccppath = $this->extconfigs->validate_init_path($confDir, $this->sccpvalues, $sccp_driver_replace); - $driver = $this->FreePBX->Core->getAllDriversInfo(); // ?????? $read_config = $this->cnf_read->getConfig('sccp.conf'); @@ -1832,10 +1752,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO /* * Soft Key - * */ - - function sccp_create_xmlSoftkey() + function createSccpXmlSoftkey() { foreach ($this->srvinterface->sccp_list_keysets() as $keyl => $vall) { $this->xmlinterface->create_xmlSoftkeyset($this->sccp_conf_init, $this->sccppath, $keyl); @@ -1844,10 +1762,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO /* * DialPlan - * */ - - function get_DialPlanList() + function getDialPlanList() { $dir = $this->sccppath["tftp_dialplan"] . '/dial*.xml'; $base_len = strlen($this->sccppath["tftp_dialplan"]) + 1; @@ -1860,7 +1776,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $res; } - function get_DialPlan($get_file) + function getDialPlan($get_file) { $file = $this->sccppath["tftp_dialplan"] . '/' . $get_file . '.xml'; if (file_exists($file)) { @@ -1875,7 +1791,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $res; } - function del_DialPlan($get_file) + function deleteDialPlan($get_file) { if (!empty($get_file)) { $file = $this->sccppath["tftp_dialplan"] . '/' . $get_file . '.xml'; @@ -1886,19 +1802,17 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $res; } - function save_DialPlan($get_settings) + function saveDialPlan($get_settings) { $confDir = $this->sccppath["tftp_dialplan"]; - return $this->xmlinterface->save_DialPlan($confDir, $get_settings); + return $this->xmlinterface->saveDialPlan($confDir, $get_settings); } /* * Update Butons Labels on mysql DB - * */ - - private function sccp_db_update_butons($hw_list = array()) + private function updateSccpButtons($hw_list = array()) { $save_buttons = array(); @@ -1906,7 +1820,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $buton_list = array(); foreach ($hw_list as $value) { $buton_tmp = $this->dbinterface->get_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial', 'id' => $value['name'])); -// die(print_r($buton_tmp,1)); if (!empty($buton_tmp)) { $buton_list = array_merge($buton_list, $buton_tmp); } @@ -1914,7 +1827,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } else { $buton_list = $this->dbinterface->get_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial')); } -// die(print_r($buton_list,1)); if (empty($buton_list)) { return array('Response' => ' Found 0 device ', 'data' => ''); } @@ -1936,16 +1848,14 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO if (empty($save_buttons)) { return array('Response' => 'No update required', 'data' => ' 0 - records '); } - $res = $this->dbinterface->sccp_save_db("sccpbuttons", $save_buttons, 'replace', '', ''); + $res = $this->dbinterface->write("sccpbuttons", $save_buttons, 'replace', '', ''); return array('Response' => 'Update records :' . count($save_buttons), 'data' => $res); } /* * Save Config Value to mysql DB - * sccp_db_save_setting(empty) - Save All settings from $sccpvalues */ - - private function sccp_db_save_setting($save_value = array()) + private function saveSccpSettings($save_value = array()) { global $db; global $amp_conf; @@ -1958,9 +1868,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $save_settings[] = array($key, $db->escapeSimple($val['data']), $val['seq'], $val['type']); } } - $this->dbinterface->sccp_save_db('sccpsettings', $save_settings, 'clear'); + $this->dbinterface->write('sccpsettings', $save_settings, 'clear'); } else { - $this->dbinterface->sccp_save_db('sccpsettings', $save_value, 'update'); + $this->dbinterface->write('sccpsettings', $save_value, 'update'); return true; } return true; @@ -1969,18 +1879,17 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO /* * Create XMLDefault.cnf.xml */ - - function sccp_create_tftp_XML() + function createDefaultSccpXml() { foreach ($this->sccpvalues as $key => $value) { $data_value[$key] = $value['data']; } - $data_value['server_if_list'] = $this->getIP_information2('ip4'); - $model_information = $this->getSccp_model_information($get = "enabled", $validate = false); // Get Active + $data_value['server_if_list'] = $this->getIpInformation('ip4'); + $model_information = $this->getSccpModelInformation($get = "enabled", $validate = false); // Get Active if (empty($model_information)) { - $model_information = $this->getSccp_model_information($get = "all", $validate = false); // Get All + $model_information = $this->getSccpModelInformation($get = "all", $validate = false); // Get All } $lang_data = $this->extconfigs->getextConfig('sccp_lang'); @@ -1992,8 +1901,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO /* * Create (SEP) dev_ID.cnf.xml */ - - function sccp_create_device_XML($dev_id = '') + function createSccpDeviceXML($dev_id = '') { if (empty($dev_id)) { @@ -2004,7 +1912,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $dev_line_data = null; $dev_config = $this->dbinterface->get_db_SccpTableData("get_sccpdevice_byid", array('id' => $dev_id)); -// Support Cisco Sip Device + // Support Cisco Sip Device if (!empty($dev_config['type'])) { if (strpos($dev_config['type'], 'sip') !== false) { $sccp_native = false; @@ -2035,11 +1943,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO break; } } -// return print_r($data_value ,true); -// return print_r($dev_line_data,true); } } -// return print_r($dev_config ,true); foreach ($this->sccpvalues as $key => $value) { $data_value[$key] = $value['data']; @@ -2048,19 +1953,17 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $data_value['ntp_timezone_id'] = $this->extconfigs->getextConfig('sccp_timezone', $data_value['ntp_timezone']); // Old Cisco Device // $data_value['ntp_timezone_id'] = $data_value['ntp_timezone']; // New Cisco Device ! // $data_value['ntp_timezone_id'] = // SPA Cisco Device ! - $data_value['server_if_list'] = $this->getIP_information2('ip4'); + $data_value['server_if_list'] = $this->getIpInformation('ip4'); $dev_config = array_merge($dev_config, $this->sccppath); $dev_config['tftp_firmware'] = ''; $dev_config['addon_info'] = array(); if (!empty($dev_config['addon'])) { $hw_addon = explode(',', $dev_config['addon']); foreach ($hw_addon as $key) { - $hw_data = $this->getSccp_model_information('byid', false, "all", array('model' => $key)); + $hw_data = $this->getSccpModelInformation('byid', false, "all", array('model' => $key)); $dev_config['addon_info'][$key] = $hw_data[0]['loadimage']; } } -// return print_r($data_value,true); -// return print_r($dev_config,true); $lang_data = $this->extconfigs->getextConfig('sccp_lang'); if (!$sccp_native) { @@ -2069,7 +1972,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $this->xmlinterface->create_SEP_XML($this->sccppath["tftp_path_store"], $data_value, $dev_config, $dev_id, $lang_data); } - function sccp_delete_device_XML($dev_id = '') + function deleteSccpDeviceXML($dev_id = '') { if (empty($dev_id)) { return false; @@ -2092,7 +1995,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } } - private function sccp_create_sccp_backup() + private function createSccpBackup() { global $amp_conf; $dir_info = array(); @@ -2102,8 +2005,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $backup_info = $this->sccppath["tftp_path"] . '/sccp_dir.info'; $result = $this->dbinterface->dump_sccp_tables($this->sccppath["tftp_path"], $amp_conf['AMPDBNAME'], $amp_conf['AMPDBUSER'], $amp_conf['AMPDBPASS']); - $dir_info['asterisk'] = $this->find_all_files($amp_conf['ASTETCDIR']); - $dir_info['tftpdir'] = $this->find_all_files($this->sccppath["tftp_path"]); + $dir_info['asterisk'] = $this->findAllFiles($amp_conf['ASTETCDIR']); + $dir_info['tftpdir'] = $this->findAllFiles($this->sccppath["tftp_path"]); $dir_info['driver'] = $this->FreePBX->Core->getAllDriversInfo(); $dir_info['core'] = $this->srvinterface->getSCCPVersion(); $dir_info['realtime'] = $this->srvinterface->sccp_realtime_status(); @@ -2112,7 +2015,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $dir_info['dbinterface'] = $this->dbinterface->info(); $dir_info['XML'] = $this->xmlinterface->info(); - $fh = fopen($backup_info, 'w'); $dir_str = "Begin JSON data ------------\r\n"; fwrite($fh, $dir_str); @@ -2146,10 +2048,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $filename; } - function sccp_create_sccp_init() + function createDefaultSccpConfig() { -// Make sccp.conf data -// [general] + // Make sccp.conf data + // [general] foreach ($this->sccpvalues as $key => $value) { if ($value['seq'] == 0) { switch ($key) { @@ -2175,18 +2077,16 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } } } -// [Namesoftkeyset] -// type=softkeyset - + // [Namesoftkeyset] + // type=softkeyset $this->cnf_wr->writeConfig('sccp.conf', $this->sccp_conf_init); -// return $this-> sccp_conf_init; } - function getSccp_model_information($get = "all", $validate = false, $format_list = "all", $filter = array()) + function getSccpModelInformation($get = "all", $validate = false, $format_list = "all", $filter = array()) { -// $file_ext = array('.loads', '.LOADS', '.sbn', '.SBN', '.bin', '.BIN','.zup','.ZUP'); + // $file_ext = array('.loads', '.LOADS', '.sbn', '.SBN', '.bin', '.BIN','.zup','.ZUP'); $file_ext = array('.loads', '.sbn', '.bin', '.zup'); -// $dir = $this->sccppath["tftp_path"]; + // $dir = $this->sccppath["tftp_path"]; $dir = $this->sccppath["tftp_firmware_path"]; $dir_tepl = $this->sccppath["tftp_templates"]; @@ -2197,15 +2097,15 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO case 'pro': case 'on': case 'internal': - $dir_list = $this->find_all_files($dir, $file_ext, 'fileonly'); + $dir_list = $this->findAllFiles($dir, $file_ext, 'fileonly'); break; case 'off': default: // Place in root TFTP dir - $dir_list = $this->find_all_files($dir, $file_ext); + $dir_list = $this->findAllFiles($dir, $file_ext); break; } } else { - $dir_list = $this->find_all_files($dir, $file_ext, 'fileonly'); + $dir_list = $this->findAllFiles($dir, $file_ext, 'fileonly'); } $raw_settings = $this->dbinterface->getDb_model_info($get, $format_list, $filter); @@ -2229,35 +2129,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO break; case 'off': default: // Place in root TFTP dir -// $raw_settings[$i]['buttons'] = $dir.'/'.$raw_settings[$i]['loadimage']; if (strpos(strtolower($filek), strtolower($dir . '/' . $raw_settings[$i]['loadimage'])) !== false) { -// if (strpos(strtolower($filek), strtolower($raw_settings[$i]['loadimage'])) !== false) { $raw_settings[$i]['validate'] = 'yes;'; } break; } } } - /* OLD search - $file = $dir . '/' . $raw_settings[$i]['loadimage']; - if (is_dir($file)) { - $file .= '/' . $raw_settings[$i]['loadimage']; - } - $raw_settings[$i]['validate'] = 'no;'; - if (strtolower($raw_settings[$i]['vendor']) == 'cisco') { - foreach ($file_ext as $value) { - if (file_exists($file . $value)) { - $raw_settings[$i]['validate'] = 'yes;'; - break; - } - } - } else { - if (file_exists($file)) { - $raw_settings[$i]['validate'] = 'yes;'; - } - } - * - */ } else { $raw_settings[$i]['validate'] = '-;'; } @@ -2276,30 +2154,31 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $raw_settings; } - function get_hint_info($sort = true, $filter = array()) + function getHintInformation($sort = true, $filter = array()) { $res = array(); $default_hint = '@ext-local'; -// get all extension -// $res = $this->srvinterface->core_list_all_exten('hint', $filter); + // get all extension + // $res = $this->srvinterface->core_list_all_exten('hint', $filter); if (empty($res)) { -// Old Req get all hints + // Old Req get all hints $tmp_data = $this->srvinterface->sccp_list_all_hints(); foreach ($tmp_data as $value) { $res[$value] = array('key' => $value, 'exten' => before('@', $value), 'label' => $value); } } -// Update info from sccp_db + // Update info from sccp_db $tmp_data = $this->dbinterface->get_db_SccpTableData('SccpExtension'); foreach ($tmp_data as $value) { $name_l = $value['name']; if (!empty($res[$name_l . $default_hint])) { $res[$name_l . $default_hint]['exten'] = $name_l; $res[$name_l . $default_hint]['label'] = $value['label']; - } else { // if not exist in system hints ..... ??????? + } else { + // if not exist in system hints ..... ??????? $res[$name_l . $default_hint] = array('key' => $name_l . $default_hint, 'exten' => $name_l, 'label' => $value['label']); } } @@ -2315,13 +2194,12 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $res_sort[$value] = $res[$value]; } -// Update info from sip DB + // Update info from sip DB /* !TODO!: Update Hint info from sip DB ??? */ - return $res_sort; } - function getIP_information2($type = '') + function getIpInformation($type = '') { $interfaces = array(); switch ($type) { @@ -2354,7 +2232,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO return $interfaces; } - function getIP_information_old() + function getIpInformationOld() { $interfaces['auto'] = array('0.0.0.0', 'All', '0'); @@ -2384,67 +2262,16 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO $ret = preg_match("/(\d*+.\d*+.\d*+.\d*+)[\/(\d*+)]*/", $vals[3], $ip); $interfaces[$vals[$int]] = array($ip[1], $vals[$int], ((empty($ip[2]) ? '' : $ip[2]))); } -// $int = 0; -// foreach ($interfaces as $value) { -// $this->sccpvalues['interfaces_'.$int] = array('keyword' => 'interfaces_'.$value[1], 'data' => $value[0], 'type' => '1', 'seq' => '99'); -// $int ++; -// } return $interfaces; } - private function replaceSimpleXmlNode($xml, $element = SimpleXMLElement) + private function findAllFiles($dir, $file_mask = null, $mode = 'full') { - $dom = dom_import_simplexml($xml); - $import = $dom->ownerDocument->importNode( - dom_import_simplexml($element), - true - ); - $dom->parentNode->replaceChild($import, $dom); - } - - private function appendSimpleXmlNode($xml, $element = SimpleXMLElement) - { - - $dom = dom_import_simplexml($xml); - $import = $dom->ownerDocument->importNode( - dom_import_simplexml($element), - true - ); -// $dom->parentNode->appendChild($import, $dom); - $dom->parentNode->appendChild($import->cloneNode(true)); - } - -// private function removeSimpleXmlNode($node) { -// $dom = dom_import_simplexml($node); -// $dom->parentNode->removeChild($dom); -// } - private function strpos_array($haystack, $needles) - { - if (is_array($needles)) { - foreach ($needles as $str) { - if (is_array($str)) { - $pos = strpos_array($haystack, $str); - } else { - $pos = strpos($haystack, $str); - } - if ($pos !== false) { - return $pos; - } - } - } else { - return strpos($haystack, $needles); - } - return false; - } - - private function find_all_files($dir, $file_mask = null, $mode = 'full') - { - $result = null; if (empty($dir) || (!file_exists($dir))) { return $result; } - + $root = scandir($dir); foreach ($root as $value) { if ($value === '.' || $value === '..') { @@ -2478,7 +2305,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } continue; } - $sub_fiend = $this->find_all_files("$dir/$value", $file_mask, $mode); + $sub_fiend = $this->findAllFiles("$dir/$value", $file_mask, $mode); if (!empty($sub_fiend)) { foreach ($sub_fiend as $sub_value) { if (!empty($sub_value)) { @@ -2488,5 +2315,5 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO } } return $result; - } + } } diff --git a/Sccp_manager.inc/aminterface/aminterface.class.php b/Sccp_manager.inc/aminterface/aminterface.class.php index a633d1c..31d24e7 100644 --- a/Sccp_manager.inc/aminterface/aminterface.class.php +++ b/Sccp_manager.inc/aminterface/aminterface.class.php @@ -502,7 +502,7 @@ class aminterface } return $result; } - function sccp_device_reset($devicename, $action = '') + function sccpDeviceReset($devicename, $action = '') { if ($this->_connect_state) { if ($action == 'tokenack') { diff --git a/Sccp_manager.inc/aminterface/oldinterface.class.php b/Sccp_manager.inc/aminterface/oldinterface.class.php index e873cbb..e797d3f 100644 --- a/Sccp_manager.inc/aminterface/oldinterface.class.php +++ b/Sccp_manager.inc/aminterface/oldinterface.class.php @@ -489,7 +489,7 @@ class oldinterface /* * [Segments] => ( [0] => general [1] => device [2] => line [3] => softkey ) */ - function getеtestChanSCCP_GlablsInfo($Segment = '') + function getGlobalsFromMetaData($Segment = '') { global $astman; $params = array(); diff --git a/Sccp_manager.inc/dbinterface.class.php b/Sccp_manager.inc/dbinterface.class.php index 9c6f144..9d5eaf5 100644 --- a/Sccp_manager.inc/dbinterface.class.php +++ b/Sccp_manager.inc/dbinterface.class.php @@ -240,7 +240,7 @@ class dbinterface return $raw_settings; } - function sccp_save_db($db_name = "", $save_value = array(), $mode = 'update', $key_fld = "", $hwid = "") + function write($db_name = "", $save_value = array(), $mode = 'update', $key_fld = "", $hwid = "") { // mode clear - Empty tabele before update // mode update - update / replace record diff --git a/Sccp_manager.inc/sipconfigs.class.php b/Sccp_manager.inc/sipconfigs.class.php index 92945b5..edf688a 100644 --- a/Sccp_manager.inc/sipconfigs.class.php +++ b/Sccp_manager.inc/sipconfigs.class.php @@ -74,7 +74,7 @@ class sipconfigs // $result['tlsport'] = \FreePBX::Sipsettings()->getConfig('tlsbindport'); // $tmp_sipsetigs = \FreePBX::Sipsettings()->getChanSipSettings(); $tmp_binds = \FreePBX::Sipsettings()->getBinds(); - $if_list = $this->paren_class ->getIP_information2('ip4'); + $if_list = $this->paren_class ->getIpInformation('ip4'); /* $tmp_bind_ip = !empty($tmp_sipsetigs['externhost_val']) ? $tmp_sipsetigs['externhost_val'] : ''; diff --git a/Sccp_manager.inc/srvinterface.class.php b/Sccp_manager.inc/srvinterface.class.php index c2b77eb..14e4d4a 100644 --- a/Sccp_manager.inc/srvinterface.class.php +++ b/Sccp_manager.inc/srvinterface.class.php @@ -62,19 +62,19 @@ class srvinterface 'about' => 'Server interface data ver: ' . $Ver . "\n " . $info); } - public function sccp_device_reset($id = '') + public function sccpDeviceReset($id = '') { if ($this->ami_mode) { - return $this->aminterface->sccp_device_reset($id, 'reset'); + return $this->aminterface->sccpDeviceReset($id, 'reset'); } else { return $this->oldinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $id)); } } - public function sccp_device_restart($id = '') + public function sccpDeviceRestart($id = '') { if ($this->ami_mode) { - return $this->aminterface->sccp_device_reset($id, 'restart'); + return $this->aminterface->sccpDeviceReset($id, 'restart'); } else { return $this->oldinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $id)); } @@ -83,7 +83,7 @@ class srvinterface public function sccp_device_reload($id = '') { if ($this->ami_mode) { - return $this->aminterface->sccp_device_reset($id, 'full'); + return $this->aminterface->sccpDeviceReset($id, 'full'); } else { return $this->oldinterface->sccp_core_commands(array('cmd' => 'reload_phone', 'name' => $id)); } @@ -92,7 +92,7 @@ class srvinterface public function sccp_reset_token($id = '') { if ($this->ami_mode) { - return $this->aminterface->sccp_device_reset($id, 'tokenack'); + return $this->aminterface->sccpDeviceReset($id, 'tokenack'); } else { return $this->oldinterface->sccp_core_commands(array('cmd' => 'reset_token', 'name' => $id)); } @@ -124,19 +124,19 @@ class srvinterface if (!empty($params['cmd'])) { switch ($params['cmd']) { case 'reset_phone': - return $this->aminterface->sccp_device_reset($params['name'], 'reset'); + return $this->aminterface->sccpDeviceReset($params['name'], 'reset'); break; case 'restart_phone': - return $this->aminterface->sccp_device_reset($params['name'], 'restart'); + return $this->aminterface->sccpDeviceReset($params['name'], 'restart'); break; case 'reload_phone': - return $this->aminterface->sccp_device_reset($params['name'], 'full'); + return $this->aminterface->sccpDeviceReset($params['name'], 'full'); break; case 'reset_token': - return $this->aminterface->sccp_device_reset($params['name'], 'tokenack'); + return $this->aminterface->sccpDeviceReset($params['name'], 'tokenack'); break; case 'reload_line': -// return $this->aminterface->sccp_device_reset($params['name'], 'full'); +// return $this->aminterface->sccpDeviceReset($params['name'], 'full'); break; // case 'get_version': // case 'sccp_reload': diff --git a/Sccp_manager.inc/xmlinterface.class.php b/Sccp_manager.inc/xmlinterface.class.php index 42a97d2..859e1c4 100644 --- a/Sccp_manager.inc/xmlinterface.class.php +++ b/Sccp_manager.inc/xmlinterface.class.php @@ -778,7 +778,7 @@ class xmlinterface return time(); } - function save_DialPlan($confDir, $get_settings) + function saveDialPlan($confDir, $get_settings) { $xmlstr = "\n"; $xmlstr .= "" . time() . "\n"; diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index c395c47..2882f8d 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -1038,11 +1038,11 @@ and open the template in the editor. Base Version before all crash :-) system_rouminguser - + no - Experemental Function Rouming Users + Experemental Function Roaming Users @@ -1609,10 +1609,10 @@ and open the template in the editor. Base Version before all crash :-) - + @@ -1650,7 +1650,7 @@ and open the template in the editor. Base Version before all crash :-) roaminglogin - + off @@ -1676,7 +1676,7 @@ and open the template in the editor. Base Version before all crash :-) diff --git a/install.php b/install.php index 77efb5a..bd026f1 100644 --- a/install.php +++ b/install.php @@ -1002,8 +1002,8 @@ if (!$sccp_db_ver) { } outn("
"); -// $ss->save_submit($request); -// $ss->sccp_create_sccp_init(); -// $ss->sccp_db_save_setting(); +// $ss->handleSubmit($request); +// $ss->createDefaultSccpConfig(); +// $ss->saveSccpSettings(); // //} diff --git a/page.sccp_adv.php b/page.sccp_adv.php index 73bb256..0c2b530 100644 --- a/page.sccp_adv.php +++ b/page.sccp_adv.php @@ -16,10 +16,10 @@ if (!defined('FREEPBX_IS_AUTH')) { // $spage = FreePBX::create()->Sccp_manager; if (empty($spage->class_error)) { - $display_page = $spage->AdvServerShowPage(); + $display_page = $spage->advServerShowPage(); $display_info = _("SCCP Advance Server Configuration"); } else { - $display_page = $spage->InfoServerShowPage(); + $display_page = $spage->infoServerShowPage(); $display_info = _("SCCP Server Configuration"); } ?> diff --git a/page.sccp_phone.php b/page.sccp_phone.php index 96c449c..038860e 100644 --- a/page.sccp_phone.php +++ b/page.sccp_phone.php @@ -16,10 +16,10 @@ if (!defined('FREEPBX_IS_AUTH')) { // $spage = FreePBX::create()->Sccp_manager; if (empty($spage->class_error)) { - $display_page = $spage->PhoneShowPage(); + $display_page = $spage->phoneShowPage(); $display_info = _("SCCP Phone Manager"); } else { - $display_page = $spage->InfoServerShowPage(); + $display_page = $spage->infoServerShowPage(); $display_info = _("SCCP Server Configuration"); } diff --git a/views/form.adddevice.php b/views/form.adddevice.php index 643d85f..edb43fe 100644 --- a/views/form.adddevice.php +++ b/views/form.adddevice.php @@ -34,7 +34,7 @@ if (!empty($_REQUEST['id'])) { if (!empty($val)) { switch ($key) { case 'type': - $tmp_raw = $this->getSccp_model_information('byid', true, 'all', array('model'=>$val)); + $tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$val)); if (!empty($tmp_raw[0])) { $tmp_raw = $tmp_raw[0]; } @@ -108,15 +108,15 @@ if (!empty($device_warning)) { echo ''; } if (empty($dev_id)) { - echo $this->ShowGroup('sccp_hw_dev', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev', 1, 'sccp_hw', $def_val); } else { - echo $this->ShowGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val); } - echo $this->ShowGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val); - echo $this->ShowGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val); - echo $this->ShowGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val); - echo $this->ShowGroup('sccp_hw_dev_pickup', 1, 'sccp_hw', $def_val); - echo $this->ShowGroup('sccp_hw_dev_conference', 1, 'sccp_hw', $def_val); - echo $this->ShowGroup('sccp_hw_dev_network', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev_pickup', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev_conference', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev_network', 1, 'sccp_hw', $def_val); ?> diff --git a/views/form.addruser.php b/views/form.addruser.php index 0afc810..2deedb0 100644 --- a/views/form.addruser.php +++ b/views/form.addruser.php @@ -28,7 +28,7 @@ if (!empty($_REQUEST['ru_id'])) { ShowGroup('sccp_ruser', 1, 'sccp_ru', $def_val); - echo $this->ShowGroup('sccp_ruser_time', 1, 'sccp_ru', $def_val); + echo $this->showGroup('sccp_ruser', 1, 'sccp_ru', $def_val); + echo $this->showGroup('sccp_ruser_time', 1, 'sccp_ru', $def_val); ?> diff --git a/views/form.addsdevice.php b/views/form.addsdevice.php index 33da1db..99899be 100644 --- a/views/form.addsdevice.php +++ b/views/form.addsdevice.php @@ -34,7 +34,7 @@ if (!empty($_REQUEST['id'])) { if (!empty($val)) { switch ($key) { case 'type': - $tmp_raw = $this->getSccp_model_information('byid', true, 'all', array('model'=>$val)); + $tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$val)); if (!empty($tmp_raw[0])) { $tmp_raw = $tmp_raw[0]; } @@ -110,16 +110,16 @@ if (!empty($device_warning)) { echo ''; } if (empty($dev_id)) { - echo $this->ShowGroup('sccp_hw_sip_dev', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_sip_dev', 1, 'sccp_hw', $def_val); } else { - echo $this->ShowGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val); } - echo $this->ShowGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val); - echo $this->ShowGroup('sccp_hw_sip_conf', 1, 'sccp_hw', $def_val); -// echo $this->ShowGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val); -// echo $this->ShowGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val); -// echo $this->ShowGroup('sccp_hw_dev_pickup', 1, 'sccp_hw', $def_val); -// echo $this->ShowGroup('sccp_hw_dev_conference', 1, 'sccp_hw', $def_val); -// echo $this->ShowGroup('sccp_hw_dev_network', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val); + echo $this->showGroup('sccp_hw_sip_conf', 1, 'sccp_hw', $def_val); +// echo $this->showGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val); +// echo $this->showGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val); +// echo $this->showGroup('sccp_hw_dev_pickup', 1, 'sccp_hw', $def_val); +// echo $this->showGroup('sccp_hw_dev_conference', 1, 'sccp_hw', $def_val); +// echo $this->showGroup('sccp_hw_dev_network', 1, 'sccp_hw', $def_val); ?> diff --git a/views/form.buttons.php b/views/form.buttons.php index 8a9b770..217bc85 100644 --- a/views/form.buttons.php +++ b/views/form.buttons.php @@ -21,7 +21,7 @@ $feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'dev $lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); //$hint_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); -$hint_list = $this->get_hint_info(true, array('context'=>'park-hints')) ; +$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ; // print_r($hint_list); $line_id =0; @@ -40,12 +40,12 @@ if (!empty($_REQUEST['id'])) { } if (!empty($_REQUEST['new_id'])) { $val = $_REQUEST['type']; - $dev_schema = $this-> getSccp_model_information('byid', false, "all", array('model' =>$val)); + $dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val)); // $db_device = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $val)); $max_buttons = $dev_schema[0]['buttons']; if (!empty($_REQUEST['addon'])) { $val = $_REQUEST['addon']; - $dev_schema = $this-> getSccp_model_information('byid', false, "all", array('model' =>$val)); + $dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val)); $max_buttons += $dev_schema[0]['buttons']; } $show_buttons = $max_buttons; diff --git a/views/form.dptemplate.php b/views/form.dptemplate.php index 6747208..1523448 100644 --- a/views/form.dptemplate.php +++ b/views/form.dptemplate.php @@ -6,7 +6,7 @@ * and open the template in the editor. */ -//$list_data = $this->get_DialPlan('dialplan'); +//$list_data = $this->getDialPlan('dialplan'); //print_r($list_data); //$dialFelds = array('match','timeout','line','rewrite','tone'); //$dialFelds = array('match','timeout','User','rewrite','tone'); @@ -16,7 +16,7 @@ if (!empty($_REQUEST['extdisplay'])) { $dev_id = $_REQUEST['extdisplay']; } if ($dev_id != '*new*') { - $list_data= $this->get_DialPlan($dev_id); + $list_data= $this->getDialPlan($dev_id); $data_s= ''; foreach ($list_data['template'] as $key => $value) { foreach ($dialFelds as $fld) { @@ -41,7 +41,7 @@ if ($dev_id != '*new*') { ShowGroup('sccp_dp_new_template', 0, 'sccp_dial', $def_val); + echo $this->showGroup('sccp_dp_new_template', 0, 'sccp_dial', $def_val); } ?> @@ -74,7 +74,7 @@ if ($dev_id != '*new*') { ShowGroup('sccp_dp_new_template',0,'sccp_dial',$def_val); - echo $this->ShowGroup('sccp_dp_template', 0, 'sccp_dial', $def_val); +// echo $this->showGroup('sccp_dp_new_template',0,'sccp_dial',$def_val); + echo $this->showGroup('sccp_dp_template', 0, 'sccp_dial', $def_val); ?> diff --git a/views/form.sbuttons.php b/views/form.sbuttons.php index 1eb4eb1..12b0b89 100644 --- a/views/form.sbuttons.php +++ b/views/form.sbuttons.php @@ -18,7 +18,7 @@ $feature_list= array('parkinglot'=>'Park Slots','monitor'=> "Record Calls",'dev //$lines_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); $lines_list = $this->sipconfigs->get_db_sip_TableData('Device'); //$hint_list = $this->dbinterface->get_db_SccpTableData('SccpExtension'); -$hint_list = $this->get_hint_info(true, array('context'=>'park-hints')) ; +$hint_list = $this->getHintInformation(true, array('context'=>'park-hints')) ; // print_r($lines_list); $line_id =0; @@ -37,12 +37,12 @@ if (!empty($_REQUEST['id'])) { } if (!empty($_REQUEST['new_id'])) { $val = $_REQUEST['type']; - $dev_schema = $this-> getSccp_model_information('byid', false, "all", array('model' =>$val)); + $dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val)); // $db_device = $this->dbinterface->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $val)); $max_buttons = $dev_schema[0]['buttons']; if (!empty($_REQUEST['addon'])) { $val = $_REQUEST['addon']; - $dev_schema = $this-> getSccp_model_information('byid', false, "all", array('model' =>$val)); + $dev_schema = $this-> getSccpModelInformation('byid', false, "all", array('model' =>$val)); $max_buttons += $dev_schema[0]['buttons']; } $show_buttons = $max_buttons; diff --git a/views/formShow.php b/views/formShow.php index f47d302..fd215e5 100644 --- a/views/formShow.php +++ b/views/formShow.php @@ -437,7 +437,7 @@ foreach ($items as $child) { } if ($child['type'] == 'SLP') { if (empty($dialplan_list)) { - foreach (\FreePBX::Sccp_manager()->get_DialPlanList() as $tmpkey) { + foreach (\FreePBX::Sccp_manager()->getDialPlanList() as $tmpkey) { $tmp_id = $tmpkey['id']; $dialplan_list[$tmp_id] = $tmp_id; } diff --git a/views/server.advanced.php b/views/server.advanced.php index 2c578c8..a79c007 100644 --- a/views/server.advanced.php +++ b/views/server.advanced.php @@ -12,8 +12,8 @@ ShowGroup('sccp_srst', 1); -// echo $this->ShowGroup('sccp_dev_time',1); + echo $this->showGroup('sccp_srst', 1); +// echo $this->showGroup('sccp_dev_time',1); ?> diff --git a/views/server.datetime.php b/views/server.datetime.php index 01288a7..b12d801 100644 --- a/views/server.datetime.php +++ b/views/server.datetime.php @@ -12,8 +12,8 @@ ShowGroup('sccp_dev_ntp', 1); - echo $this->ShowGroup('sccp_dev_time', 1); + echo $this->showGroup('sccp_dev_ntp', 1); + echo $this->showGroup('sccp_dev_time', 1); ?> diff --git a/views/server.device.php b/views/server.device.php index c305aa4..887bd21 100644 --- a/views/server.device.php +++ b/views/server.device.php @@ -7,7 +7,7 @@ */ /* $data = 'none;'; -foreach ($this->get_DialPlanList() as $value) { +foreach ($this->getDialPlanList() as $value) { $data .= $value['id'].';'; } if (strlen($data) >0 ){ @@ -22,11 +22,11 @@ if (strlen($data) >0 ){ ShowGroup('sccp_dev_config', 1); - echo $this->ShowGroup('sccp_dev_group_config', 1); - echo $this->ShowGroup('sccp_dev_advconfig', 1); - echo $this->ShowGroup('sccp_dev_softkey', 1); - echo $this->ShowGroup('sccp_dev_url', 1); - echo $this->ShowGroup('sccp_hotline_config', 1); + echo $this->showGroup('sccp_dev_config', 1); + echo $this->showGroup('sccp_dev_group_config', 1); + echo $this->showGroup('sccp_dev_advconfig', 1); + echo $this->showGroup('sccp_dev_softkey', 1); + echo $this->showGroup('sccp_dev_url', 1); + echo $this->showGroup('sccp_hotline_config', 1); ?> diff --git a/views/server.info.php b/views/server.info.php index 1d9c757..2487fca 100644 --- a/views/server.info.php +++ b/views/server.info.php @@ -427,7 +427,7 @@ if ($test_ami == 1) { // $test_data = $this->srvinterface-> astman_GetRaw('ExtensionStateList'); // print_r($test_data); // print_r($this->srvinterface-> core_list_all_exten()); -// print_r($this->get_hint_info()); +// print_r($this->getHintInformation()); // print_r($this->aminterface->open()); // print_r($this->aminterface-> core_list_all_exten('exten')); // print_r($this->aminterface->Sok_param['total']); @@ -516,5 +516,5 @@ foreach ($info as $key => $value) { -ShowGroup('sccp_info', 0); ?> +showGroup('sccp_info', 0); ?> diff --git a/views/server.setting.php b/views/server.setting.php index 31a6a61..d918fc7 100644 --- a/views/server.setting.php +++ b/views/server.setting.php @@ -22,12 +22,12 @@ ShowGroup('sccp_general', 1); - echo $this->ShowGroup('sccp_dev_time_s', 1); - echo $this->ShowGroup('sccp_net', 1); - echo $this->ShowGroup('sccp_lang', 1); - echo $this->ShowGroup('sccp_qos_config', 1); - echo $this->ShowGroup('sccp_extpath_config', 1); + echo $this->showGroup('sccp_general', 1); + echo $this->showGroup('sccp_dev_time_s', 1); + echo $this->showGroup('sccp_net', 1); + echo $this->showGroup('sccp_lang', 1); + echo $this->showGroup('sccp_qos_config', 1); + echo $this->showGroup('sccp_extpath_config', 1); ?> @@ -44,7 +44,7 @@