Small changes in comments

This commit is contained in:
PhantomVl 2017-11-09 16:57:22 +03:00
parent e416b55654
commit 1ef2e443ee
10 changed files with 140 additions and 115 deletions

View file

@ -10,8 +10,7 @@
// http://chan-sccp-b.sourceforge.net/doc/_howto.xhtml#nf_adhoc_plar // 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/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 // 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 * + Cisco Format Mac
* + Model Information * + Model Information
* + Device Right Menu * + Device Right Menu
@ -519,27 +518,27 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
public function ajaxRequest($req, &$setting) { public function ajaxRequest($req, &$setting) {
switch ($req) { switch ($req) {
case 'savesettings': /* !TODO!: mixing snake case and camel case, chooose one :-) */ case 'savesettings':
case "save_hardware": case 'save_hardware':
case "save_dp_template": case 'save_dialplan_template':
case "delete_hardware": case 'delete_hardware':
case "getPhoneGrid": case 'getPhoneGrid':
case "getExtensionGrid": case 'getExtensionGrid':
case "getDeviceModel": case 'getDeviceModel':
case "getUserGrid": case 'getUserGrid':
case "getSoftKey": case 'getSoftKey':
case "getDialTemplate": case 'getDialTemplate':
case "create_hw_tftp": case 'create_hw_tftp':
case "reset_dev": case 'reset_dev':
case 'reset_token': case 'reset_token':
case "model_enabled": case 'model_enabled':
case "model_disabled": case 'model_disabled':
case "model_update": case 'model_update':
case "model_add": case 'model_add':
case "model_delete": case 'model_delete':
case "updateSoftKey": case 'updateSoftKey':
case "deleteSoftKey": case 'deleteSoftKey':
case "delete_dialplan": case 'delete_dialplan':
return true; return true;
break; break;
} }
@ -563,6 +562,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$res = $this->srvinterface->sccp_core_commands(array('cmd' => 'sccp_reload')); $res = $this->srvinterface->sccp_core_commands(array('cmd' => 'sccp_reload'));
$msg = 'Config Saved: ' . $res['Response'] . '. Info :' . $res['data']; $msg = 'Config Saved: ' . $res['Response'] . '. Info :' . $res['data'];
// needreload(); // 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); return array('status' => true, 'message' => $msg, 'reload' => true);
break; break;
case 'save_hardware': case 'save_hardware':
@ -573,23 +573,29 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
return $this->save_hw_phone($request); return $this->save_hw_phone($request);
break; 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); $res = $this->save_DialPlant($request);
if (empty($res)) { if (empty($res)) {
return array('status' => true, 'search' => '?display=sccp_adv', 'hash' => 'sccpdialplan'); return array('status' => true, 'search' => '?display=sccp_adv', 'hash' => 'sccpdialplan');
} else { } 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)); return array('status' => false, 'message' => print_r($res));
} }
break; break;
case "delete_dialplan": case 'delete_dialplan':
if (!empty($request['dialplan'])) { if (!empty($request['dialplan'])) {
$get_file = $request['dialplan']; $get_file = $request['dialplan'];
$res = $this->del_DialPlant($get_file); $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); return array('status' => true, 'message' => 'Dial Template has been deleted ! ', 'table_reload' => true);
} else { } 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)); return array('status' => false, 'message' => print_r($res));
} }
break; break;
// ------------------------------- Old deviece suport - In the development---
case 'delete_hardware': case 'delete_hardware':
if (!empty($request['idn'])) { if (!empty($request['idn'])) {
foreach ($request['idn'] as $idv) { 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)); $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 ! '); return array('status' => true, 'table_reload' => true, 'message' => 'HW is Delete ! ');
} }
break; break;
@ -613,7 +620,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
foreach ($models as $data) { foreach ($models as $data) {
$ver_id = $this->sccp_create_device_XML($data['name']); $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 . ')'); return array('status' => true, 'message' => 'Create new config files (version:' . $ver_id . ')');
break; 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); return array('status' => true, 'message' => 'Reset command send ' . $msg, 'reload' => true);
// } // }
break; break;
@ -710,7 +719,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
return $devices; return $devices;
break; break;
case "deleteSoftKey": case 'deleteSoftKey':
if (!empty($request['softkey'])) { if (!empty($request['softkey'])) {
$id_name = $request['softkey']; $id_name = $request['softkey'];
unset($this->sccp_conf_init[$id_name]); 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); return array('status' => true, 'table_reload' => true);
} }
break; break;
case "updateSoftKey": case 'updateSoftKey':
if (!empty($request['id'])) { if (!empty($request['id'])) {
$id_name = $request['id']; $id_name = $request['id'];
$this->sccp_conf_init[$id_name]['type'] = "softkeyset"; $this->sccp_conf_init[$id_name]['type'] = "softkeyset";
foreach ($this->extconfigs->getextConfig('keyset') as $keyl => $vall) { foreach ($this->extconfigs->getextConfig('keyset') as $keyl => $vall) {
if (!empty($request[$keyl])) { if (!empty($request[$keyl])) {
$this->sccp_conf_init[$id_name][$keyl] = $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->sccp_create_sccp_init();
@ -757,14 +768,14 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
} }
return $result; return $result;
break; break;
case "getExtensionGrid": case 'getExtensionGrid':
$result = $this->dbinterface->get_db_SccpTableData('SccpExtension'); $result = $this->dbinterface->get_db_SccpTableData('SccpExtension');
if (empty($result)) { if (empty($result)) {
$result = array(); $result = array();
} }
return $result; return $result;
break; break;
case "getPhoneGrid": case 'getPhoneGrid':
$result = $this->dbinterface->get_db_SccpTableData('SccpDevice'); $result = $this->dbinterface->get_db_SccpTableData('SccpDevice');
$staus = $this->srvinterface->sccp_get_active_device(); $staus = $this->srvinterface->sccp_get_active_device();
if (empty($result)) { if (empty($result)) {
@ -808,14 +819,15 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
} }
return $result; return $result;
break; break;
// ------------------------------- Old deviece suport - In the development---
case "getDialTemplate": case 'getDialTemplate':
$result = $this->get_DP_list(); /* !TODO!: please use DialPlan instead of DP */ $result = $this->get_DialPlanList();
if (empty($result)) { if (empty($result)) {
$result = array(); $result = array();
} }
return $result; return $result;
break; break;
// ------------------------------- Old deviece suport - In the development---
} }
} }
@ -1098,7 +1110,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
} }
return; return;
} }
/*
function sccp_get_keysetdata($name) { function sccp_get_keysetdata($name) {
if ($name == 'default') { if ($name == 'default') {
@ -1110,7 +1122,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$keysetData['name'] = ($keysetData['name'] ? $keysetData['name'] : $name); $keysetData['name'] = ($keysetData['name'] ? $keysetData['name'] : $name);
return $keysetData; return $keysetData;
} }
*/
/*
function sccp_edit_keyset($keysetData) { function sccp_edit_keyset($keysetData) {
global $amp_conf; global $amp_conf;
$key_name = array('onhook', 'connected', 'onhold', 'ringin', 'offhook', 'conntrans', 'digitsfoll', 'connconf', 'ringout', 'offhookfeat', 'onhint', 'onstealable'); $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']; $file_context = $keysetData['name'];
if ($file_context != 'default') { if ($file_context != 'default') {
$confDir = $amp_conf["ASTETCDIR"]; $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"; $confDir = "/etc/asterisk";
} }
$inputfile = "$confDir/sccp.conf"; $inputfile = $confDir."/sccp.conf";
if (!file_exists($inputfile)) { if (!file_exists($inputfile)) {
$sccpfile = file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/sccp.conf'); $sccpfile = file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/sccp.conf');
file_put_contents($inputfile, $sccpfile); file_put_contents($inputfile, $sccpfile);
} }
$handle = fopen($inputfile, "r"); $handle = fopen($inputfile, "r");
$file_context = "[$file_context]"; $file_context = "[".$file_context."]";
$sccpfile = ''; $sccpfile = '';
$conext_data = "$file_context ; Managed by sccp_manager\n"; $conext_data = $file_context." ; Managed by sccp_manager\n";
$conext_data .= "type=softkeyset\n"; $conext_data .= "type=softkeyset\n";
foreach ($keysetImplode as $field => $value) { foreach ($keysetImplode as $field => $value) {
echo($field); echo($field);
@ -1187,7 +1201,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
file_put_contents($inputfile, $sccpfile); file_put_contents($inputfile, $sccpfile);
return $sccpfile; return $sccpfile;
} }
*/
/*
function sccp_display_keyset($keysetData, $softkey, $option) { function sccp_display_keyset($keysetData, $softkey, $option) {
if ($keysetData['name'] == 'default') { if ($keysetData['name'] == 'default') {
$output = "<font size='+1'>"; $output = "<font size='+1'>";
@ -1206,7 +1221,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
} }
return $output; return $output;
} }
*/
public function getMyConfig($var = null, $id = "noid") { public function getMyConfig($var = null, $id = "noid") {
// $final = false; // $final = false;
switch ($var) { switch ($var) {
@ -1425,7 +1440,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
/* /*
* Check file paths and permissions * 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() { function init_sccp_path() {
global $db; global $db;
@ -1536,13 +1551,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
} }
/* /*
* * DialPlan
* *
*/ */
/* !TODO!: please use DialPlan instead of DP */ function get_DialPlanList() {
/* !TODO!: I think Dialplan stuff can be removed or at least commented out */
function get_DP_list() {
$dir = $this->sccppath["tftp_DP"] . '/*.xml'; $dir = $this->sccppath["tftp_DP"] . '/*.xml';
$base_len = strlen($this->sccppath["tftp_DP"]) + 1; $base_len = strlen($this->sccppath["tftp_DP"]) + 1;
$res = glob($dir); $res = glob($dir);

View file

@ -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; namespace FreePBX\modules\Sccp_manager;
@ -115,6 +115,9 @@ class srvinterface {
} }
/* Current not use */ /* 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() { public function sccp_list_hints() {
$ast_out = $this->sccp_core_commands(array('cmd' => 'get_hints')); $ast_out = $this->sccp_core_commands(array('cmd' => 'get_hints'));
@ -141,13 +144,11 @@ class srvinterface {
return $ast_key; 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() { public function get_compatible_sccp() {
$res = $this->getChanSCCPVersion(); $res = $this->getSCCPVersion();
if (empty($res)) {
$res = $this->getChanSCCPVersion();
}
if (empty($res)) { if (empty($res)) {
return 0; return 0;
} }
@ -159,10 +160,15 @@ class srvinterface {
// return $res["vCode"]; // return $res["vCode"];
} }
/* !TODO!: Multiple Version functions (choose one) */ public function getSCCPVersion() {
/* !TODO!: private ? */ $res = $this->getChanSCCPVersion();
if (empty($res)) {
$res = $this->getCoreSCCPVersion();
}
return $res;
}
function getCoreSCCPVersion() { private function getCoreSCCPVersion() {
$result = array(); $result = array();
$ast_out = $this->sccp_version(); $ast_out = $this->sccp_version();
$result["Version"] = $ast_out[0]; $result["Version"] = $ast_out[0];
@ -171,7 +177,8 @@ class srvinterface {
if (!empty($ast_out[1]) && $ast_out[1] == 'develop') { if (!empty($ast_out[1]) && $ast_out[1] == 'develop') {
$result["develop"] = $ast_out[1]; $result["develop"] = $ast_out[1];
$res = 10; $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; $result["vCode"] = 431;
} }
if (base_convert($ast_out[3], 16, 10) >= "10403") { // new method, RevisionNum is incremental if (base_convert($ast_out[3], 16, 10) >= "10403") { // new method, RevisionNum is incremental
@ -181,22 +188,17 @@ class srvinterface {
return $result; return $result;
} }
/* !TODO!: Old Method */
/* !TODO!: rename public - > private
private function sccp_version() { private function sccp_version() {
$ast_out = $this->sccp_core_commands(array('cmd' => 'get_version')); $ast_out = $this->sccp_core_commands(array('cmd' => 'get_version'));
if (preg_match("/Release.*\(/", $ast_out['data'] , $matches)) { if (preg_match("/Release.*\(/", $ast_out['data'], $matches)) {
$ast_out = substr($matches[0],9,-1); $ast_out = substr($matches[0], 9, -1);
return explode(' ', $ast_out); return explode(' ', $ast_out);
} else { } else {
return aray('unknown'); return aray('unknown');
} }
} }
/* !TODO!: Multiple Version functions (choose one :-) */ private function getChanSCCPVersion() {
/* !TODO!: private ? */
function getChanSCCPVersion() {
global $astman; global $astman;
$result = array(); $result = array();
if (!$astman) { if (!$astman) {

View file

@ -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; namespace FreePBX\modules\Sccp_manager;

View file

@ -34,7 +34,7 @@ $(document).ready(function () {
snd_command = 'save_hardware'; snd_command = 'save_hardware';
} }
if ($('.fpbx-submit').data('id') == "dial_template") { if ($('.fpbx-submit').data('id') == "dial_template") {
snd_command = 'save_dp_template'; snd_command = 'save_dialplan_template';
} }
$.ajax({ $.ajax({
@ -69,7 +69,7 @@ $(document).ready(function () {
snd_command = 'save_hardware'; snd_command = 'save_hardware';
} }
if ($('.fpbx-submit').data('id') == "dial_template") { if ($('.fpbx-submit').data('id') == "dial_template") {
snd_command = 'save_dp_template'; snd_command = 'save_dialplan_template';
} }
$.ajax({ $.ajax({
type: 'POST', type: 'POST',

View file

@ -1,6 +1,9 @@
<?php <?php
// vim: set ai ts=4 sw=4 ft=php: // vim: set ai ts=4 sw=4 ft=php:
// Version for SCCP Manager 13.0.0.A // Version for SCCP Manager 13.0.X
//
// Templete for Sccp Driver
//
namespace FreePBX\modules\Core\Drivers; namespace FreePBX\modules\Core\Drivers;
class Sccp extends \FreePBX\modules\Core\Driver { class Sccp extends \FreePBX\modules\Core\Driver {
private $data_fld = array("pin"=>'pin', "label" => 'label', "accountcode" => 'account', private $data_fld = array("pin"=>'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 (?,?,?,?)'; $sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)';
$sth = $this->database->prepare($sql); $sth = $this->database->prepare($sql);
$settings = is_array($settings)?$settings:array(); $settings = is_array($settings)?$settings:array();
@ -38,7 +40,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
} }
return true; return true;
} }
*/
public function addDevice($id, $settings) { public function addDevice($id, $settings) {
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description'); $add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description');
// print_r($_REQUEST); // 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) { public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) {
$section = _("Settings"); $section = _("Settings");
$category = "general"; $category = "general";
$tmparr = array(); $tmparr = array();
$tt = _("The maximum number of incoming calls on this line."); $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); // $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); $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)."); $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); $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)"); $tt = _("Phone call group (numeric only, example:1,3-4)");
$tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1); $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)"); $tt = _("Phone named call group (>asterisk-11)");
$tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1); $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."); $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); $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)."); $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); $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' => '0x46', 'text' => 'Reminder Ring');
$select[] = array( 'value' => '0x47', 'text' => 'Precedence RingBank'); $select[] = array( 'value' => '0x47', 'text' => 'Precedence RingBank');
$select[] = array( 'value' => '0x48', 'text' => 'Pre-EmptionTone'); $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' => '0x67', 'text' => '2105 HZ');
$select[] = array( 'value' => '0x68', 'text' => '2600 HZ'); $select[] = array( 'value' => '0x68', 'text' => '2600 HZ');
$select[] = array( 'value' => '0x69', 'text' => '440 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' => '0x7A', 'text' => 'MLPP Bpa');
$select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea'); $select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea');
$select[] = array( 'value' => '0x7C', 'text' => 'MLPP Upa'); $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' => '0x80', 'text' => 'Meetme Greeting Tone');
$select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone'); $select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone');
$select[] = array( 'value' => '0x82', 'text' => 'Meetme Number Failed 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)"); $tt = _("Outside dialtone frequency (defaul 0x22)");
$tmparr['secondary_dialtone_tone'] = array('prompttext' => _('Secondary dialtone'), 'value' => '0x22', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'select'); $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); unset($select);
$select[] = array('value' => 'yes', 'text' => 'Yes'); $select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No'); $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' => 'reject', 'text' => 'Reject');
$select[] = array('value' => 'silent', 'text' => 'Silent'); $select[] = array('value' => 'silent', 'text' => 'Silent');
$select[] = array('value' => 'UserDefined', 'text' => 'UserDefined'); $select[] = array('value' => 'UserDefined', 'text' => 'UserDefined');
# !TODO!: The next entry should be "null/empty" (not UserDefined) -> to indicate the trie-state behaviour # !TODO!: -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-: 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").'<br>'. $tt = _("DND: How will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / UserDefined").'<br>'.
_("UserDefined - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'<br>'. _("UserDefined - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'<br>'.
_("Reject - Usesr can only switch off and on (in reject/busy mode)").'<br>'. _("Reject - Usesr can only switch off and on (in reject/busy mode)").'<br>'.

View file

@ -1,21 +1,25 @@
<?php <?php
// vim: set ai ts=4 sw=4 ft=php: // vim: set ai ts=4 sw=4 ft=php:
// Version for SCCP Manager 13.0.0.A // Version for SCCP Manager 13.0.X
//
// Templete for Sccp Driver
//
namespace FreePBX\modules\Core\Drivers; namespace FreePBX\modules\Core\Drivers;
class Sccp extends \FreePBX\modules\Core\Driver { class Sccp extends \FreePBX\modules\Core\Driver {
public $version; public $version;
private $data_fld = array("pin"=>'pin', "label" => 'label', "accountcode" => 'account', private $data_fld = array("pin"=>'pin', "label" => 'label', "accountcode" => 'account',
"context" =>'context',"incominglimit"=>'incominglimit', "context" =>'context',"incominglimit"=>'incominglimit',
"callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup', // "callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup',
'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup',
"transfer" => 'transfer', "echocancel" => 'echocancel', "transfer" => 'transfer', "echocancel" => 'echocancel',
"language" => 'language', "description" => 'callerid', "language" => 'language', "description" => 'callerid',
"cid_num" => 'cid_num', "cid_name" => 'label', "mailbox" => 'mailbox', "cid_num" => 'cid_num', "cid_name" => 'label', "mailbox" => 'mailbox',
"musicclass" => 'musicclass', "musicclass" => 'musicclass',
"dnd" => 'dnd', "silencesuppression" => 'silencesuppression', "dnd" => 'dnd', "silencesuppression" => 'silencesuppression',
"secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone', "secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone'
'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup'
); );
public function __construct($freepbx) { 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" "about" => "Sccp mysql class Base ver: 11.3, Sccp ver: 431"
); );
} }
/*
public function addDevice1($id, $settings) { public function addDevice1($id, $settings) {
$sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)'; $sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)';
$sth = $this->database->prepare($sql); $sth = $this->database->prepare($sql);
@ -43,7 +48,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
} }
return true; return true;
} }
*/
public function addDevice($id, $settings) { public function addDevice($id, $settings) {
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description','devinfo_mailbox'=>'mailbox'); $add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description','devinfo_mailbox'=>'mailbox');
// print_r($_REQUEST); // print_r($_REQUEST);
@ -188,18 +193,18 @@ class Sccp extends \FreePBX\modules\Core\Driver {
"value" => "from-internal", "value" => "from-internal",
"flag" => $flag++ "flag" => $flag++
), ),
"callgroup" => array( // "callgroup" => array(
"value" => "from-internal", // "value" => "from-internal",
"flag" => $flag++ // "flag" => $flag++
), // ),
"namedcallgroup" => array( "namedcallgroup" => array(
"value" => "", "value" => "",
"flag" => $flag++ "flag" => $flag++
), ),
"pickupgroup" => array( // "pickupgroup" => array(
"value" => "", // "value" => "",
"flag" => $flag++ // "flag" => $flag++
), // ),
"namedpickupgroup" => array( "namedpickupgroup" => array(
"value" => "", "value" => "",
"flag" => $flag++ "flag" => $flag++
@ -261,8 +266,9 @@ class Sccp extends \FreePBX\modules\Core\Driver {
$tmparr['incominglimit'] = array('prompttext' => _('Incoming Call Limit'), 'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section); $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."); $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); $tmparr['context'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("Phone call group callgroup=1,3-4"); // $tt = _("Phone call group callgroup=1,3-4");
$tmparr['callgroup'] = array('prompttext' => _('Call group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section); // $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 = _("Sets the named caller groups this line is a member of (ast111) : ");
if (!empty($named_group['namedcallgroup'])) { if (!empty($named_group['namedcallgroup'])) {
foreach ($named_group['namedcallgroup'] as $val) { foreach ($named_group['namedcallgroup'] as $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);
// $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section, 'category' => 'general'); // $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section, 'category' => 'general');
$tt = _("Phone pickup group pickupgroup=1,3-4"); // $tt = _("Phone pickup group pickupgroup=1,3-4");
$tmparr['pickupgroup'] = array('prompttext' => _('Pickup group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section); // $tmparr['pickupgroup'] = array('prompttext' => _('Pickup group id'),'value' => '', 'tt' => $tt, 'level' => 1, 'section' => $section);
$tt = _("Name picapuroup : "); $tt = _("Name picapuroup : ");
if (!empty($named_group['namedpickupgroup'])) { if (!empty($named_group['namedpickupgroup'])) {
foreach ($named_group['namedpickupgroup'] as $val) { 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' => '0x7A', 'text' => 'MLPP Bpa');
$select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea'); $select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea');
$select[] = array( 'value' => '0x7C', 'text' => 'MLPP Upa'); $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' => '0x80', 'text' => 'Meetme Greeting Tone');
$select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone'); $select[] = array( 'value' => '0x81', 'text' => 'Meetme Number Invalid Tone');
$select[] = array( 'value' => '0x82', 'text' => 'Meetme Number Failed Tone'); $select[] = array( 'value' => '0x82', 'text' => 'Meetme Number Failed Tone');

View file

@ -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!: 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!: 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!: 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'); } if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
global $db; global $db;

View file

@ -5,8 +5,6 @@
* and open the template in the editor. * and open the template in the editor.
*/ */
// vim: set ai ts=4 sw=4 ft=phtml: // vim: set ai ts=4 sw=4 ft=phtml:
//print_r($this->get_DP_list());
//print_r($this->get_DialPlan('dialplan'));
?> ?>
<div class="fpbx-container container-fluid"> <div class="fpbx-container container-fluid">
<div class="row"> <div class="row">

View file

@ -5,14 +5,17 @@
* To change this template file, choose Tools | Templates * To change this template file, choose Tools | Templates
* and open the template in the editor. * and open the template in the editor.
*/ */
/*
$data = 'none;'; $data = 'none;';
foreach ($this->get_DP_list() as $value) { foreach ($this->get_DialPlanList() as $value) {
$data .= $value['id'].';'; $data .= $value['id'].';';
} }
if (strlen($data) >0 ){ if (strlen($data) >0 ){
$data = substr ($data,0,-1); $data = substr ($data,0,-1);
} }
$this->sccpvalues['dial_template'] = array('keyword' => 'dial_template', 'data' => $data, 'type' => '10', 'seq' => '90'); $this->sccpvalues['dial_template'] = array('keyword' => 'dial_template', 'data' => $data, 'type' => '10', 'seq' => '90');
*
*/
?> ?>
<form autocomplete="off" name="frm_device" id="frm_device" class="fpbx-submit" action="" method="post"> <form autocomplete="off" name="frm_device" id="frm_device" class="fpbx-submit" action="" method="post">
<input type="hidden" name="category" value="deviceform"> <input type="hidden" name="category" value="deviceform">

View file

@ -7,12 +7,10 @@
// vim: set ai ts=4 sw=4 ft=phtml: // vim: set ai ts=4 sw=4 ft=phtml:
// print_r($this->sccp_conf_init); // print_r($this->sccp_conf_init);
// print_r($this->sccpvalues); // print_r($this->sccpvalues);
//$core = $this->srvinterface->getCoreSCCPVersion();
//print_r($core);
//print_r('<br><br>'); //print_r('<br><br>');
$driver = $this->FreePBX->Core->getAllDriversInfo(); $driver = $this->FreePBX->Core->getAllDriversInfo();
$core = $this->srvinterface->getChanSCCPVersion(); $core = $this->srvinterface->getSCCPVersion();
$info = array(); $info = array();
$info['srvinterface'] = $this->srvinterface->info(); $info['srvinterface'] = $this->srvinterface->info();
$info['extconfigs'] = $this->extconfigs->info(); $info['extconfigs'] = $this->extconfigs->info();