diff --git a/!Readme.txt/RedialMenu.txt b/!Readme.txt/RedialMenu.txt
index 75cf3d1..ed91cc3 100644
--- a/!Readme.txt/RedialMenu.txt
+++ b/!Readme.txt/RedialMenu.txt
@@ -18,3 +18,5 @@ Then the placed calls list will include the status of the remote extension, like
PlacedCalls
Which does show numbers you can redial, but also include their current device state, so you know when they are currently busy. Note that the other phonebook entries will now also monitor the remove device state and show the current device state.
+
+Note: the hints for the extension need to be in the same context as the device/global context, for callLogBlfEnabled to work
diff --git a/!Readme.txt/bacgroundImage.txt b/!Readme.txt/backgroundImage.txt
similarity index 78%
rename from !Readme.txt/bacgroundImage.txt
rename to !Readme.txt/backgroundImage.txt
index d87c83f..bfa2b31 100644
--- a/!Readme.txt/bacgroundImage.txt
+++ b/!Readme.txt/backgroundImage.txt
@@ -12,7 +12,6 @@ Set background image server side
Background images can be set up server side in sccp.conf for most modern Cisco IP Phones by using a parameter in the device section. This image is pushed to the phone upon every restart.
-
[SEPXXXXXXXXX]
...
backgroundImage=http://PATH-TO-BACKGROUND-IMAGE/filename.png
@@ -26,12 +25,12 @@ Enable user to pick a custom background image
When a user is allowed to pick his own background image in the user settings (true in device section of the SEPXXXX.xml config file), the phone searches for the List.xml (case-sensitive) file in the following directories. Depending on the phone model, the required file properties are as follows:
Phone Model Image Size Thumbnail Size Directory
-7906 / 7911 95x34 23x8 /Desktops/95x34x1
-7941 / 7961 320x196 80x49 /Desktops/320x196x4
-7942 / 7962 320x196 80x49 /Desktops/320x196x4
-7945 / 7965 320x212 80x53 /Desktops/320x212x16
-7970 / 7971 320x212 80x53 /Desktops/320x212x12
-7975 320x216 80x53 /Desktops/320x216x16
+7906 / 7911 95x34 23x8 /Desktops/95x34x1
+7941 / 7961 320x196 80x49 /Desktops/320x196x4
+7942 / 7962 320x196 80x49 /Desktops/320x196x4
+7945 / 7965 320x212 80x53 /Desktops/320x212x16
+7970 / 7971 320x212 80x53 /Desktops/320x212x12
+7975 320x216 80x53 /Desktops/320x216x16
7985 800x600 not supported /Desktops/800x600x16
8941 / 8945 640x480 123x111 /Desktops/640x480x24
@@ -46,3 +45,13 @@ The Image file is used for the background of the phone display. An additional th
While the resolution is fix, the phones are able to reduce the color depth if the original image uses too many colors.
+Note: This can also be done using the SEP....cnf.xml file
+
+...
+
+ TFTP/HTTP/HTTPS URL
+ true/false
+
+1
+...
+
diff --git a/!Readme.txt/dialplan.txt b/!Readme.txt/dialplan.txt
index cb2cc13..11574bf 100644
--- a/!Readme.txt/dialplan.txt
+++ b/!Readme.txt/dialplan.txt
@@ -7,5 +7,5 @@
в Sccp_manager.class.php
// "sccpdialplan" => array(
// "name" => _("SCCP Dial Plan information"),
-// "page" => 'views/server.dialtemplet.php'
+// "page" => 'views/server.dialtemplate.php'
// )
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b25c15b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*~
diff --git a/README.md b/README.md
index 6bd94b0..e881b60 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ Make sure you have the following installed on your system:
- TFTP Server running under (recomended) /tftpboot/ [See our WIKI] (https://github.com/chan-sccp/chan-sccp/wiki/setup-tftp-service)
- You will need the phone settings templates. You can use the templates taken from the distribution "chan-sccp"
- sample: copy /usr/src/chan-sccp/conf/tftp/*.xml* /tftpboot/templets/
+ sample: copy /usr/src/chan-sccp/conf/tftp/*.xml* /tftpboot/templates/
- cofigure DHCP server [See our WIKI] (https://github.com/chan-sccp/chan-sccp/wiki/setup-dhcp-service)
diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php
index 3676476..a723ae2 100644
--- a/Sccp_manager.class.php
+++ b/Sccp_manager.class.php
@@ -15,22 +15,34 @@
* + Cisco Format Mac
* + Model Information
* + Device Right Menu
+
+
+
+
+
+
* + Dial Templates + Configuration
- * + Dial Templates in Global Configuration ( Enabled / Disabled ; default templet )
- * ? Dial Templates - Hoto IT Include in XML.Config ???????
- * - Dial Templates in device Configuration ( Enabled / inheret / Disabled ; templet )
+ * + Dial Templates in Global Configuration ( Enabled / Disabled ; default template )
+ * ? Dial Templates - Howto IT Include in XML.Config ???????
+ * - 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 fiture support in chan_sccp )
+ * + Change internal use Field to _Field (new feature in chan_sccp (added for Sccp_manager))
* + Delete phone XML
* + Change Installer ?? (test )
* - Auto Addons!
* + DND Mode
* + secondary_dialtone_digits = "" line config
* + secondary_dialtone_tone = 0x22 line config
- * - suport kvstore ?????
+ * - support kv-store ?????
* + Shared Line
* - bug Fix ...(K no w bug? no fix)
*
+ * * I think this file should be split in 3 parts (as in Model-View-Controller(MVC))
+ * * XML/Database Parts -> Model directory
+ * * Processing parts -> Controller directory
+ * * Ajax Handler Parts -> Controller directory
+ * * Result parts -> View directory
*/
namespace FreePBX\modules;
@@ -57,10 +69,12 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
public $sccp_conf_init = array();
public $sccpDefaults = array(
"servername" => 'VPBXSCCP',
- "bindaddr" => '0.0.0.0', "port" => '2000',
+ "bindaddr" => '0.0.0.0', "port" => '2000', # chan_sccp also supports ipv6
+ # bindaddr = "::" will support ipv6 and ipv4 at the same time
"deny" => '0.0.0.0/0.0.0.0',
- "permit" => '0.0.0.0/0.0.0.0',
- "dateformat" => 'D.M.Y',
+ "permit" => '0.0.0.0/0.0.0.0', # defaults to 'internal' which means:
+ # permit:127.0.0.0/255.0.0.0,permit:10.0.0.0/255.0.0.0,permit:172.0.0.0/255.224.0.0,permit:192.168.0.0/255.255.0.0"
+ "dateformat" => 'D.M.Y', # This is the german default format. Should be "D/M/Y" or "D/M/YA" instead
"disallow" => 'all', "allow" => 'alaw;ulaw',
"devicetable" => 'sccpdevice',
"linetable" => 'sccpline',
@@ -131,29 +145,23 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$this->db = $freepbx->Database;
$this->cnf_wr = \FreePBX::WriteConfig();
$this->cnf_read = \FreePBX::LoadConfig();
-
-
$this->v = new \Respect\Validation\Validator();
-
$this->getSccpSettingsDB(false); // Overwrite Exist
// $this->getSccpSetingINI(false); // get from sccep.ini
$this->init_sccp_path();
$this->initVarfromDefs();
$this->initTftpLang();
-
// Load Advanced Form Constuctor Data
if (file_exists(__DIR__ . '/views/sccpgeneral.xml')) {
$this->xml_data = simplexml_load_file(__DIR__ . '/views/sccpgeneral.xml');
$this->initVarfromXml(); // Overwrite Exist
}
-
}
/*
* Generate Input elements in Html Code from sccpgeneral.xml
*/
-
public function ShowGroup($grup_name, $heder_show, $form_prefix = 'sccp', $form_values = null) {
$htmlret = "";
if (empty($form_values)) {
@@ -176,7 +184,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
/*
* Load config vars from base array
*/
-
public function initVarfromDefs() {
foreach ($this->sccpDefaults as $key => $value) {
if (empty($this->sccpvalues[$key])) {
@@ -188,7 +195,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
/*
* Load config vars from xml
*/
-
public function initVarfromXml() {
if ((array) $this->xml_data) {
foreach ($this->xml_data->xpath('//page_group') as $item) {
@@ -390,7 +396,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$this->pagedata = array(
"general" => array(
"name" => _("SCCP Dial Plan information"),
- "page" => 'views/form.dptemplet.php'
+ "page" => 'views/form.dptemplate.php'
)
);
break;
@@ -406,7 +412,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
),
// "sccpdialplan" => array(
// "name" => _("SCCP Dial Plan information"),
-// "page" => 'views/server.dialtemplet.php'
+// "page" => 'views/server.dialtemplate.php'
// )
);
break;
@@ -513,7 +519,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
switch ($req) {
case 'savesettings':
case "save_hardware":
- case "save_dp_templet":
+ case "save_dp_template":
case "delete_hardware":
case "getPhoneGrid":
case "getExtensionGrid":
@@ -561,7 +567,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
return $this->save_hw_phone($request);
break;
- case "save_dp_templet":
+ case "save_dp_template":
$res = $this->save_DialPlant($request);
if (empty($res)) {
return array('status' => true, 'search' => '?display=sccp_adv', 'hash' => 'sccpdialplan');
@@ -626,11 +632,11 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
break;
case 'model_add':
$save_settings = array();
- $key_name = array('model', 'vendor', 'dns', 'buttons', 'loadimage', 'loadinformationid', 'nametemplet');
+ $key_name = array('model', 'vendor', 'dns', 'buttons', 'loadimage', 'loadinformationid', 'nametemplate');
$upd_mode = 'replace';
case 'model_update':
if ($request['command'] == 'model_update') {
- $key_name = array('model', 'loadimage', 'nametemplet');
+ $key_name = array('model', 'loadimage', 'nametemplate');
$upd_mode = 'update';
}
if (!empty($request['model'])) {
@@ -1577,10 +1583,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
}
}
if (!empty($this->sccppath["tftp_path"])) {
- $this->sccppath["tftp_templets"] = $this->sccppath["tftp_path"] . '/templets';
- if (!file_exists($this->sccppath["tftp_templets"])) {
- if (!mkdir($this->sccppath["tftp_templets"], 0777, true)) {
- die('Error create templet dir');
+ $this->sccppath["tftp_templates"] = $this->sccppath["tftp_path"] . '/templates';
+ if (!file_exists($this->sccppath["tftp_templates"])) {
+ if (!mkdir($this->sccppath["tftp_templates"], 0777, true)) {
+ die('Error create template dir');
}
}
}
@@ -1588,7 +1594,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$this->sccppath["tftp_DP"] = $this->sccppath["tftp_path"] . '/Dialplan';
if (!file_exists($this->sccppath["tftp_DP"])) {
if (!mkdir($this->sccppath["tftp_DP"], 0777, true)) {
- die('Error create DialPlan templet dir');
+ die('Error create DialPlan template dir');
}
}
}
@@ -1597,9 +1603,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
return;
}
- if (!file_exists($this->sccppath["tftp_templets"] . '/XMLDefault.cnf.xml_template')) {
+ if (!file_exists($this->sccppath["tftp_templates"] . '/XMLDefault.cnf.xml_template')) {
$src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/';
- $dst_path = $this->sccppath["tftp_templets"] . '/';
+ $dst_path = $this->sccppath["tftp_templates"] . '/';
foreach (glob($src_path . '*.*_template') as $filename) {
copy($filename, $dst_path . basename($filename));
}
@@ -1693,7 +1699,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$save_data = array();
$integer_msg = _("%s must be a non-negative integer");
$errors = array();
- foreach ($get_settings[$hdr_arprefix.'dialtemplete'] as $key => $value) {
+ foreach ($get_settings[$hdr_arprefix.'dialtemplatee'] as $key => $value) {
$xmlstr .= 'sccppath["tftp_path"] . '/XMLDefault.cnf.xml';
- $xml_templet = $this->sccppath["tftp_templets"] . '/XMLDefault.cnf.xml_template';
+ $xml_template = $this->sccppath["tftp_templates"] . '/XMLDefault.cnf.xml_template';
- if (file_exists($xml_templet)) {
- $xml_work = simplexml_load_file($xml_templet);
+ if (file_exists($xml_template)) {
+ $xml_work = simplexml_load_file($xml_template);
$xnode = &$xml_work->callManagerGroup->members;
@@ -1935,14 +1941,14 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
return false;
}
- if (!(empty($var_hw_config['nametemplet']))) {
- $xml_templet = $this->sccppath["tftp_templets"] . '/' . $var_hw_config['nametemplet'];
+ if (!(empty($var_hw_config['nametemplate']))) {
+ $xml_template = $this->sccppath["tftp_templates"] . '/' . $var_hw_config['nametemplate'];
} else {
- $xml_templet = $this->sccppath["tftp_templets"] . '/SEP0000000000.cnf.xml_79df_template';
+ $xml_template = $this->sccppath["tftp_templates"] . '/SEP0000000000.cnf.xml_79df_template';
}
$xml_name = $this->sccppath["tftp_path"] . '/' . $dev_id . '.cnf.xml';
- if (file_exists($xml_templet)) {
- $xml_work = simplexml_load_file($xml_templet);
+ if (file_exists($xml_template)) {
+ $xml_work = simplexml_load_file($xml_template);
/*
$node = $xml_work -> certHash;
if ( !empty($node)) {F
@@ -2076,7 +2082,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
// print_r($xml_work);
$xml_work->asXml($xml_name); // Save
} else {
- die('Error Hardware templete :' . $xml_templet . ' not found');
+ die('Error Hardware templatee :' . $xml_template . ' not found');
}
return time();
}
@@ -2167,7 +2173,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
break;
case "get_sccpdevice_byid":
- $sql = 'SELECT t1.*, types.dns, types.buttons, types.loadimage, types.nametemplet as nametemplet, '
+ $sql = 'SELECT t1.*, types.dns, types.buttons, types.loadimage, types.nametemplate as nametemplate, '
. 'addon.buttons as addon_buttons FROM sccpdevice AS t1 '
. 'LEFT JOIN sccpdevmodel as types ON t1.type=types.model '
. 'LEFT JOIN sccpdevmodel as addon ON t1.addon=addon.model WHERE name="' . $data['id'] . '";';
@@ -2207,7 +2213,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$file_ext = array('.loads', '.LOADS', '.sbn', '.SBN', '.bin', '.BIN');
$dir = $this->sccppath["tftp_path"];
- $dir_tepl = $this->sccppath["tftp_templets"];
+ $dir_tepl = $this->sccppath["tftp_templates"];
switch ($format_list) {
case "model":
$sel_inf = "model, vendor, dns, buttons";
@@ -2287,8 +2293,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
} else {
$raw_settings[$i]['validate'] = '-;';
}
- if (!empty($raw_settings[$i]['nametemplet'])) {
- $file = $dir_tepl . '/' . $raw_settings[$i]['nametemplet'];
+ if (!empty($raw_settings[$i]['nametemplate'])) {
+ $file = $dir_tepl . '/' . $raw_settings[$i]['nametemplate'];
if (file_exists($file)) {
$raw_settings[$i]['validate'] .= 'yes';
} else {
diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js
index d1ad65f..aac0c1c 100644
--- a/assets/js/sccp_manager.js
+++ b/assets/js/sccp_manager.js
@@ -33,8 +33,8 @@ $(document).ready(function () {
if ($('.fpbx-submit').data('id') == "hw_edit") {
snd_command = 'save_hardware';
}
- if ($('.fpbx-submit').data('id') == "dial_templet") {
- snd_command = 'save_dp_templet';
+ if ($('.fpbx-submit').data('id') == "dial_template") {
+ snd_command = 'save_dp_template';
}
$.ajax({
@@ -68,8 +68,8 @@ $(document).ready(function () {
if ($('.fpbx-submit').data('id') == "hw_edit") {
snd_command = 'save_hardware';
}
- if ($('.fpbx-submit').data('id') == "dial_templet") {
- snd_command = 'save_dp_templet';
+ if ($('.fpbx-submit').data('id') == "dial_template") {
+ snd_command = 'save_dp_template';
}
$.ajax({
type: 'POST',
@@ -386,7 +386,7 @@ $(document).ready(function () {
if ($(this).data('id') === 'model_add') {
var dev_cmd = 'model_add';
// var dev_fld = ["model","vendor","dns","buttons","loadimage","loadinformationid","validate","enabled"];
- var dev_fld = ["model", "vendor", "dns", "buttons", "loadimage", "loadinformationid", "nametemplet"];
+ var dev_fld = ["model", "vendor", "dns", "buttons", "loadimage", "loadinformationid", "nametemplate"];
datas = 'enabled=0' + '&';
for (var i = 0; i < dev_fld.length; i++) {
@@ -398,7 +398,7 @@ $(document).ready(function () {
}
if ($(this).data('id') === 'model_applay') {
var dev_cmd = 'model_update';
- var dev_fld = ["model", "loadimage", "nametemplet"];
+ var dev_fld = ["model", "loadimage", "nametemplate"];
datas = '';
for (var i = 0; i < dev_fld.length; i++) {
datas = datas + dev_fld[i] + '=' + $('#editd_' + dev_fld[i]).val() + '&';
diff --git a/conf/Sccp.class.php b/conf/Sccp.class.php
index a04c5fa..fadaecb 100644
--- a/conf/Sccp.class.php
+++ b/conf/Sccp.class.php
@@ -164,37 +164,41 @@ class Sccp extends \FreePBX\modules\Core\Driver {
);
}
+# ??? Would it not be better to put this part in the view directory (MVC) ?
public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) {
$section = _("Settings");
$category = "general";
$tmparr = array();
- $tt = _("The SCCP channel number for this port.");
+ $tt = _("The maximum number of incoming calls to this line.");
$tmparr['incominglimit'] = array('prompttext' => _('Line incoming limit'), 'value' => '2', 'tt' => $tt, 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidChannel);
- $tt = _("Asterisk context this device will send calls to. Only change this is you know what you are doing.");
+ $tt = _("Asterisk context this line will use send calls to/from (Note: Only change this is you know what you are doing).");
$tmparr['context'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1);
- $tt = _("Phone call group callgroup=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);
- $tt = _("Phone pickup group pickupgroup=1,3-4");
- $tmparr['namedcallgroup'] = array('prompttext' => _('Call group name'),'value' => '', 'tt' => $tt, 'level' => 1);
+# ??? multiple allowed (not sure if that is implemented here)
+ $tt = _("Phone named call group (>asterisk-11)");
+ $tmparr['namedcallgroup'] = array('prompttext' => _('Named Call Group'),'value' => '', 'tt' => $tt, 'level' => 1);
- $tt = _("sets the named caller groups this line is a member of (ast111)");
+ $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);
- $tt = _("Phone pincode");
- $tmparr['namedpickupgroup'] = array('prompttext' => _('Pickup group name'),'value' => '', 'tt' => $tt, 'level' => 1);
+# ??? multiple allowed (not sure if that is implemented here)
+ $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);
- $tt = _("Sets the named pickup groups this line is a member of (this phone can pickup calls from remote phones which are in this caller group (ast111)");
+ $tt = _("Phone pincode (Note used)");
$tmparr['pin'] = array('value' => '', 'tt' => $tt, 'level' => 1);
$tt = _("Digits to indicate an external line to user (secondary dialtone) Sample 9 or 8 (max 9 digits)");
$tmparr['secondary_dialtone_digits'] = array('prompttext' => _('Secondary dialtone digits'), 'value' => '', 'tt' => $tt, 'level' => 1);
- $tt = _("Outside dialtone frequency (defaul 0x22)");
+ $tt = _("Outside dialtone frequency (default 0x22)");
$tmparr['secondary_dialtone_tone'] = array('prompttext' => _('Secondary dialtone tone'), 'value' => '', 'tt' => $tt, 'level' => 1);
+# ??? is there no easier way to specify a boolean radio group ?
unset($select);
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
@@ -204,8 +208,8 @@ class Sccp extends \FreePBX\modules\Core\Driver {
unset($select);
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
- $tt = _("Echo calcel");
- $tmparr['echocancel'] = array('prompttext' => _('Echo calcel'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
+ $tt = _("Echo cancel");
+ $tmparr['echocancel'] = array('prompttext' => _('Echo cancel'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
unset($select);
$select[] = array('value' => 'off', 'text' => 'Off');
@@ -213,7 +217,9 @@ class Sccp extends \FreePBX\modules\Core\Driver {
$select[] = array('value' => 'silent', 'text' => 'Silent');
$select[] = array('value' => 'UserDefined', 'text' => 'UserDefined');
$tt = _("DND: Means how will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / UserDefined").'
'.
+# ??? The next entry should be "null/empty" (not UserDefined) -> to indicate the trie-state behaviour
_("UserDefined - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'
'.
+# ??? Userdefined is also a possible state, but it is not used or implemented (and it should not be implemented here, i think)
_("Reject - Usesr can only switch off and on (in reject/busy mode)").'
'.
_("Silent - Usesr can only switch off and on (in silent mode)");
$tmparr['dnd'] = array('prompttext' => _('DND'), 'value' => 'UserDefined', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
@@ -235,10 +241,8 @@ class Sccp extends \FreePBX\modules\Core\Driver {
$select[] = array('value' => $value, 'text' => _($value));
}
- $tt = _("Musik On Hold ");
- $tmparr['musicclass'] = array('prompttext' => _('Musik On Hold'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1);
-
-
+ $tt = _("Music On Hold");
+ $tmparr['musicclass'] = array('prompttext' => _('Music On Hold'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1);
$devopts = $tmparr;
return $devopts;
diff --git a/conf/sccpgeneral.xml b/conf/sccpgeneral.xml
index bd1f29a..448516e 100644
--- a/conf/sccpgeneral.xml
+++ b/conf/sccpgeneral.xml
@@ -485,7 +485,7 @@ and open the template in the editor. Base Version before all crash :-)
Music Class: Available MOH Classes. These are the MOH classes listed in your current server.
-
- dial_templet
+ dial_template
none
sccp-custom
@@ -892,10 +892,10 @@ and open the template in the editor. Base Version before all crash :-)
-
-
-
+
+
-
- dialtemplete_name
+ dialtemplate_name
form-control
@@ -903,10 +903,10 @@ and open the template in the editor. Base Version before all crash :-)
-
-
+
+
-
- dialtemplete
+ dialtemplate
*/10/*
title
diff --git a/conf/sccpgeneral.xml.v0 b/conf/sccpgeneral.xml.v0
index bb8f313..4db08ca 100644
--- a/conf/sccpgeneral.xml.v0
+++ b/conf/sccpgeneral.xml.v0
@@ -487,7 +487,7 @@ and open the template in the editor.
Music Class: Available MOH Classes. These are the MOH classes listed in your current server.
-
- dial_templet
+ dial_template
none
sccp-custom
@@ -894,10 +894,10 @@ and open the template in the editor.
-
- -
+
+
-
- dialtemplete_name
+ dialtemplate_name
form-control
@@ -905,10 +905,10 @@ and open the template in the editor.
-
-
+
+
-
- dialtemplete
+ dialtemplate
*/10/*
title
diff --git a/conf/sccpgeneral.xml.v11 b/conf/sccpgeneral.xml.v11
index cca276e..f380d7b 100644
--- a/conf/sccpgeneral.xml.v11
+++ b/conf/sccpgeneral.xml.v11
@@ -485,7 +485,7 @@ and open the template in the editor. Base Version before all crash :-)
Music Class: Available MOH Classes. These are the MOH classes listed in your current server.
-
- dial_templet
+ dial_template
none
sccp-custom
@@ -892,10 +892,10 @@ and open the template in the editor. Base Version before all crash :-)
-
- -
+
+
-
- dialtemplete_name
+ dialtemplate_name
form-control
@@ -903,8 +903,8 @@ and open the template in the editor. Base Version before all crash :-)
-
-
+
+
-
Help_id1
@@ -930,7 +930,7 @@ and open the template in the editor. Base Version before all crash :-)
-
- dialtemplete
+ dialtemplate
*/10/*
title
diff --git a/i18n/ru_RU/LC_MESSAGES/sccp_manager.po b/i18n/ru_RU/LC_MESSAGES/sccp_manager.po
index 7257167..00cd08e 100644
--- a/i18n/ru_RU/LC_MESSAGES/sccp_manager.po
+++ b/i18n/ru_RU/LC_MESSAGES/sccp_manager.po
@@ -840,7 +840,7 @@ msgid "Loadinformation ID"
msgstr "CiscoКод Модели"
#: views/server.model:
-msgid "Model templet"
+msgid "Model template"
msgstr "Шаблон насторек .xml_XXX_template"
#: views/server.model:
@@ -864,7 +864,7 @@ msgid "Load Information ID"
msgstr "CiscoКод Модели"
#: views/server.model:
-msgid "Model templet XML"
+msgid "Model template XML"
msgstr "Шаблон насторек .xml_XXX_template"
#: views/server.model:
diff --git a/i18n/sccp_manager.pot b/i18n/sccp_manager.pot
index 5dff382..2bff9d7 100644
--- a/i18n/sccp_manager.pot
+++ b/i18n/sccp_manager.pot
@@ -974,7 +974,7 @@ msgid "Loadinformation ID"
msgstr ""
#: views/server.model:
-msgid "Model templet"
+msgid "Model template"
msgstr ""
#: views/server.model:
@@ -998,7 +998,7 @@ msgid "Load Information ID"
msgstr ""
#: views/server.model:
-msgid "Model templet XML"
+msgid "Model template XML"
msgstr ""
#: views/server.model:
diff --git a/install.php b/install.php
index b3de5c6..13c781b 100644
--- a/install.php
+++ b/install.php
@@ -10,7 +10,7 @@ global $astman;
global $version;
$db_config_v0 = array('sccpdevmodel' => array('enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
- 'nametemplet' => array('create' => 'VARCHAR(50) NULL DEFAULT NULL'),
+ 'nametemplate' => array('create' => 'VARCHAR(50) NULL DEFAULT NULL'),
'loadinformationid' => array('create' => "VARCHAR(30) NULL DEFAULT NULL" )
),
'sccpdevice' => array(
@@ -60,7 +60,7 @@ $db_config_v0 = array('sccpdevmodel' => array('enabled' => array('create' => "IN
$db_config_v3 = array('sccpdevmodel' => array('enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
- 'nametemplet' => array('create' => 'VARCHAR(50) NULL DEFAULT NULL'),
+ 'nametemplate' => array('create' => 'VARCHAR(50) NULL DEFAULT NULL'),
'loadinformationid' => array('create' => "VARCHAR(30) NULL DEFAULT NULL" )
),
'sccpdevice' => array(
@@ -127,26 +127,16 @@ $autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENG
$table_req = array('sccpdevice', 'sccpline', 'buttonconfig');
-$sql = <<< END
- CREATE TABLE IF NOT EXISTS `sccpsettings` (
- `keyword` VARCHAR (50) NOT NULL default '',
- `data` VARCHAR (255) NOT NULL default '',
- `seq` TINYINT (1),
- `type` TINYINT (1) NOT NULL default '0',
- PRIMARY KEY (`keyword`,`seq`,`type`)
- )
-END;
-
$ss = FreePBX::create()->Sccp_manager;
-outn(_("checking for requery Sccp_manager table.."));
+outn(_("checking for Sccp_manager database tables.."));
foreach ($table_req as $value) {
$check = $db->getRow("SELECT 1 FROM `$value` LIMIT 0", DB_FETCHMODE_ASSOC);
if (DB::IsError($check)) {
// print_r("none, creating table :". $value);
- out(_("none, Can't fient table: " . $value));
- out(_("none, Plz. Open chai-sccp/conf directory to create DB scheme"));
- die("!!!! Instalation error. Can not find required ".$value." table !!!!!!\n");
+ out(_("none, Can't find table: " . $value));
+ out(_("none, Please goto the chan-sccp/conf directory and create the DB schema (See wiki)"));
+ die("!!!! Installation error: Can not find required ".$value." table !!!!!!\n");
// die_freepbx("!!!! Instalation error. Can not find required ".$value." table !!!!!!\n");
}
}
@@ -157,7 +147,7 @@ outn(_("checking Version : ").$version);
$dst = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/views';
if (fileowner($_SERVER['DOCUMENT_ROOT']) != fileowner($dst)){
- die('Plz Test permission run "amportal chown"');
+ die('Please (re-)check permissions by running "amportal chown"');
}
if (!empty($version)) {
@@ -172,56 +162,72 @@ if (!empty($version)) {
$ver_compatable = false;
die('Versin is not comapable');
}
- $ast_out = $astman->Command("sccp show version");
- $db_config = $db_config_v0;
- if (preg_match("/Release.*\(/", $ast_out['data'] , $matches)) {
- $ast_out = explode(' ', substr($matches[0],9,-1));
- $sccp_ver = 0;
- if ($ast_out[0] >= '4.3.0'){
- $sccp_ver = 1;
- }
- if (!empty($ast_out[1]) && $ast_out[1] == 'develop'){
- $sccp_ver = 10;
- if (!empty($ast_out[3])) {
- if (base_convert($ast_out[3],16,10) >= base_convert('702487a',16,10)){
- $sccp_ver += 1;
- $db_config = $db_config_v3;
- }
- }
- } else {
- $sccp_ver = 0;
- }
+// Should be replaced by a function to check the AMI:SCCPConfigMetaData
+// JSON: {"Name":"Chan-sccp-b","Branch":"issues/394_1","Version":"4.3.0","Revision":"8d9d74fM","ConfigRevision":"0","ConfigureEnabled": ["park","pickup","realtime","video","conferenence","dirtrfr","feature_monitor","functions","manager_events","devstate_feature","dynamic_speeddial","dynamic_speeddial_cid","experimental","debug"],"Segments":["general","device","line","softkey"]}
+$ast_out = $astman->Command("sccp show version");
+$db_config = $db_config_v0;
+if (preg_match("/Release.*\(/", $ast_out['data'] , $matches)) {
+ $ast_out = explode(' ', substr($matches[0],9,-1));
+ $sccp_ver = 0;
+ if ($ast_out[0] >= '4.3.0'){
+ $sccp_ver = 1;
}
+ if (!empty($ast_out[1]) && $ast_out[1] == 'develop'){
+ $sccp_ver = 10;
+ if (!empty($ast_out[3])) {
+ if (base_convert($ast_out[3],16,10) >= base_convert('702487a',16,10)){
+ $sccp_ver += 1;
+ $db_config = $db_config_v3;
+ }
+ }
+ } else {
+ $sccp_ver = 0;
+ }
+}
+
+
// test
// $sccp_ver = 0;
// $db_config = $db_config_v0;
// test
-
- out(_("none, creating table"));
- $check = $db->query($sql);
- if (db::IsError($check)) {
- die_freepbx("Can not create sccpdevmodel table\n");
- }
outn(_(" Sccp Version : ").$sccp_ver);
- $sql = "CREATE TABLE IF NOT EXISTS `sccpdevmodel` (
- `model` varchar(20) NOT NULL DEFAULT '',
- `vendor` varchar(40) DEFAULT '',
- `dns` int(2) DEFAULT '1',
- `buttons` int(2) DEFAULT '0',
- `loadimage` varchar(40) DEFAULT '',
- `loadinformationid` VARCHAR(30) NULL DEFAULT NULL,
- `enabled` INT(2) NULL DEFAULT '0',
- `nametemplet` VARCHAR(50) NULL DEFAULT NULL,
- PRIMARY KEY (`model`),
- KEY `model` (`model`)
+$sql = <<< END
+ CREATE TABLE IF NOT EXISTS `sccpsettings` (
+ `keyword` VARCHAR (50) NOT NULL default '',
+ `data` VARCHAR (255) NOT NULL default '',
+ `seq` TINYINT (1),
+ `type` TINYINT (1) NOT NULL default '0',
+ PRIMARY KEY (`keyword`,`seq`,`type`)
+ )
+END;
+
+ out(_("No sccpsettings table, creating table"));
+ $check = $db->query($sql);
+ if (db::IsError($check)) {
+ die_freepbx("Can not create sccpsettings table, error:$check\n");
+ }
+
+sql = <<< END
+ CREATE TABLE IF NOT EXISTS `sccpdevmodel` (
+ `model` varchar(20) NOT NULL DEFAULT '',
+ `vendor` varchar(40) DEFAULT '',
+ `dns` int(2) DEFAULT '1',
+ `buttons` int(2) DEFAULT '0',
+ `loadimage` varchar(40) DEFAULT '',
+ `loadinformationid` VARCHAR(30) NULL DEFAULT NULL,
+ `enabled` INT(2) NULL DEFAULT '0',
+ `nametemplate` VARCHAR(50) NULL DEFAULT NULL,
+ PRIMARY KEY (`model`),
+ KEY `model` (`model`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1";
+END;
$check = $db->query($sql);
if (db::IsError($check)) {
- die_freepbx("Can not create sccpsettings table\n");
+ die_freepbx("Can not create sccpdevmodel table, error:$check\n");
}
out(_("none, Modify DB schama"));
@@ -307,7 +313,7 @@ if (!empty($version)) {
out(_("none, Uptade Table Info"));
//$sql = "REPLACE INTO `sccpdevmodel` VALUES ('7925','CISCO',1,1,'',''),('7902','CISCO',1,1,'CP7902080002SCCP060817A','loadInformation30008'),('7905','CISCO',1,1,'CP7905080003SCCP070409A','loadInformation20000'),('7906','CISCO',1,1,'SCCP11.8-3-1S','loadInformation369'),('7910','CISCO',1,1,'P00405000700','loadInformation6'),('7911','CISCO',1,1,'SCCP11.8-3-1S','loadInformation307'),('7912','CISCO',1,1,'CP7912080003SCCP070409A','loadInformation30007'),('7914','CISCO',0,14,'S00105000300','loadInformation124'),('7920','CISCO',1,1,'cmterm_7920.4.0-03-02','loadInformation30002'),('7921','CISCO',1,1,'CP7921G-1.0.3','loadInformation365'),('7931','CISCO',1,1,'SCCP31.8-3-1S','loadInformation348'),('7936','CISCO',1,1,'cmterm_7936.3-3-13-0','loadInformation30019'),('7937','CISCO',1,1,'','loadInformation431'),('7940','CISCO',1,2,'P00308000500','loadInformation8'),('Digital Access+','CISCO',1,1,'D00303010033','loadInformation42'),('7941','CISCO',1,2,'P00308000500','loadInformation115'),('7941G-GE','CISCO',1,2,'P00308000500','loadInformation309'),('7942','CISCO',1,2,'P00308000500','loadInformation434'),('Digital Access','CISCO',1,1,'D001M022','loadInformation40'),('7945','CISCO',1,2,'P00308000500','loadInformation435'),('7960','CISCO',3,6,'P00308000500','loadInformation7'),('7961','CISCO',3,6,'P00308000500','loadInformation30018'),('7961G-GE','CISCO',3,6,'P00308000500','loadInformation308'),('7962','CISCO',3,6,'P00308000500','loadInformation404'),('7965','CISCO',3,6,'P00308000500','loadInformation436'),('7970','CISCO',3,8,'SCCP70.8-3-1S','loadInformation30006'),('7971','CISCO',3,8,'SCCP70.8-3-1S','loadInformation119'),('7975','CISCO',3,8,'SCCP70.8-3-1S','loadInformation437'),('7985','CISCO',3,8,'cmterm_7985.4-1-4-0','loadInformation302'),('ATA 186','CISCO',1,1,'ATA030203SCCP051201A','loadInformation12'),('IP Communicator','CISCO',1,1,'','loadInformation30016'),('12 SP','CISCO',1,1,'','loadInformation3'),('12 SP+','CISCO',1,1,'','loadInformation2'),('30 SP+','CISCO',1,1,'','loadInformation1'),('30 VIP','CISCO',1,1,'','loadInformation5'),('7914,7914','CISCO',0,28,'S00105000300','loadInformation124'),('7915','CISCO',0,14,'',''),('7916','CISCO',0,14,'',''),('7915,7915','CISCO',0,28,'',''),('7916,7916','CISCO',0,28,'',''),('CN622','MOTOROLA',1,1,'','loadInformation335'),('ICC','NOKIA',1,1,'',''),('E-Series','NOKIA',1,1,'',''),('3911','CISCO',1,1,'','loadInformation446'),('3951','CISCO',1,1,'','loadInformation412');";
- $sql = "REPLACE INTO `sccpdevmodel` (`model`, `vendor`, `dns`, `buttons`, `loadimage`, `loadinformationid`, `enabled`, `nametemplet`) VALUES ('12 SP', 'CISCO', 1, 1, '', 'loadInformation3', 0, NULL)," .
+ $sql = "REPLACE INTO `sccpdevmodel` (`model`, `vendor`, `dns`, `buttons`, `loadimage`, `loadinformationid`, `enabled`, `nametemplate`) VALUES ('12 SP', 'CISCO', 1, 1, '', 'loadInformation3', 0, NULL)," .
"('12 SP+', 'CISCO', 1, 1, '', 'loadInformation2', 0, NULL), ('30 SP+', 'CISCO', 1, 1, '', 'loadInformation1', 0, NULL), ('30 VIP', 'CISCO', 1, 1, '', 'loadInformation5', 0, NULL), ('3911', 'CISCO', 1, 1, '', 'loadInformation446', 0, NULL), ('3951', 'CISCO', 1, 1, '', 'loadInformation412', 0, ''), ('6901', 'CISCO', 1, 0, 'SCCP6901.9-2-1-a', 'loadInformation547', 0, NULL), ('6911', 'CISCO', 1, 0, 'SCCP6911.9-2-1-a', 'loadInformation548', 0, NULL), ('6921', 'CISCO', 1, 0, 'SCCP69xx.9-2-1-0', 'loadInformation496', 0, NULL), ('6941', 'CISCO', 1, 1, 'SCCP69xx.9-2-1-0', 'loadInformation495', 0, NULL), ('6945', 'CISCO', 1, 0, 'SCCP6945.9-2-1-0', 'loadInformation564', 0, NULL), ('6961', 'CISCO', 1, 0, 'SCCP69xx.9-2-1-0', 'loadInformation497', 0, NULL), ('7902', 'CISCO', 1, 1, 'CP7902080002SCCP060817A', 'loadInformation30008', 0, NULL), " .
"('7905', 'CISCO', 1, 1, 'CP7905080003SCCP070409A', 'loadInformation20000', 0, NULL), ('7906', 'CISCO', 1, 1, 'SCCP11.9-2-1S', 'loadInformation369', 1, 'SEP0000000000.cnf.xml_791x_template'), ('7910', 'CISCO', 1, 1, 'SCCP11.9-2-1S', 'loadInformation6', 1, 'SEP0000000000.cnf.xml_791x_template'), ('7911', 'CISCO', 1, 1, 'SCCP11.9-2-1S', 'loadInformation307', 1, 'SEP0000000000.cnf.xml_791x_template'), ('7912', 'CISCO', 1, 1, 'CP7912080004SCCP080108A', 'loadInformation30007', 0, NULL), ('7914', 'CISCO', 0, 14, 'S00105000400', 'loadInformation124', 1, NULL),('7914,7914', 'CISCO', 0, 28, 'S00105000400', 'loadInformation124', 1, NULL), ('7915', 'CISCO', 0, 24, 'B015-1-0-4', 'loadInformation227', 1, NULL), ('7915,7915', 'CISCO', 0, 48, 'B015-1-0-4', 'loadInformation228', 1, NULL), ('7916', 'CISCO', 0, 24, 'B015-1-0-4', 'loadInformation229', 1, NULL), " .
"('7916,7916', 'CISCO', 0, 48, 'B016-1-0-4', 'loadInformation230', 1, NULL), ('7920', 'CISCO', 1, 1, 'cmterm_7920.4.0-03-02', 'loadInformation30002', 0, NULL), ('7921', 'CISCO', 1, 1, 'CP7921G-1.4.1SR1', 'loadInformation365', 0, NULL),('7925', 'CISCO', 1, 6, 'CP7925G-1.4.1SR1', 'loadInformation484', 0, NULL), ('7926', 'CISCO', 1, 1, 'CP7926G-1.4.1SR1', 'loadInformation557', 0, NULL), ('7931', 'CISCO', 1, 34, 'SCCP31.9-2-1S', 'loadInformation348', 0, NULL), ('7935', 'CISCO', 1, 2, 'P00503021900', 'loadInformation9', 0, NULL), ('7936', 'CISCO', 1, 1, 'cmterm_7936.3-3-21-0', 'loadInformation30019', 0, NULL), ('7937', 'CISCO', 1, 1, 'apps37sccp.1-4-4-0', 'loadInformation431', 0, 'SEP0000000000.cnf.xml_7937_template'), ('7940', 'CISCO', 1, 2, 'P0030801SR02', 'loadInformation8', 1, 'SEP0000000000.cnf.xml_796x_template'), " .
@@ -352,7 +358,6 @@ if (!empty($version)) {
FROM sccpdevice
LEFT JOIN buttonconfig ON ( buttonconfig.device = sccpdevice.name )
GROUP BY sccpdevice.name;";
-
$sql_v0 = "CREATE OR REPLACE
ALGORITHM = MERGE
@@ -384,7 +389,6 @@ if (!empty($version)) {
if (DB::IsError($check)) {
die_freepbx("Can not modify sccpdevice table\n");
}
-
// $ss->save_submit($request);
// $ss->sccp_create_sccp_init();
diff --git a/module.xml b/module.xml
index 7159645..1e4405f 100644
--- a/module.xml
+++ b/module.xml
@@ -5,7 +5,7 @@
setup
SCCP Connectivity
Alex GP
- SCCP Phone and Extention Manager
+ SCCP Phone and Extension Manager
Server Config
System Parameters
diff --git a/uninstall.php b/uninstall.php
index c46c827..18ddcfa 100644
--- a/uninstall.php
+++ b/uninstall.php
@@ -16,13 +16,16 @@ if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
sql("DELETE FROM kvstore WHERE module = 'sccpsettings'");
sql("DELETE FROM kvstore WHERE module = 'Sccp_manager'");
}
+
+/* Comment: Maybe save in sccpsettings, if the chan_sccp tables already existed in the database or if they were created by install.php */
+/* So that you know if it is save to drop/delete them */
+
/* DROP VIEW `sccpdeviceconfig`;
DROP TABLE `buttonconfig`;
DROP TABLE `sccpdevice`;
DROP TABLE `sccpdevmodel`;
DROP TABLE `sccpline`;
DROP TABLE `sccpsettings`;
- *
*/
}
diff --git a/views/form.dptemplet.php b/views/form.dptemplate.php
similarity index 87%
rename from views/form.dptemplet.php
rename to views/form.dptemplate.php
index e5984e9..1d25a99 100644
--- a/views/form.dptemplet.php
+++ b/views/form.dptemplate.php
@@ -29,19 +29,19 @@ if ($dev_id != '*new*') {
$data_s .= ';';
}
$data_s = substr($data_s, 0, -1);
- $def_val['dialtemplete'] = array("keyword" => 'dialtemplete', "data" => $data_s, "seq" => "99");
+ $def_val['dialtemplatee'] = array("keyword" => 'dialtemplatee', "data" => $data_s, "seq" => "99");
}
?>
-
diff --git a/views/server.device.php b/views/server.device.php
index d71dba3..b8e17be 100644
--- a/views/server.device.php
+++ b/views/server.device.php
@@ -12,7 +12,7 @@ foreach ($this->get_DP_list() as $value) {
if (strlen($data) >0 ){
$data = substr ($data,0,-1);
}
- $this->sccpvalues['dial_templet'] = array('keyword' => 'dial_templet', 'data' => $data, 'type' => '10', 'seq' => '90');
+ $this->sccpvalues['dial_template'] = array('keyword' => 'dial_template', 'data' => $data, 'type' => '10', 'seq' => '90');
?>