diff --git a/README.md b/README.md
index 5c37d4b..be5b8ab 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
[](https://github.com/chan-sccp/chan-sccp/releases/latest)
[](https://github.com/chan-sccp/chan-sccp/wiki)
-This FreePBX module has been developed to help IT Staff with their Asterisk-Cisco infrastructure deployment,
+This module has been developed to help IT Staff with their Asterisk-Cisco infrastructure deployment,
providing easy provisioning and management of Cisco IP phones and extensions in a similar way to Cisco CallManager.
The idea of creating a module is borrowed from (https://github.com/Cynjut/SCCP_Manager), and was further developed and managed
by PhantomVl (https://github.com/PhantomVl/sccp_manager) who has been unavailable for some time. sccp_manager relies heavily
@@ -45,6 +45,9 @@ apt-get install PHP7.3-zip
- chan-sccp module 4.3.4 (or later) channel driver for Asterisk: [See our WIKI](https://github.com/chan-sccp/chan-sccp/wiki/Building-and-Installation-Guide)
- sccp_manager expects these configure flags to be set during compilation:
```./configure --enable-conference --enable-advanced-functions --enable-distributed-devicestate --enable-video```
+ - Creating mysql DB from sorce
+ ```mysql -u root asterisk < mysql-v5_enum.sql```
+
- TFTP Server running under (recommended) /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"
@@ -65,28 +68,30 @@ apt-get install PHP7.3-zip
How to install sccp_manager
-----
-1. Log in to FreePBX
-2. Go to Admin -> Module Admin
-3. Click Upload Modules.
-4. Enter one of the following urls:
+1. Creating mysql DB from source using
+```
+mysql -p asterisk < /usr/src/chan-sccp/conf/mysql-v5_enum.sql
+```
+2. Create a new tab and log in to FreePBX
+3. Go to Admin -> Module Admin
+4. Click Upload Modules.
+5. Enter one of the following urls:
Stable
```
-https://github.com/chan-sccp/sccp_manager/archive/refs/heads/Legacy.zip
+https://github.com/chan-sccp/sccp_manager/archive/refs/tags/Legacy-v2.tar.gz
```
-Develop.
-This version can be updated through module admin as modifications are made (pending fix by FreePbx)
-_This is development software and so may have issues_
+Develop. _This module can be updated through module admin as modifications are made, but may still have issues_
```
https://github.com/chan-sccp/sccp_manager/archive/refs/heads/develop.zip
```
-5. Click Download From Web.
-6. Click Manage Local Modules.
-7. Find and click SCCP Manager. Check Install. Click Process button.
-8. Confirm installation.
-9. Close Status window.
-10. Apply Config to FreePBX.
-11. Continue to [Using-SCCP_Manager-to-Manage-chan-sccp](https://github.com/chan-sccp/chan-sccp/wiki/Using-SCCP_Manager-to-Manage-chan-sccp)
+6. Click Download From Web.
+7. Click Manage Local Modules.
+8. Find and click SCCP Manager. Check Install. Click Process button.
+9. Confirm installation.
+10. Close Status window.
+11. Apply Config to FreePBX.
+12. Continue to [Using-SCCP_Manager-to-Manage-chan-sccp](https://github.com/chan-sccp/chan-sccp/wiki/Using-SCCP_Manager-to-Manage-chan-sccp)
### Module update to latest state
diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php
index 786536a..00fcc80 100644
--- a/Sccp_manager.class.php
+++ b/Sccp_manager.class.php
@@ -140,6 +140,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
}
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting(); // Overwrite Exist
+// $this->getSccpSetingINI(false); // get from sccep.ini
$this->initializeSccpPath();
$this->initVarfromDefs();
$this->initTftpLang();
@@ -163,10 +164,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$this->initVarfromXml(); // Overwrite Exist
}
- //if (get_class($freepbx) === 'FreePBX') {
+ if (get_class($freepbx) === 'FreePBX') {
// only save settings when building a new FreePBX object
$this->saveSccpSettings();
- //}
+ }
}
/*
@@ -201,10 +202,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$this->sccpvalues[$key] = array('keyword' => $key, 'data' => $value, 'type' => '0', 'seq' => '0');
}
}
- // Check timezone has not been changed in FreePBX and update if has
- if ($this->sccpvalues['ntp_timezone'] != \date_default_timezone_get()) {
- $this->sccpvalues['ntp_timezone'] = array('keyword' => 'ntp_timezone', 'seq'=>95, 'type' => 2, 'data' => \date_default_timezone_get());
- }
}
/*
@@ -569,7 +566,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$db_field = $this->dbinterface->HWextension_db_SccpTableData("get_columns_sccpdevice");
$hw_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid'];
$hw_type = (empty($get_settings['sccp_device_typeid'])) ? 'sccpdevice' : $get_settings['sccp_device_typeid'];
- $update_hw = ($hw_id == 'new') ? 'add' : 'clear'; // Possible values are delete, replace, add, clear.
+ $update_hw = ($hw_id == 'new') ? 'update' : 'clear';
$hw_prefix = 'SEP';
if (!empty($get_settings[$hdr_prefix . 'type'])) {
$value = $get_settings[$hdr_prefix . 'type'];
@@ -765,9 +762,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
case 'sccp_ntp_timezone':
$tz_id = $value;
- $TZdata = $this->extconfigs->getextConfig('sccp_timezone', $tz_id);
+ $TZdata = $this->extconfigs->getextConfig('sccp_timezone_offset', $tz_id);
if (!empty($TZdata)) {
- $value = $TZdata['offset']/60;
+ $value = ($TZdata / 60);
if (!($this->sccpvalues['tzoffset']['data'] == $value)) {
$save_settings[] = array('keyword' => 'tzoffset', 'data' => $value,
'seq' => '98',
@@ -777,6 +774,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
break;
}
}
+
if (!empty($save_settings)) {
$this->saveSccpSettings($save_settings);
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting();
@@ -1071,7 +1069,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
}
$driver = $this->FreePBX->Core->getAllDriversInfo();
- // Below is always set to replace; good for Develop, but needs to be updated for release
$sccp_driver_replace = '';
if (empty($driver['sccp'])) {
$sccp_driver_replace = 'yes';
@@ -1087,7 +1084,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$this->sccpvalues['sccp_compatible'] = array('keyword' => 'sccp_compatible', 'data' => $ver_id, 'type' => '1', 'seq' => '99');
$this->sccppath = $this->extconfigs->validate_init_path($confDir, $this->sccpvalues, $sccp_driver_replace);
- $driver = $this->FreePBX->Core->getAllDriversInfo(); // Check that Sccp Driver has been updated by above
+ $driver = $this->FreePBX->Core->getAllDriversInfo(); // ??????
$read_config = $this->cnf_read->getConfig('sccp.conf');
$this->sccp_conf_init['general'] = $read_config['general'];
@@ -1182,7 +1179,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$buton_list = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial'));
}
if (empty($buton_list)) {
- return array('Response' => ' 0 buttons found ', 'data' => '');
+ return array('Response' => ' Found 0 device ', 'data' => '');
}
$copy_fld = array('ref', 'reftype', 'instance', 'buttontype');
$user_list = $user_list = $this->dbinterface->get_db_SccpTableByID("SccpExtension", array(), 'name');
diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js
index 1189908..f169511 100644
--- a/assets/js/sccp_manager.js
+++ b/assets/js/sccp_manager.js
@@ -25,7 +25,37 @@ $(document).ready(function () {
}
});
- // ajaxsubmit2 is "Save and continue" - saves form data and stays on form
+ /*
+ $('#ajaxbackup').on('click', function (e) {
+ var vdata = '';
+ var snd_command = 'backupsettings';
+ $('.fpbx-submit').each(function () {
+ vdata = vdata + $(this).serialize() + '&';
+ });
+
+ $.ajax({
+ type: 'POST',
+ url: 'ajax.php?module=sccp_manager&command=' + snd_command,
+ data: vdata,
+ success: function (data) {
+ if (data.status === true) {
+ if (data.message) {
+ alert(data.message);
+ } else {
+ alert('Data Save');
+ }
+ } else {
+ if (Array.isArray(data.message)) {
+ data.message.forEach(function (entry) {
+ fpbxToast(entry, 'error', 'error');
+ });
+ }
+ }
+ }
+ });
+
+ });
+ */
$('#ajaxsubmit2').on('click', function (e) {
var vdata = '';
var snd_command = 'savesettings';
@@ -55,7 +85,7 @@ $(document).ready(function () {
if (data.message) {
bs_alert(data.message,data.status);
} else {
- fpbxToast(_('Data saved'),_('Data saved'), 'success');
+ bs_alert('Data Save',data.status);
}
} else {
bs_alert(data.message,data.status);
@@ -63,7 +93,7 @@ $(document).ready(function () {
}
});
});
- // ajaxsubmit is save and close form
+
$('#ajaxsubmit').on('click', function (e) {
var vdata = '';
var snd_command = 'savesettings';
@@ -88,6 +118,9 @@ $(document).ready(function () {
data: vdata,
success: function (data) {
if (data.status === true) {
+ if (data.message) {
+ var old_style = bs_alert(data.message, data.status, data.reload);
+ }
if (data.table_reload === true) {
$('table').bootstrapTable('refresh');
}
@@ -103,12 +136,9 @@ $(document).ready(function () {
if (data.search != null) {
location.search = data.search;
}
- if (data.message) {
- fpbxToast(_('Configuration saved. Reloading Module'),_('Configuration saved'), 'success');
- if (data.reload === true) {
- //Need setTimout or reload will kill Toast
- setTimeout(function(){location.reload();},500);
- }
+// if (data.reload === true ) {
+ if (data.reload === true && old_style ===true ) {
+ location.reload();
}
} else {
bs_alert(data.message,data.status);
@@ -153,23 +183,23 @@ $(document).ready(function () {
}
// console.log("delete : " + data);
if (dev_cmd != '') {
- if (confirm(_('Are you sure you wish to delete "' + dev_id.toString().toUpperCase() + '" information?'))) {
+ if (confirm(_('Are you sure you wish to delete "' + dev_id.toString().toUpperCase() + '" inormation ?'))) {
$.ajax({
type: 'POST',
url: 'ajax.php?module=sccp_manager&command=' + dev_cmd,
command: dev_cmd,
data: ext_data,
success: function (data) {
+// console.log(data);
if (data.status === true) {
+ if (data.message) {
+ var old_style = bs_alert(data.message, data.status, data.reload);
+ }
if (data.table_reload === true) {
$('table').bootstrapTable('refresh');
}
- if (data.message) {
- fpbxToast(data.message,_('Operation Result'), 'success');
- if (data.reload === true) {
- //Need setTimout or reload will kill Toast
- setTimeout(function(){location.reload();},500);
- }
+ if (data.reload === true && old_style === true ) {
+ location.reload();
}
} else {
bs_alert(data.message,data.status);
@@ -580,13 +610,13 @@ $(document).ready(function () {
var i = 0;
var conf_msg = '??????';
if ($(this).data('id') === 'reset_dev') {
- conf_msg = 'Reset ALL devices ?';
+ conf_msg = 'Reset All device ?';
}
if ($(this).data('id') === 'reset_token') {
- conf_msg = 'Reset Token on ALL devices ?';
+ conf_msg = 'Reset Token on All device ?';
}
if ($(this).data('id') === 'update_button_label') {
- conf_msg = 'Update Button Labels on ALL devices ?';
+ conf_msg = 'Update Butons Labels on All device ?';
}
$('#table-sccp').bootstrapTable('getSelections').forEach(function (entry) {
datas = datas + 'name[' + i + ']=' + entry['name'] + '&';
@@ -615,24 +645,24 @@ $(document).ready(function () {
success: function (data) {
// console.log(data);
if (data.status === true) {
+ if (data.message) {
+ var old_style = bs_alert(data.message, data.status,data.reload);
+ }
if (data.table_reload === true) {
$('table').bootstrapTable('refresh');
}
- if (data.message) {
- fpbxToast(data.message,_('Operation Result'), 'success');
- if (data.reload === true) {
- //Need setTimout or reload will kill Toast
- setTimeout(function(){location.reload();},500);
- }
+ if (data.reload === true && old_style === true) {
+ location.reload();
}
} else {
if (Array.isArray(data.message)) {
data.message.forEach(function (entry) {
- fpbxToast(data.message[1],_('Error Result'), 'warning');
+ bs_alert(entry,data.status);
+ //fpbxToast(entry, 'error', 'error');
});
} else {
if (data.message) {
- fpbxToast(data.message,_('Error Result'), 'warning');
+ bs_alert(data.message,data.status);
} else {
if (data) {
bs_alert(data,data.status);
diff --git a/conf/Sccp.class.php b/conf/Sccp.class.php
new file mode 100644
index 0000000..d1851cb
--- /dev/null
+++ b/conf/Sccp.class.php
@@ -0,0 +1,319 @@
+'pin', "label" => 'label', "accountcode" => 'account',
+ "context" =>'lcontext',"incominglimit"=>'incominglimit',
+ "callgroup"=>'callgroup',"pickupgroup"=>'pickupgroup',
+ "transfer" => 'transfer', "echocancel" => 'echocancel',
+ "language" => 'language', "description" => 'callerid',
+ "cid_num" => 'cid_num', "cid_name" => 'label', "mailbox" => 'description',
+ "musicclass" => 'musicclass',
+ "dnd" => 'dnd', "silencesuppression" => 'silencesuppression',
+ "secondary_dialtone_digits" => 'secondary_dialtone_digits', "secondary_dialtone_tone" => 'secondary_dialtone_tone',
+ 'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup'
+ );
+
+ public function getInfo() {
+ return array(
+ "rawName" => "sccp",
+ "hardware" => "sccp_custom",
+ "prettyName" => _("Sccp Custom Driver"),
+ "shortName" => "SCCP",
+ "description" => _("Sccp Device"),
+ "Version" => "11.4",
+ "about" => "Sccp mysql class Base ver: 11.3, Sccp ver: default"
+
+ );
+ }
+
+/* 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();
+ foreach($settings as $key => $setting) {
+ $sth->execute(array($id,$key,$setting['value'],$setting['flag']));
+ }
+ return true;
+ }
+*/
+ public function addDevice($id, $settings) {
+ $add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description');
+// print_r($_REQUEST);
+// echo '
';
+// die(print_r($settings));
+ $settings['cid_num']['value']='';
+ if (isset($_REQUEST)){
+ foreach($add_fld as $key => $val) {
+ if (!empty($_REQUEST[$key])){
+ $settings[$val]['value'] = $_REQUEST[$key];
+ }
+ }
+ }
+ if (empty($settings['cid_num']['value'])) {
+ $settings['cid_num']['value']= $id;
+ }
+ $sql = 'INSERT INTO sccpline (name';
+ $sqlv = 'values ("'.$id.'"';
+ foreach($this->data_fld as $key => $val) {
+ if (!empty($settings[$val]) ) {
+ if (!empty($settings[$val]['value'])){
+ $sql .= ', '.$key;
+ $sqlv .= ", '".$settings[$val]['value']."' ";
+ }
+ }
+ }
+ $sql .= ") ".$sqlv.");";
+ $sth = $this->database->prepare($sql);
+ $sth->execute();
+ return true;
+ }
+
+ public function delDevice($id) {
+ $sql = "DELETE FROM sccpline WHERE name = ?";
+ $sth = $this->database->prepare($sql);
+ $sth->execute(array($id));
+ return true;
+ }
+
+
+ public function getDevice($id) {
+ $sccp_line = array();
+// $sql = "SELECT name as id, name as name";
+ $sql = "SELECT name as id, name as name ";
+ foreach($this->data_fld as $key => $val) {
+ $sql .= ',`'. $key .'` as '.$val;
+ }
+ $sql .= " FROM sccpline WHERE name = ?";
+ $sth = $this->database->prepare($sql);
+ $result = array();
+ $tech = array();
+ try {
+ $sth->execute(array($id));
+ $result = $sth->fetch(\PDO::FETCH_ASSOC);
+ $tech = $result;
+ $tech['dial']='SCCP/'.$id;
+ } catch(\Exception $e) {}
+
+ return $tech;
+ }
+
+ public function getDefaultDeviceSettings($id, $displayname, &$flag) {
+ $dial = 'SCCP';
+ $settings = array(
+ "pin" => array(
+ "value" => "",
+ "flag" => $flag++
+ ),
+ "incominglimit" => array(
+ "value" => "",
+ "flag" => $flag++
+ ),
+ "lcontext" => array(
+ "value" => "from-internal",
+ "flag" => $flag++
+ ),
+ "callgroup" => array(
+ "value" => "",
+ "flag" => $flag++
+ ),
+ "namedcallgroup" => array(
+ "value" => "",
+ "flag" => $flag++
+ ),
+ "pickupgroup" => array(
+ "value" => "",
+ "flag" => $flag++
+ ),
+ "namedpickupgroup" => array(
+ "value" => "",
+ "flag" => $flag++
+ ),
+ "transfer" => array(
+ "value" => "yes",
+ "flag" => $flag++
+ ),
+ "adhocNumber" => array(
+ "value" => "",
+ "flag" => $flag++
+ ),
+ "echocancel" => array(
+ "value" => "no",
+ "flag" => $flag++
+ ),
+ "dnd" => array(
+ "value" => "UserDefined",
+ "flag" => $flag++
+ ),
+ "silencesuppression" => array(
+ "value" => "no",
+ "flag" => $flag++
+ ),
+ "secondary_dialtone_digits" => array(
+ "value" => "9",
+ "flag" => $flag++
+ ),
+ "secondary_dialtone_tone" => array(
+ "value" => "0x22",
+ "flag" => $flag++
+ ),
+ "musicclass" => array(
+ "value" => "default",
+ "flag" => $flag++
+ ),
+ );
+ return array(
+ "dial" => $dial,
+ "settings" => $settings
+ );
+ }
+
+# !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
+ $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['lcontext'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1);
+
+// !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!: -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!: -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);
+
+ $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);
+
+ unset($select);
+ $select[] = array( 'value' => '0x21', 'text' => 'Inside Dial Tone');
+ $select[] = array( 'value' => '0x22', 'text' => 'Outside Dial Tone');
+ $select[] = array( 'value' => '0x23', 'text' => 'Line Busy Tone');
+ $select[] = array( 'value' => '0x24', 'text' => 'Alerting Tone');
+ $select[] = array( 'value' => '0x25', 'text' => 'Reorder Tone');
+ $select[] = array( 'value' => '0x26', 'text' => 'Recorder Warning Tone');
+ $select[] = array( 'value' => '0x27', 'text' => 'Recorder Detected Tone');
+ $select[] = array( 'value' => '0x28', 'text' => 'Reverting Tone');
+ $select[] = array( 'value' => '0x29', 'text' => 'Receiver OffHook Tone');
+ $select[] = array( 'value' => '0x2A', 'text' => 'Partial Dial Tone');
+ $select[] = array( 'value' => '0x2B', 'text' => 'No Such Number Tone');
+ $select[] = array( 'value' => '0x2C', 'text' => 'Busy Verification Tone');
+ $select[] = array( 'value' => '0x2D', 'text' => 'Call Waiting Tone');
+ $select[] = array( 'value' => '0x2E', 'text' => 'Confirmation Tone');
+ $select[] = array( 'value' => '0x2F', 'text' => 'Camp On Indication Tone');
+ $select[] = array( 'value' => '0x30', 'text' => 'Recall Dial Tone');
+ $select[] = array( 'value' => '0x31', 'text' => 'Zip Zip');
+ $select[] = array( 'value' => '0x32', 'text' => 'Zip');
+ $select[] = array( 'value' => '0x33', 'text' => 'Beep Bonk');
+ $select[] = array( 'value' => '0x34', 'text' => 'Music Tone');
+ $select[] = array( 'value' => '0x35', 'text' => 'Hold Tone');
+ $select[] = array( 'value' => '0x36', 'text' => 'Test Tone');
+ $select[] = array( 'value' => '0x37', 'text' => 'DT Monitor Warning Tone');
+ $select[] = array( 'value' => '0x40', 'text' => 'Add Call Waiting');
+ $select[] = array( 'value' => '0x41', 'text' => 'Priority Call Wait');
+ $select[] = array( 'value' => '0x42', 'text' => 'Recall Dial');
+ $select[] = array( 'value' => '0x43', 'text' => 'Barg In');
+ $select[] = array( 'value' => '0x44', 'text' => 'Distinct Alert');
+ $select[] = array( 'value' => '0x45', 'text' => 'Priority Alert');
+ $select[] = array( 'value' => '0x46', 'text' => 'Reminder Ring');
+ $select[] = array( 'value' => '0x47', 'text' => 'Precedence RingBank');
+ $select[] = array( 'value' => '0x48', 'text' => 'Pre-EmptionTone');
+ $select[] = array( 'value' => '0x67', 'text' => '2105 HZ');
+ $select[] = array( 'value' => '0x68', 'text' => '2600 HZ');
+ $select[] = array( 'value' => '0x69', 'text' => '440 HZ');
+ $select[] = array( 'value' => '0x6A', 'text' => '300 HZ');
+ $select[] = array( 'value' => '0x77', 'text' => 'MLPP Pala');
+ $select[] = array( 'value' => '0x78', 'text' => 'MLPP Ica');
+ $select[] = array( 'value' => '0x79', 'text' => 'MLPP Vca');
+ $select[] = array( 'value' => '0x7A', 'text' => 'MLPP Bpa');
+ $select[] = array( 'value' => '0x7B', 'text' => 'MLPP Bnea');
+ $select[] = array( 'value' => '0x7C', 'text' => 'MLPP Upa');
+/* !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');
+ $select[] = array( 'value' => '0x83', 'text' => 'Meetme Enter Pin Tone');
+ $select[] = array( 'value' => '0x84', 'text' => 'Meetme Invalid Pin Tone');
+ $select[] = array( 'value' => '0x85', 'text' => 'Meetme Failed Pin Tone');
+ $select[] = array( 'value' => '0x86', 'text' => 'Meetme CFB Failed Tone');
+ $select[] = array( 'value' => '0x87', 'text' => 'Meetme Enter Access Code Tone');
+ $select[] = array( 'value' => '0x88', 'text' => 'Meetme Access Code Invalid Tone');
+ $select[] = array( 'value' => '0x89', 'text' => 'Meetme Access Code Failed Tone');
+ $select[] = array('value' => 'yes', 'text' => 'Yes');
+ $select[] = array('value' => 'no', 'text' => 'No');
+
+ $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!: -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');
+ $tt = _("Allow call transfer.");
+ $tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
+
+ unset($select);
+ $select[] = array('value' => 'yes', 'text' => 'Yes');
+ $select[] = array('value' => 'no', 'text' => 'No');
+ $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');
+ $select[] = array('value' => 'reject', 'text' => 'Reject');
+ $select[] = array('value' => 'silent', 'text' => 'Silent');
+ $select[] = array('value' => 'UserDefined', 'text' => 'UserDefined');
+# !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)").' '.
+ _("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');
+
+ unset($select);
+ $select[] = array('value' => 'yes', 'text' => 'Yes');
+ $select[] = array('value' => 'no', 'text' => 'No');
+ $tt = _("Silence Suppression. Asterisk Not supported");
+ $tmparr['silencesuppression'] = array('prompttext' => _('Silence Suppression'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
+
+ unset($select);
+ $select[] = array('value' => 'default', 'text' => _('default'));
+ if (function_exists('music_list')){
+ $moh_list = music_list();
+ } else {
+ $moh_list = array('default');
+ }
+ foreach ($moh_list as $value) {
+ $select[] = array('value' => $value, 'text' => _($value));
+ }
+
+ $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/Sccp.class.php.v433 b/conf/Sccp.class.php.v433
index 50448e1..46fbbda 100644
--- a/conf/Sccp.class.php.v433
+++ b/conf/Sccp.class.php.v433
@@ -31,14 +31,25 @@ class Sccp extends \FreePBX\modules\Core\Driver {
);
}
+/* 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();
+ foreach($settings as $key => $setting) {
+ $sth->execute(array($id,$key,$setting['value'],$setting['flag']));
+ }
+ return true;
+ }
+*/
public function addDevice($id, $settings) {
- global $currentcomponent;
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description');
+ // print_r($_REQUEST);
+ // echo '
';
+ // die(print_r($settings));
$settings['cid_num']['value'] = '';
- $settings['cid_name']['value'] = '';
+ $settings['cid_name']['value'] = $label;
$settings['mailbox']['value']= '';
- // Add $_REQUEST values to settings
if (isset($_REQUEST)){
foreach($add_fld as $key => $val) {
if (!empty($_REQUEST[$key])){
@@ -54,8 +65,10 @@ class Sccp extends \FreePBX\modules\Core\Driver {
}
$settings['allow']['value'] = implode(",", $allow_codec);
- // If set, parse outboundcid content into cid_num and cid_name sccpline fields
- if (!empty($settings['cid_num']['value'])) {
+ // parse outboundcid content into cid_num and cid_name sccpline fields
+ if (empty($settings['cid_num']['value'])) {
+ $settings['cid_num']['value'] = $id;
+ } else {
$outboundcid = $settings['cid_num']['value'];
if (preg_match('/"(.*)"\s?<(.*)>/', $outboundcid, $matches)) {
$settings['cid_num']['value'] = $matches[2];
@@ -71,6 +84,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
}
}
+ // die(print_r($settings));
$tech = Array();
$sql = "DESCRIBE sccpline";
foreach ($this->database->query($sql) as $row) {
@@ -88,15 +102,6 @@ class Sccp extends \FreePBX\modules\Core\Driver {
$sth = $this->database->prepare($sql);
$sth->execute();
- /*
- If called from SCCP Phone, redirect to SCCP Phone page on submit.
- This was last function in add so should be safe.
- Prefer to add in Hooks, but is not followed even if set for $currentcomponent
- Do nothing if called from QuickCreateExtension when display is not set
- */
- if (isset($_REQUEST['display'])) {
- redirect("config.php?display=sccp_phone", false);
- }
return true;
}
diff --git a/conf/sccpgeneral.xml b/conf/sccpgeneral.xml
new file mode 100644
index 0000000..3ce4f26
--- /dev/null
+++ b/conf/sccpgeneral.xml
@@ -0,0 +1,1018 @@
+
+
+
+
+ XML_info
+ NONE
+
+
+
+
+
+
+
+
+
+
+ dev_sshUserId
+ cisco
+
+ Help.
+
+
+
+ dev_sshPassword
+ cisco
+
+ Help.
+
+
+
+ dev_deviceProtocol
+ SCCP
+
+ Help.
+
+
+
+ sccp_xml_about
+ XML Base ver: 11.2, Sccp ver: default
+
+ Help.
+
+
+
+
+
+
+
+
+ servername
+ Vt
+
+ Servername: This is the type of server - usually, it will be Asterisk.
+
+
+
+ bindaddr
+ 0.0.0.0
+ sccp-custom
+
+
+ port
+ 2000
+ sccp-custom
+
+ Bind Address: The address to bind to for SCCP. In general, it should be set to '0.0.0.0'. If you find problems with one-way audio, you can set this to a specific address in the server. Note that '127.0.0.1' is always wrong here. Also note that placing in your external IP address will cause the chan_sccp module to not load. A manual edit of the /etc/asterisk/sccp.conf file will be needed to fix and reload the module.
+ :
+
+
+
+ externip
+
+ sccp-custom
+
+
+ External IP Address of the firewall, required in case the PBX is running on a separate host behind it. IP Address that we're going to notify in RTP media stream as the pbx source address.
+ /
+
+
+
+ keepalive
+ 60
+ sccp-custom
+ number
+
+
+ Time between Keep Alive checks. Valid range is 60-300 seconds. After much trial-and-error, the minimum (60) seems to work just fine.
+
+ debug
+ NONE
+
+
+
+
+
+ Debug: Enable debugging level in SCCP module.
+
+
+
+
+
+ permit
+ 0.0.0.0/0.0.0.0
+
+
+ Add Allow network
+ Allow network settings. Blank fields will be ignored, use Network 0.0.0.0.
+
+
+
+
+ deny
+ 0.0.0.0/0.0.0.0
+
+
+ Add Deny network
+ All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'.
+
+
+
+
+ localnet
+ 0.0.0.0/0.0.0.0
+
+
+ Add local networks
+ Local network settings. Blank fields will be ignored used Network 0.0.0.0.
+
+
+
+
+
+ language
+ English
+
+ SCCP Language: This is the language for your hints and other features of the phone. If you don't have any languages installed or are using a single language, you can leave this blank.
+
+
+ netlang
+ English_United_States
+
+ The Network locales allows the phone to play tones (ringing, busy etc.) native to the phone's country.
+
+
+ devlang
+ English_United_States
+
+ The user locale allows the phone to display text (menu items, soft keys etc.) native to the phone's language.
+
+
+
+
+
+
+ firstdigittimeout
+ 16
+ sccp-custom
+ number
+
+
+ First Digit Timeout: The amount of time after your first digit to start dialing automatically. This can be over-ridden with in your dialplan.xml or by using the 'immediate dial' button.
+
+
+
+ digittimeout
+ 8
+ sccp-custom
+ number
+
+
+ Digit Timeout: The amount of time to wait after the second (or subsequent) dialed digit. Override rules are the same as for firstdigittimeout.
+
+
+
+ autoanswer_ring_time
+ 0
+ sccp-custom
+ number
+
+
+ Autoanswer Ring Time: The amount of time the phones will ring when being called as Intercom or Paging mode.
+
+
+
+ autoanswer_tone
+ 0x32
+ sccp-custom
+
+ Autoanswer Tone: The tone the phone plays back when it picks up the phone in autoanswer mode. Default is '0x32'. Silence is '0x00'. There are lots of tones, all expressed as '0XNN' where 'NN' is a hexadecimal number.
+
+
+
+ remotehangup_tone
+ 0x32
+ sccp-custom
+
+ Remote Hangup Tone: The tone played by the phone when it received a remote hang-up signal. Use '0' to disable the tone.
+
+
+
+ transfer_tone
+ 0x32
+ sccp-custom
+
+ Transfer Tone: The tone played when a call is transferred. Use '0' to disable the tone.
+
+
+
+ callwaiting_tone
+ 0x2D
+ sccp-custom
+
+ Call Waiting Tone: The tone played when a call is waiting. If you set this one to '0', you will not get a tone in your current call if a new call comes in, so you might want to disable call waiting for this line instead.
+
+ echocancel
+ no
+
+
+ Echo Cancel: Echo Cancellation (On or Off).
+
+ silencesuppression
+ no
+
+
+ Silence Suppression: Silence Suppression on the phone.
+
+ private
+ yes
+
+
+ Private Calling Enabled: Place a call with privacy Options (no Caller ID) turned on. Needs to be supported in Asterisk to work through SIP and DAHDI trunks.
+
+ directed_pickup_modeanswer
+ no
+
+
+ Directed Pickup Mode (Answer): If a call is sent with the "directed pickup" flag, the phone will answer when set to "Yes".
+
+ callanswerorder
+ oldestfirst
+
+
+ Call Answer Order: Which call should be answered first? The most common choice is "oldestfirst", but other orders are supported.
+
+ mwilamp
+ On
+
+
+
+
+
+ Set the MWI lamp style when MWI active to on, off, wink, flash or blink
+
+ mwioncall
+ no
+
+
+ Set the MWI on call.
+
+
+
+ ntp_config_enabled
+ no
+
+
+ Enabling NTP settings in device configuration.
+
+
+
+ ntp_server
+ pool.ntp.org
+ pool.ntp.org
+
+ NTP Server name or IP
+
+ ntp_server_mode
+ unicast
+
+
+
+
+ Configure NTP Server protocol time synchronization
+
+
+
+
+
+ dateformat
+
+ Date Format: The date format for the on-screen display. Can be one of the following: (D-M-YA, M.D.Y, Y/M/D) where 'D' is Day, 'M' is Month, 'Y' is Year, 'A' is 24-hour, 'a' is 12-hour, and the separators can be '.','-','/'
+
+
+ ntp_timezone
+
+ Date Format: Time zone
+
+
+
+
+
+
+
+ dev_servicesURL
+
+
+
+
+
+
+
+
+
+ dev_authenticationURL
+
+
+
+
+ The above is simply a dummy authentication page. It literally contains one word: AUTHORIZED (it receives UserId, Password, and devicename in the url - if you truly wish to implement special auth)
+
+
+
+ dev_idleURL
+
+
+
+
+ URL of CiscoIPPhoneImage. Requires a non-zero setting in idleTimeout.
+
+
+
+ dev_informationURL
+
+
+
+
+
+
+
+ dev_messagesURL
+
+
+
+
+
+
+
+ dev_directoryURL
+
+
+
+ This is the URL for a CiscoIPPhoneMenu which gets appended to the end of the Missed/Received/Placed calls. I don't use it (I find it makes more sense to put my phone book under services)
+
+
+
+ dev_proxyServerURL
+
+
+
+
+
+
+
+
+
+ dev_idleTimeout
+ 60
+ sccp-custom
+ number
+
+
+
+
+
+
+
+
+
+ sccp_tos
+ 0x68
+ sccp-custom
+
+
+ sccp_cos
+ 0x4
+ sccp-custom
+
+ SCCP Type Of Service / Class Of Service: SCCP Type or Class of Service - this is modifiable, but don't.
+
+
+
+ audio_tos
+ 0xB8
+ sccp-custom
+
+
+ audio_cos
+ 0x6
+ sccp-custom
+
+ Audio Type Of Service / Class Of Service: Audio Type or Class of Service - this is modifiable, but don't.
+
+
+
+ video_tos
+ 0x88
+ sccp-custom
+
+
+ video_cos
+ 0x5
+ sccp-custom
+
+ Video Type Of Service / Class Of Service: Video Type or Class of Service - this is modifiable, but don't.
+
+
+
+
+ Help_id2
+ Setting the hotline Feature on a device, will make it connect to a predefined extension as soon as the Receiver is picked up or the 'New Call' Button is pressed. No number has to be given. This works even on devices which have no entry in the config file or realtime database.
+ The hotline function can be used in :
+
+
First time configuration
This will make it easier to register new devices and assign numbers
+
At a door
Where you want people to be able to only call one number
+
For unprovisioned phones
To only be able to call the helpdesk to get their phone set up
+
+
+ Be careful with this function. Especially not to the internet. So i would restring the deny/permit to 'internal' by default in that case.
+
+
Allow =
Specify a list of your networks, for example: 192.168.1.0
+
deny =
0.0.0.0/0.0.0.0
+
permit =
internal
+
hotline_context =
sccp
+
hotline_label =
hotline
+
+
+
+
+
+ hotline_enabled
+ off
+
+
+ Hotline Enabled: This allows unregistered extensions to connect to the system and dial the number listed below.
+
+
+
+ hotline_extension
+ *111
+ sccp-custom
+
+ Hotline Extension: The number that gets called when a hotline is picked up. hint
+
+
+
+ hotline_label
+ Hot Line
+ sccp-custom
+
+ Hotline Label: The label on the device
+
+
+
+ hotline_context
+ default
+ sccp-custom
+
+ Hotline Context: This is the context through which the phone will connect. It should probably match your other contest. The default is "from-internal" but "from-internal-xfer" would also make sense by limiting the options for the person using the phone.
+
+
+
+ context
+ from-internal
+ sccp-custom
+
+ Context: This is the context in which your phones will operate. It should match the context you are using for the rest of your phones (if you have any). The FreePBX default is 'from-internal'
+
+
+
+ regcontext
+ sccpregistration
+ sccp-custom
+
+ If regcontext is specified in sccp.conf chan-sccp-b will dynamically create and destroy a NoOp priority 1 extension for a given peer/line which registers with the server. If the context is not specified in extension.conf, then it will be dynamically created when an chan-sccp-b agent registers
+
+
+ musicclass
+ NONE
+
+ form-control
+ Music Class: Available MOH Classes. These are the MOH classes listed in your current server.
+
+
+ dial_template
+ NONE
+
+ sccp-custom
+ Help.
+
+
+ autoselectline_enabled
+
+ no
+
+
+ Enables and Disables auto line selection.
+
+ meetme
+ no
+
+
+ Enable/Disable conferencing via meetme (on/off), make sure you have one of the meetme apps mentioned below activated in module.conf
+
+
+
+ meetmeopts
+ qxd
+ sccp-custom
+
+ Other options (app_meetme: A,a,b,c,C,d,D,E,e,F,i,I,l,L,m,M,o,p,P,q,r,s,S,t,T,w,x,X,1) see meetme specific documentation
+
+
+
+ autocall_select
+
+ no
+
+
+
+
+ backgroundImageAccess
+ no
+
+
+ I'm guessing on this one, but on some devices, the background image on the display can be modified at the device. I think this is the thing that allows that to take.
+
+
+
+
+
+
+ tftp_path
+ /tftpboot
+ sccp-custom
+
+ Path to tftp home directory
+
+
+ tftp_rewrite
+
+ off
+
+
+ Support the use of regular-expression-based filename remapping
+
+
+
+ devicetable
+ sccpdevice
+
+
+ sccp-custom
+ Device Table: This is the devicetable for your realtime configuration. Don't change this unless you know what you are doing and have made all the appropriate changes in the rest of your Asterisk config files. There are two reasonable settings for this - the sccpdevice table or the sccpdeviceconfig view. If you do not want to use the realtime database anymore, you can set this to blank. NOT RECOMMENDED.
+
+
+
+
+ linetable
+ sccpline
+ sccp-custom
+
+ Line Table: This is the linetable for your realtime configuration. Don't change this unless you know what you are doing and have made all the appropriate changes in the rest of your Asterisk config files. If you do not want to use the realtime database anymore, you can set this to blank. NOT RECOMMENDED.
+
+
+
+ createlangdir
+ no
+
+
+ Say 'yes' if you need to create cisco default language directory in tftp path.
+
+
+
+
+
+
+
+ mac
+ 000000000
+ sccp-custom
+
+ The MAC address of the phone. You must specify 12 characters in the format XXXX.XXXX.XXXX or XX-XX-XX-XX-XX-XX or XXXXXXXXXXXX
+
+
+
+
+ type
+ 7911
+
+ hw_select sccp-custom
+ The type of phone: 7911, 7940, 7960, etc. Important note: the 'G' models are handled as the base model (e.g., 7962G is handled as 7962). In the Display mode, this field is read-only because the MAC address and the model number are a pair.
+
+
+
+ addon
+ NONE
+
+ hw_select sccp-custom
+ Addon: Addons are model specific and only work with certain base phones. This phone model is identified as being a phone that does not accept sidecars. Update devmodel if this is not correct.
+
+
+
+
+
+
+
+ mac
+ 000000000
+ sccp-custom
+
+
+ The MAC address of the phone
+
+
+
+ type
+ 7911
+
+
+ hw_select sccp-custom
+ The type of phone: 7911, 7940, 7960, etc. Important note: the 'G' models are handled as the base model (e.g., 7962G is handled as 7962). In the Display mode, this field is read-only because the MAC address and the model number are a pair.
+
+
+
+
+
+ type
+ 79XX
+ sccp-custom
+
+
+ The type of phone: 7911, 7940, 7960, etc. Important note: the 'G' models are handled as the base model (e.g., 7962G is handled as 7962). In the Display mode, this field is read-only because the MAC address and the model number are a pair.
+
+
+
+
+ addon
+ NONE
+ sccp-custom
+
+
+ Addon: Addons are model specific and only work with certain base phones. This phone model is identified as being a phone that does not accept sidecars. Update devmodel if this is not correct.
+
+
+
+
+
+
+
+
+ description
+ 000000000
+ sccp-custom
+
+ The information in the upper right corner of the device screen
+
+
+ softkeyset
+ default
+
+ System Default Softkey
+
+
+ tzoffset
+ 00
+
+ Time Zone offset
+
+
+ netlang
+ English_United_States
+
+ The Network locales allows the phone to play tones (ringing, busy etc.) native to the phone's country.
+
+
+ devlang
+ English_United_States
+
+ The user locale allows the phone to display text (menu items, soft keys etc.) native to the phone's language.
+
+
+
+ backgroundImage
+
+ sccp-custom
+
+ For phones that can display background images - display this one. Default is [empty]
+
+
+
+ ringtone
+
+ sccp-custom
+
+ The ringtone that the phone will default to. Can be overridden in the phone. The files RINGLIST.XML provice the basic phone ring tones, while DISTINCTIVERINGLIST.XML defines the list of possible ring tones for your other line types. They, along with the actual 'raw' ringtones, are stored in the /tftpboot/ringtones directory with the rest of the config files.
+
+
+
+
+
+
+ mac
+ 000000000
+ sccp-custom
+
+
+
+
+
+
+
+ transfer
+ no
+
+
+ Transfer allowed
+
+ cfwdall
+ no
+
+
+ Activate the Callforward Softkeys. Default is On
+
+ cfwdbusy
+ no
+
+
+ Activate the callforward busy softkeys. Default is On
+
+
+ useRedialMenu
+
+ no
+
+
+ You can specifying 'useRedialMenu = yes' in the sccp.conf device section and the redial softkey will cause the "placed calls" list instead of immediately calling the last dialed number.
+
+
+ dndFeature
+
+ On
+
+
+ Do Not Disturb. Default is Off
+
+
+
+ dtmfmode
+
+ outofband
+
+
+ Dual-Tone Multi-Frequency: outofband is the native cisco dtmf tone play
+
+
+ mwilamp
+
+ On
+
+
+
+
+
+ Set the MWI lamp style when MWI active to on, off, wink, flash or blink
+
+ directed_pickup
+ yes
+
+
+ Enable Pickup function to direct pickup an extension. Default is On
+
+ directed_pickup_modeanswer
+ yes
+
+
+ On (Default)= the call has been answered when picked up. Off = call manager way, the phone who picked up the call rings the call
+
+
+
+ directed_pickup_context
+
+ sccp-custom
+
+ Context where direct pickup search for extensions. if not set current context will be use.
+
+
+
+
+
+
+ conf_allow
+
+ yes
+
+
+ Allow the use of conference
+
+
+ conf_play_general_announce
+
+ yes
+
+
+ Playback General Announcements (like: 'You are Entering/Leaving the conference')
+
+
+ conf_play_part_announce
+
+ yes
+
+
+ Playback Personal/Participant Announcements, (like: 'You have been muted / You have been kicked')
+
+
+ conf_mute_on_entry
+
+ no
+
+
+ Mute new participants from the start
+
+
+ conf_show_conflist
+
+ yes
+
+
+ Automatically show conference list to the moderator
+
+
+ conf_music_on_hold_class
+ default
+
+ form-control
+ Play music on hold of this class when no moderator is listening on the conference. If set to an empty string, no music on hold will be played.
+
+
+
+
+
+
+
+
+ permit
+ /
+
+
+ Add Allow network
+ Allow network settings. Blank fields will be ignored used Network 0.0.0.0.
+
+
+
+
+ deny
+ /
+
+
+ Add Deny network
+ All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'.
+
+
+ nat
+
+ Off
+
+
+ Device NAT support (default Off)
+
+
+
+ directrtp
+
+ Off
+
+
+ This option allow devices to do direct RTP sessions (default Off)
+
+
+ earlyrtp
+
+ progress
+
+
+
+
+ The audio stream will be open in the progress and connected state. Valid options: NONE, progress, offhook, dial, ringout. Default may be Progress.
+
+
+
+
+
+ dialtemplate_name
+
+ form-control
+
+
+
+
+
+
+
+
+ dialtemplate
+ */10/*
+ title
+
+
+ text1
+
+
+
+ empty
+ Bellcore-Alerting
+ Bellcore-Inside
+ Bellcore-Outside
+ Bellcore-Busy
+ Bellcore-BusyVerify
+ Bellcore-Reorder
+ Bellcore-CallWaiting
+ Bellcore-Hold
+ Bellcore-Reminder
+ Bellcore-Confirmation
+ Bellcore-Stutter
+ Bellcore-Permanent
+ Bellcore-None
+ Cisco-Zip
+ Cisco-ZipZip
+ Cisco-BeepBonk
+ Bellcore-dr1
+ Bellcore-dr2
+ Bellcore-dr3
+ Bellcore-dr4
+ Bellcore-dr5
+ Bellcore-dr6
+ CallWaiting-2
+ CallWaiting-3
+ CallWaiting-4
+
+ Allow network settings. Blank fields will be ignored used Network 0.0.0.0.
+
+
+
+
+
+
+ Help_srst
+ You can also configure a Survivable Remote Site Telephony (SRST) reference as the last device in the CallManager(CM) list. This proves especially useful in a remote site configuration where the phones and Asterisk are connected over a WAN network. SRST provides users with fallback support for the IP phones that cannot access the primary, secondary, or tertiary Asterisk Node in the CallManager List because of an Asterisk Node failure or loss of connectivity across the WAN. For the remote sites attached to multiple-service routers across the WAN, SRST ensures that your remote users receive continuous (although minimal) service by providing call handling support directly from the SRST router.
+ When IP phones lose contact with primary, secondary, and tertiary Asterisk Nodes (CM's), they must establish a connection to a local SRST router to sustain the call-processing capability necessary to place and receive calls. The IP phone retains the IP address of the local SRST router as a default router in the Network Configuration area of the Settings menu. The Settings menu supports a maximum of five default router entries; however, the cnf.xml accommodates a maximum of three entries. When a secondary Asterisk Node is not available on the network, the local SRST Router's IP address is retained as the standby connection for Asterisk Node during normal operation.
+
+
+ srst_Option
+ disable
+
+
+
+ You enabled/configured a Survivable Remote Site Telephony (SRST) reference as the last device in the CallManager(CM) list.
+
+ srst_userModifiable
+ false
+
+
+ The user can change the personal SRST configuration on the device
+
+ srst_isSecure
+ false
+
+
+ The user can change the personal SRST configuration on the device
+
+
+
+
+
+ srst_Name
+ Enable
+
+ You enabled configure a Survivable Remote Site Telephony (SRST) reference as the last device in the CallManager(CM) list.
+
+
+
+
+ srst_ip
+ 3
+ /
+
+
+ Add Server
+
+
+
+
+ srst_sip
+ 3
+ /
+
+
+ Add Server
+
+
+
+
diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433
index 2334954..698f0d6 100644
--- a/conf/sccpgeneral.xml.v433
+++ b/conf/sccpgeneral.xml.v433
@@ -492,7 +492,7 @@ and open the template in the editor. Base Version before all crash :-)
off
- Enable NTP settings in device configuration.
+ Enabling NTP settings in device configuration.
@@ -501,7 +501,7 @@ and open the template in the editor. Base Version before all crash :-)
pool.ntp.orgpool.ntp.org
- NTP Server name or IP address
+ NTP Server name or IPntp_server_mode
@@ -532,7 +532,7 @@ and open the template in the editor. Base Version before all crash :-)
- System Time zone - this is set by FreePBX and can be changed in Settings : Advanced Settings
+ Date Format: Time zone
diff --git a/install.php b/install.php
index 6f73ae7..3e4a033 100644
--- a/install.php
+++ b/install.php
@@ -45,7 +45,7 @@ $db_config = Get_DB_config($sccp_compatible);
$sccp_db_ver = CheckSCCPManagerDBVersion();
// BackUp Old config
-createBackUpConfig();
+CreateBackUpConfig();
RenameConfig();
InstallDB_updateSchema($db_config);
@@ -708,7 +708,7 @@ function InstallDB_CreateSccpDeviceConfigView($sccp_compatible)
}
return true;
}
-function createBackUpConfig()
+function CreateBackUpConfig()
{
global $amp_conf;
outn("
");
}
function RenameConfig()
@@ -793,23 +793,18 @@ function Setup_RealTime()
// Check extconfig file for correct connector values
$ext_conf = '';
- $ext_conf_file = '';
+ $ext_conf_file = 'extconfig.conf';
$backup_ext = array('_custom.conf', '_additional.conf','.conf');
foreach ($backup_ext as $value) {
if (file_exists($dir . '/extconfig' . $value)) {
// Last possibility is normal file extconfig.conf
- $ext_conf_file = 'extconfig' . $value;
+ $ext_conf_file = 'extconfig' . $value;
$ext_conf = $cnf_read->getConfig($ext_conf_file);
break;
}
}
- if (empty($ext_conf_file)) {
- // Have not found a file, so will need to create. $ext_conf must be empty
- $ext_conf_file = 'extconfig.conf';
- }
if (!empty($ext_conf)) {
- // Have found a file and read a config. Now need to check required settings
$currentExtSettings = array();
$writeExtSettings = $ext_conf;
if (empty($ext_conf['settings']['sccpdevice']) || ($ext_conf['settings']['sccpdevice'] !== $def_ext_config['sccpdevice'])) {
@@ -821,15 +816,9 @@ function Setup_RealTime()
$writeExtSettings['settings']['sccpline'] = $def_ext_config['sccpline'];
}
if (!empty($writeExtSettings)) {
- outn("
");
$cnf_wr->writeConfig($ext_conf_file, $writeExtSettings);
}
- } else {
- // Either did not find file or file did not contain any config, so create and fill
- outn("
");
- outn(" ");
- outn("PHPx.x-zip not installed where x.x is the installed PHP version. Install it before continuing !");
- die_freepbx();
+ outn("
" . _("Error Create BackUp: ") . $filename ."
");
}
- unlink($sqlBuFile);
- outn("
" . _("Config backup created: ") . $filename ."
");
+ outn("
" . _("Create Config BackUp: ") . $filename ."
");
+}
+*/
+if (!defined('FREEPBX_IS_AUTH')) {
+ die('No direct script access allowed');
}
+global $db;
+$version = FreePBX::Config()->get('ASTVERSION');
+
+out('Removing all Sccp_manager tables');
+$tables = array('sccpdevmodel', 'sccpsettings');
+foreach ($tables as $table) {
+ $sql = "DROP TABLE IF EXISTS {$table}";
+ $result = $db->query($sql);
+ if (DB::IsError($result)) {
+ die_freepbx($result->getDebugInfo());
+ }
+ unset($result);
+}
if (!empty($version)) {
+ // Woo, we have a version
$check = $db->getRow("SELECT 1 FROM `kvstore` LIMIT 0", DB_FETCHMODE_ASSOC);
if (!(DB::IsError($check))) {
- outn("
" . _("Deleting keys FROM kvstore..") . "
");
+ //print_r("none, creating table :". $value);
+ echo "Deleting keys FROM kvstore..";
sql("DELETE FROM kvstore WHERE module = 'sccpsettings'");
sql("DELETE FROM kvstore WHERE module = 'Sccp_manager'");
}
- }
- // FreePbx removes all tables via module.xml, and uninstaller will error
- // If the tables do not exist.
- //outn("
" . _('Removing all Sccp_manager tables') . "
");
- //foreach ($sqlTables as $table) {
- //$sql = "DROP TABLE IF EXISTS {$table}";
- //}
- // Still need to handle views as FreePBX does not know about these.
- outn("
" . _('Removing all Sccp_manager views') . "
");
- $db->query("DROP VIEW IF EXISTS sccpdeviceconfig");
+ // By accessing the database, we have recreated sccpsettings table so now delete
+ // Need to rewrite this uninstaller.
+ $sql = "DROP TABLE IF EXISTS sccpsettings";
+ $result = $db->query($sql);
+ if (DB::IsError($result)) {
+ die_freepbx($result->getDebugInfo());
+ }
- outn("
" . _("Uninstall Complete") . "
");
+/* 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 safe to drop/delete them */
+
+/* DROP VIEW IF EXISTS`sccpdeviceconfig`;
+ DROP TABLE IF EXISTS `sccpbuttonconfig`;
+ DROP TABLE IF EXISTS `sccpdevice`;
+ DROP TABLE IF EXISTS `sccpdevmodel`;
+ DROP TABLE IF EXISTS `sccpline`;
+ DROP TABLE IF EXISTS `sccpsettings`;
+ DROP TABLE IF EXISTS `sccpuser`;
+ *
+ */
+}
+ echo "done \n";
?>
diff --git a/views/.nfs.2005102d.05d5 b/views/.nfs.2005102d.05d5
new file mode 100644
index 0000000..8787841
Binary files /dev/null and b/views/.nfs.2005102d.05d5 differ
diff --git a/views/advserver.dialtemplate.php b/views/advserver.dialtemplate.php
index e7bd7bf..cc37ab7 100644
--- a/views/advserver.dialtemplate.php
+++ b/views/advserver.dialtemplate.php
@@ -12,12 +12,12 @@
-
+
-
+
@@ -39,4 +39,4 @@
}
return exp_model;
}
-
+
\ No newline at end of file
diff --git a/views/advserver.keyset.php b/views/advserver.keyset.php
index 6228047..2dc039c 100644
--- a/views/advserver.keyset.php
+++ b/views/advserver.keyset.php
@@ -54,7 +54,7 @@ $keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Displa