diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 53c07f7..520bbcd 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -10,8 +10,7 @@ // http://chan-sccp-b.sourceforge.net/doc/_howto.xhtml#nf_adhoc_plar // https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cuipph/all_models/xsi/9-1-1/CUIP_BK_P82B3B16_00_phones-services-application-development-notes/CUIP_BK_P82B3B16_00_phones-services-application-development-notes_chapter_011.html // https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cuipph/7960g_7940g/sip/4_4/english/administration/guide/ver4_4/sipins44.html -/* - * ToDo: +/* !TODO!: * + Cisco Format Mac * + Model Information * + Device Right Menu @@ -519,27 +518,27 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { public function ajaxRequest($req, &$setting) { switch ($req) { - case 'savesettings': /* !TODO!: mixing snake case and camel case, chooose one :-) */ - case "save_hardware": - case "save_dp_template": - case "delete_hardware": - case "getPhoneGrid": - case "getExtensionGrid": - case "getDeviceModel": - case "getUserGrid": - case "getSoftKey": - case "getDialTemplate": - case "create_hw_tftp": - case "reset_dev": + case 'savesettings': + case 'save_hardware': + case 'save_dialplan_template': + case 'delete_hardware': + case 'getPhoneGrid': + case 'getExtensionGrid': + case 'getDeviceModel': + case 'getUserGrid': + case 'getSoftKey': + case 'getDialTemplate': + case 'create_hw_tftp': + case 'reset_dev': case 'reset_token': - case "model_enabled": - case "model_disabled": - case "model_update": - case "model_add": - case "model_delete": - case "updateSoftKey": - case "deleteSoftKey": - case "delete_dialplan": + case 'model_enabled': + case 'model_disabled': + case 'model_update': + case 'model_add': + case 'model_delete': + case 'updateSoftKey': + case 'deleteSoftKey': + case 'delete_dialplan': return true; break; } @@ -563,6 +562,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $res = $this->srvinterface->sccp_core_commands(array('cmd' => 'sccp_reload')); $msg = 'Config Saved: ' . $res['Response'] . '. Info :' . $res['data']; // needreload(); +// !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_hardware': @@ -573,23 +573,29 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { return $this->save_hw_phone($request); break; - case "save_dp_template": /* !TODO!: dialplan templates should be removed (only required for very old devices (like ATA) */ +/* !TODO!: -TODO-: dialplan templates should be removed (only required for very old devices (like ATA) */ +// ------------------------------- Old deviece suport - In the development--- + case 'save_dialplan_template': $res = $this->save_DialPlant($request); 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": + case 'delete_dialplan': if (!empty($request['dialplan'])) { $get_file = $request['dialplan']; $res = $this->del_DialPlant($get_file); +// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) 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 suport - In the development--- case 'delete_hardware': if (!empty($request['idn'])) { foreach ($request['idn'] as $idv) { @@ -602,6 +608,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $this->srvinterface->sccp_core_commands(array('cmd' => 'reset_phone', 'name' => $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; @@ -613,7 +620,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { foreach ($models as $data) { $ver_id = $this->sccp_create_device_XML($data['name']); }; - /* !TODO!: Do these returned message strings work with i18n ? */ +// !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) return array('status' => true, 'message' => 'Create new config files (version:' . $ver_id . ')'); break; @@ -649,6 +657,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } } } +// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg) return array('status' => true, 'message' => 'Reset command send ' . $msg, 'reload' => true); // } break; @@ -710,7 +719,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { return $devices; break; - case "deleteSoftKey": + case 'deleteSoftKey': if (!empty($request['softkey'])) { $id_name = $request['softkey']; unset($this->sccp_conf_init[$id_name]); @@ -719,13 +728,15 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { return array('status' => true, 'table_reload' => true); } break; - case "updateSoftKey": + case 'updateSoftKey': if (!empty($request['id'])) { $id_name = $request['id']; $this->sccp_conf_init[$id_name]['type'] = "softkeyset"; 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(); @@ -757,14 +768,14 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } return $result; break; - case "getExtensionGrid": + case 'getExtensionGrid': $result = $this->dbinterface->get_db_SccpTableData('SccpExtension'); if (empty($result)) { $result = array(); } return $result; break; - case "getPhoneGrid": + case 'getPhoneGrid': $result = $this->dbinterface->get_db_SccpTableData('SccpDevice'); $staus = $this->srvinterface->sccp_get_active_device(); if (empty($result)) { @@ -808,14 +819,15 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } return $result; break; - - case "getDialTemplate": - $result = $this->get_DP_list(); /* !TODO!: please use DialPlan instead of DP */ +// ------------------------------- Old deviece suport - In the development--- + case 'getDialTemplate': + $result = $this->get_DialPlanList(); if (empty($result)) { $result = array(); } return $result; break; +// ------------------------------- Old deviece suport - In the development--- } } @@ -1098,7 +1110,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } return; } - +/* function sccp_get_keysetdata($name) { if ($name == 'default') { @@ -1110,7 +1122,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $keysetData['name'] = ($keysetData['name'] ? $keysetData['name'] : $name); return $keysetData; } - +*/ +/* function sccp_edit_keyset($keysetData) { global $amp_conf; $key_name = array('onhook', 'connected', 'onhold', 'ringin', 'offhook', 'conntrans', 'digitsfoll', 'connconf', 'ringout', 'offhookfeat', 'onhint', 'onstealable'); @@ -1129,19 +1142,20 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $file_context = $keysetData['name']; if ($file_context != 'default') { $confDir = $amp_conf["ASTETCDIR"]; - if (strlen($confDir) < 1) { /* !TODO!: Can this actually happen, or does it mean amp_conf array is empty ? */ +// !TODO!: -TODO-: Can this actually happen, or does it mean amp_conf array is empty ? + if (strlen($confDir) < 1) { $confDir = "/etc/asterisk"; } - $inputfile = "$confDir/sccp.conf"; + $inputfile = $confDir."/sccp.conf"; if (!file_exists($inputfile)) { $sccpfile = file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/sccp.conf'); file_put_contents($inputfile, $sccpfile); } $handle = fopen($inputfile, "r"); - $file_context = "[$file_context]"; + $file_context = "[".$file_context."]"; $sccpfile = ''; - $conext_data = "$file_context ; Managed by sccp_manager\n"; + $conext_data = $file_context." ; Managed by sccp_manager\n"; $conext_data .= "type=softkeyset\n"; foreach ($keysetImplode as $field => $value) { echo($field); @@ -1187,7 +1201,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { file_put_contents($inputfile, $sccpfile); return $sccpfile; } - +*/ + /* function sccp_display_keyset($keysetData, $softkey, $option) { if ($keysetData['name'] == 'default') { $output = ""; @@ -1206,7 +1221,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } return $output; } - +*/ public function getMyConfig($var = null, $id = "noid") { // $final = false; switch ($var) { @@ -1425,7 +1440,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { /* * Check file paths and permissions */ - /* !TODO!: This function is getting a little big. Might be possible to sperate tftp work into it's own file/class */ +// !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() { global $db; @@ -1536,13 +1551,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } /* - * + * DialPlan * */ - /* !TODO!: please use DialPlan instead of DP */ - /* !TODO!: I think Dialplan stuff can be removed or at least commented out */ - - function get_DP_list() { + function get_DialPlanList() { $dir = $this->sccppath["tftp_DP"] . '/*.xml'; $base_len = strlen($this->sccppath["tftp_DP"]) + 1; $res = glob($dir); diff --git a/Sccp_manager.inc/srvinterface.class.php b/Sccp_manager.inc/srvinterface.class.php index e4d0afb..8b80ae0 100644 --- a/Sccp_manager.inc/srvinterface.class.php +++ b/Sccp_manager.inc/srvinterface.class.php @@ -6,7 +6,7 @@ * * */ -/* !TODO!: Re-Indent this file */ +/* !TODO!: Re-Indent this file. -TODO-: What do you mean? coreaccessinterface ?? */ namespace FreePBX\modules\Sccp_manager; @@ -115,6 +115,9 @@ class srvinterface { } /* Current not use */ + /* + * A function should be used in the form of buttons for getting all hint. Not working. I don't know how to use properly. + */ public function sccp_list_hints() { $ast_out = $this->sccp_core_commands(array('cmd' => 'get_hints')); @@ -141,13 +144,11 @@ class srvinterface { return $ast_key; } - /* !TODO!: install.php is still using the other version number */ +// !TODO!: -TODO-: install.php is still using the other version number. This is actually where I use another method ? + public function get_compatible_sccp() { - $res = $this->getChanSCCPVersion(); - if (empty($res)) { - $res = $this->getChanSCCPVersion(); - } + $res = $this->getSCCPVersion(); if (empty($res)) { return 0; } @@ -159,10 +160,15 @@ class srvinterface { // return $res["vCode"]; } - /* !TODO!: Multiple Version functions (choose one) */ - /* !TODO!: private ? */ + public function getSCCPVersion() { + $res = $this->getChanSCCPVersion(); + if (empty($res)) { + $res = $this->getCoreSCCPVersion(); + } + return $res; + } - function getCoreSCCPVersion() { + private function getCoreSCCPVersion() { $result = array(); $ast_out = $this->sccp_version(); $result["Version"] = $ast_out[0]; @@ -171,7 +177,8 @@ class srvinterface { if (!empty($ast_out[1]) && $ast_out[1] == 'develop') { $result["develop"] = $ast_out[1]; $res = 10; - if (base_convert($ast_out[3], 16, 10) == base_convert('702487a', 16, 10)) { /* !TODO!: This does not work as you might expect */ +// !TODO!: This does not work as you might expect + if (base_convert($ast_out[3], 16, 10) == base_convert('702487a', 16, 10)) { $result["vCode"] = 431; } if (base_convert($ast_out[3], 16, 10) >= "10403") { // new method, RevisionNum is incremental @@ -181,22 +188,17 @@ class srvinterface { return $result; } - /* !TODO!: Old Method */ - /* !TODO!: rename public - > private - private function sccp_version() { - $ast_out = $this->sccp_core_commands(array('cmd' => 'get_version')); - if (preg_match("/Release.*\(/", $ast_out['data'] , $matches)) { - $ast_out = substr($matches[0],9,-1); - return explode(' ', $ast_out); - } else { - return aray('unknown'); - } - } + private function sccp_version() { + $ast_out = $this->sccp_core_commands(array('cmd' => 'get_version')); + if (preg_match("/Release.*\(/", $ast_out['data'], $matches)) { + $ast_out = substr($matches[0], 9, -1); + return explode(' ', $ast_out); + } else { + return aray('unknown'); + } + } - /* !TODO!: Multiple Version functions (choose one :-) */ - /* !TODO!: private ? */ - - function getChanSCCPVersion() { + private function getChanSCCPVersion() { global $astman; $result = array(); if (!$astman) { diff --git a/Sccp_manager.inc/xmlinterface.class.php b/Sccp_manager.inc/xmlinterface.class.php index d3be152..c283a61 100644 --- a/Sccp_manager.inc/xmlinterface.class.php +++ b/Sccp_manager.inc/xmlinterface.class.php @@ -6,7 +6,10 @@ * * */ -/* !TODO!: Would you like to use my XSD file to check if the provided template file is a correct cisco cnf.xml file ? */ +/* !TODO!: -TODO-: Would you like to use my XSD file to check if the provided template file is a correct cisco cnf.xml file ? + * !TODO!: -TODO-: I just don't understand how to use it here.. To check the incoming pattern ? To check the result of my script ? + * !TODO!: -TODO-: The most correct variant is to generate xml based on XSD template. + */ namespace FreePBX\modules\Sccp_manager; diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index 26f744a..f935a70 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -34,7 +34,7 @@ $(document).ready(function () { snd_command = 'save_hardware'; } if ($('.fpbx-submit').data('id') == "dial_template") { - snd_command = 'save_dp_template'; + snd_command = 'save_dialplan_template'; } $.ajax({ @@ -69,7 +69,7 @@ $(document).ready(function () { snd_command = 'save_hardware'; } if ($('.fpbx-submit').data('id') == "dial_template") { - snd_command = 'save_dp_template'; + snd_command = 'save_dialplan_template'; } $.ajax({ type: 'POST', diff --git a/conf/Sccp.class.php b/conf/Sccp.class.php index d906895..99b8384 100644 --- a/conf/Sccp.class.php +++ b/conf/Sccp.class.php @@ -1,6 +1,9 @@ 'pin', "label" => 'label', "accountcode" => 'account', @@ -28,8 +31,7 @@ class Sccp extends \FreePBX\modules\Core\Driver { ); } - /* !TODO!: Not clear what the difference is between addDevice and addDevice1 */ - public function addDevice1($id, $settings) { +/* public function addDevice1($id, $settings) { $sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)'; $sth = $this->database->prepare($sql); $settings = is_array($settings)?$settings:array(); @@ -38,7 +40,7 @@ class Sccp extends \FreePBX\modules\Core\Driver { } return true; } - +*/ public function addDevice($id, $settings) { $add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description'); // print_r($_REQUEST); @@ -170,31 +172,31 @@ class Sccp extends \FreePBX\modules\Core\Driver { ); } -# !TODO!: Would it not be better to put this part in the view directory (MVC) ? +# !TODO!: -TODO-: Would it not be better to put this part in the view directory (MVC) ? No, This is a template for Freepbx. public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) { $section = _("Settings"); $category = "general"; $tmparr = array(); $tt = _("The maximum number of incoming calls on this line."); // $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidChannel); - /* !TODO!: Please change the default value for incominglimit to '6' or higher */ +// !TODO!: Please change the default value for incominglimit to '6' or higher $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '2', 'tt' => $tt, 'level' => 1); $tt = _("Asterisk context which this line will use to send and receive calls (Note: Only change this is you know what you are doing)."); $tmparr['context'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1); - /* !TODO!: Maybe completely remove support for old numberic callgroup/pickupgroup in favor of the named version ? */ +// !TODO!: -TODO-: Maybe completely remove support for old numberic callgroup/pickupgroup in favor of the named version ? See Sccp.class.php.v431 $tt = _("Phone call group (numeric only, example:1,3-4)"); $tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1); -# !TODO!: multiple allowed (not sure if that is implemented here) +// !TODO!: -TODO-: multiple allowed (not sure if that is implemented here). See Sccp.class.php.v431 $tt = _("Phone named call group (>asterisk-11)"); $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1); $tt = _("Sets the pickup group (numeric only, example:1,3-4) this line is a member of. Allows this line to pickup calls from remote phones which are in this callhroup."); $tmparr['pickupgroup'] = array('prompttext' => _('Pickup group id'),'value' => '', 'tt' => $tt, 'level' => 1); -# !TODO!: multiple allowed (not sure if that is implemented here) +// !TODO!: -TODO-: multiple allowed (not sure if that is implemented here). See Sccp.class.php.v431 $tt = _("Sets the named pickup name group this line is a member of. Allows this line to pickup calls from remote phones which are in this name callgroup (>asterisk-11)."); $tmparr['namedpickupgroup'] = array('prompttext' => _('Named Pickup Group'),'value' => '', 'tt' => $tt, 'level' => 1); @@ -237,7 +239,6 @@ class Sccp extends \FreePBX\modules\Core\Driver { $select[] = array( 'value' => '0x46', 'text' => 'Reminder Ring'); $select[] = array( 'value' => '0x47', 'text' => 'Precedence RingBank'); $select[] = array( 'value' => '0x48', 'text' => 'Pre-EmptionTone'); - /* !TODO!: I would remove the values below this line, except for 'No Tone' */ $select[] = array( 'value' => '0x67', 'text' => '2105 HZ'); $select[] = array( 'value' => '0x68', 'text' => '2600 HZ'); $select[] = array( 'value' => '0x69', 'text' => '440 HZ'); @@ -248,7 +249,8 @@ class Sccp extends \FreePBX\modules\Core\Driver { $select[] = array( 'value' => '0x7A', 'text' => 'MLPP Bpa'); $select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea'); $select[] = array( 'value' => '0x7C', 'text' => 'MLPP Upa'); - $select[] = array( 'value' => '0x7F', 'text' => 'No Tone'); +/* !TODO!: +TODO+: I would remove the values below this line, except for 'No Tone' */ +// $select[] = array( 'value' => '0x7F', 'text' => 'No Tone'); $select[] = array( 'value' => '0x80', 'text' => 'Meetme Greeting Tone'); $select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone'); $select[] = array( 'value' => '0x82', 'text' => 'Meetme Number Failed Tone'); @@ -265,7 +267,7 @@ class Sccp extends \FreePBX\modules\Core\Driver { $tt = _("Outside dialtone frequency (defaul 0x22)"); $tmparr['secondary_dialtone_tone'] = array('prompttext' => _('Secondary dialtone'), 'value' => '0x22', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'select'); -# !TODO!: is there no easier way to specify a boolean radio group ? +# !TODO!: -TODO-: is there no easier way to specify a boolean radio group ? No. unset($select); $select[] = array('value' => 'yes', 'text' => 'Yes'); $select[] = array('value' => 'no', 'text' => 'No'); @@ -283,8 +285,8 @@ class Sccp extends \FreePBX\modules\Core\Driver { $select[] = array('value' => 'reject', 'text' => 'Reject'); $select[] = array('value' => 'silent', 'text' => 'Silent'); $select[] = array('value' => 'UserDefined', 'text' => 'UserDefined'); -# !TODO!: The next entry should be "null/empty" (not UserDefined) -> to indicate the trie-state behaviour -# !TODO!: Userdefined is also a possible state, but it is not used or implemented (and it should not be implemented here, i think) +# !TODO!: -TODO-: The next entry should be "null/empty" (not UserDefined) -> to indicate the trie-state behaviour +# !TODO!: -TODO-: Userdefined is also a possible state, but it is not used or implemented (and it should not be implemented here, i think). See Sccp.class.php.v431, See Sccp.class.php - Old Style $tt = _("DND: How will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / UserDefined").'
'. _("UserDefined - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'
'. _("Reject - Usesr can only switch off and on (in reject/busy mode)").'
'. diff --git a/conf/Sccp.class.php.v431 b/conf/Sccp.class.php.v431 index 9ee4b67..960563d 100644 --- a/conf/Sccp.class.php.v431 +++ b/conf/Sccp.class.php.v431 @@ -1,21 +1,25 @@ 'pin', "label" => 'label', "accountcode" => 'account', "context" =>'context',"incominglimit"=>'incominglimit', - "callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup', +// "callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup', + 'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup', "transfer" => 'transfer', "echocancel" => 'echocancel', "language" => 'language', "description" => 'callerid', "cid_num" => 'cid_num', "cid_name" => 'label', "mailbox" => 'mailbox', "musicclass" => 'musicclass', "dnd" => 'dnd', "silencesuppression" => 'silencesuppression', - "secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone', - 'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup' + "secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone' ); public function __construct($freepbx) { @@ -34,6 +38,7 @@ class Sccp extends \FreePBX\modules\Core\Driver { "about" => "Sccp mysql class Base ver: 11.3, Sccp ver: 431" ); } +/* public function addDevice1($id, $settings) { $sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)'; $sth = $this->database->prepare($sql); @@ -43,7 +48,7 @@ class Sccp extends \FreePBX\modules\Core\Driver { } return true; } - +*/ public function addDevice($id, $settings) { $add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description','devinfo_mailbox'=>'mailbox'); // print_r($_REQUEST); @@ -146,7 +151,7 @@ class Sccp extends \FreePBX\modules\Core\Driver { return $tech; } - public function getNamedGroup() { + public function getNamedGroup() { $sql = "select namedcallgroup from sccpline group by namedcallgroup"; $sth = $this->database->prepare($sql); $result = array(); @@ -188,18 +193,18 @@ class Sccp extends \FreePBX\modules\Core\Driver { "value" => "from-internal", "flag" => $flag++ ), - "callgroup" => array( - "value" => "from-internal", - "flag" => $flag++ - ), +// "callgroup" => array( +// "value" => "from-internal", +// "flag" => $flag++ +// ), "namedcallgroup" => array( "value" => "", "flag" => $flag++ ), - "pickupgroup" => array( - "value" => "", - "flag" => $flag++ - ), +// "pickupgroup" => array( +// "value" => "", +// "flag" => $flag++ +// ), "namedpickupgroup" => array( "value" => "", "flag" => $flag++ @@ -261,9 +266,10 @@ class Sccp extends \FreePBX\modules\Core\Driver { $tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section); $tt = _("Asterisk context this device will send calls to. Only change this is you know what you are doing."); $tmparr['context'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1, 'section' => $section); - $tt = _("Phone call group callgroup=1,3-4"); - $tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section); - $tt = _("Sets the named caller groups this line is a member of (ast111) : "); +// $tt = _("Phone call group callgroup=1,3-4"); +// $tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section); + + $tt = _("Sets the named caller groups this line is a member of (ast111) : "); if (!empty($named_group['namedcallgroup'])) { foreach ($named_group['namedcallgroup'] as $val) { $tt .= $val. ', '; @@ -272,8 +278,8 @@ class Sccp extends \FreePBX\modules\Core\Driver { } $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section); // $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section, 'category' => 'general'); - $tt = _("Phone pickup group pickupgroup=1,3-4"); - $tmparr['pickupgroup'] = array('prompttext' => _('Pickup group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section); +// $tt = _("Phone pickup group pickupgroup=1,3-4"); +// $tmparr['pickupgroup'] = array('prompttext' => _('Pickup group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section); $tt = _("Name picapuroup : "); if (!empty($named_group['namedpickupgroup'])) { foreach ($named_group['namedpickupgroup'] as $val) { @@ -329,7 +335,8 @@ class Sccp extends \FreePBX\modules\Core\Driver { $select[] = array( 'value' => '0x7A', 'text' => 'MLPP Bpa'); $select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea'); $select[] = array( 'value' => '0x7C', 'text' => 'MLPP Upa'); - $select[] = array( 'value' => '0x7F', 'text' => 'No Tone'); +/* !TODO!: I would remove the values below this line, except for 'No Tone' */ +// $select[] = array( 'value' => '0x7F', 'text' => 'No Tone'); $select[] = array( 'value' => '0x80', 'text' => 'Meetme Greeting Tone'); $select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone'); $select[] = array( 'value' => '0x82', 'text' => 'Meetme Number Failed Tone'); diff --git a/uninstall.php b/uninstall.php index 6cc0836..c465fe2 100644 --- a/uninstall.php +++ b/uninstall.php @@ -4,7 +4,7 @@ /* !TODO!: In an ideal world this should roll back everything the install.php script did, except for what existed before install.php was run */ /* !TODO!: This would require the install.php to make a note of all the actions that were skipped and/or performed */ /* !TODO!: Might be a good idea to create a backup of the database before removing anything */ - +// !TODO!: -TODO-: I remove only that which is related to the Manager, it is in my opinion not a critical configuration information. This information is partially present in other files. if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } global $db; diff --git a/views/advserver.dialtemplate.php b/views/advserver.dialtemplate.php index ec6067b..6613835 100644 --- a/views/advserver.dialtemplate.php +++ b/views/advserver.dialtemplate.php @@ -5,8 +5,6 @@ * and open the template in the editor. */ // vim: set ai ts=4 sw=4 ft=phtml: -//print_r($this->get_DP_list()); -//print_r($this->get_DialPlan('dialplan')); ?>
diff --git a/views/server.device.php b/views/server.device.php index b8e17be..a697fc7 100644 --- a/views/server.device.php +++ b/views/server.device.php @@ -5,14 +5,17 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ +/* $data = 'none;'; -foreach ($this->get_DP_list() as $value) { +foreach ($this->get_DialPlanList() as $value) { $data .= $value['id'].';'; } if (strlen($data) >0 ){ $data = substr ($data,0,-1); } $this->sccpvalues['dial_template'] = array('keyword' => 'dial_template', 'data' => $data, 'type' => '10', 'seq' => '90'); + * + */ ?>
diff --git a/views/server.info.php b/views/server.info.php index 1c61bc6..38a39d3 100644 --- a/views/server.info.php +++ b/views/server.info.php @@ -7,12 +7,10 @@ // vim: set ai ts=4 sw=4 ft=phtml: // print_r($this->sccp_conf_init); // print_r($this->sccpvalues); -//$core = $this->srvinterface->getCoreSCCPVersion(); -//print_r($core); //print_r('

'); $driver = $this->FreePBX->Core->getAllDriversInfo(); -$core = $this->srvinterface->getChanSCCPVersion(); +$core = $this->srvinterface->getSCCPVersion(); $info = array(); $info['srvinterface'] = $this->srvinterface->info(); $info['extconfigs'] = $this->extconfigs->info();