diff --git a/!Readme.txt/bacgroundImage.txt b/!Readme.txt/bacgroundImage.txt
index 61e7c02..d87c83f 100644
--- a/!Readme.txt/bacgroundImage.txt
+++ b/!Readme.txt/bacgroundImage.txt
@@ -1,4 +1,6 @@
https://github.com/chan-sccp/chan-sccp/wiki/Adding-custom-background-images
+http://www.voicecerts.com/2011/08/changing-cisco-ip-phone-background.html
+https://silver-golem.livejournal.com/432591.html
> Real Time !
http://silver-golem.livejournal.com/431942.html
diff --git a/README.md b/README.md
index a7eef0c..6bd94b0 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,7 @@ Make sure you have the following installed on your system:
- clang >= 3.6 (note: older not supported, higher advised)
- gnu make
- pbx:
- - asterisk >= 1.6.2 (absolute minimum)
+ - asterisk >= 1.8 (absolute minimum & not recomended)
- asterisk >= 13.7 or asterisk >= 14.0 recommended
- gui:
- freepbx >= 13.0.192
diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php
index b8d37e5..fa3dde3 100644
--- a/Sccp_manager.class.php
+++ b/Sccp_manager.class.php
@@ -20,6 +20,8 @@
* ? Dial Templates - Hoto IT Include in XML.Config ???????
* - Dial Templates in device Configuration ( Enabled / inheret / Disabled ; templet )
* - WiFi Config (Bulk Deployment Utility for Cisco 7921, 7925, 7926)?????
+ * - Change internal use Field to _Field (new fiture support in chan_sccp )
+ * + Change Installer ?? (test )
* - suport kvstore ?????
* - Shared Line ????
* - bug Fix
@@ -135,11 +137,12 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$this->initTftpLang();
- // Load Advanced Form Constuctor Data
+ // 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
- }
+ }
+
}
/*
@@ -810,7 +813,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
};
$value = implode(";", $save_codec);
break;
- case 'hwlang':
+ case '_hwlang':
if (empty($get_settings[$hdr_prefix . 'netlang']) || empty($get_settings[$hdr_prefix . 'devlang'])) {
$value = 'null';
} else {
@@ -988,6 +991,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
public function sccp_core_comands($params = array()) {
global $astman;
$cmd_list = array('get_softkey' => array('cmd' => "sccp show softkeyssets", 'param' => ''),
+ 'get_version' => array('cmd' => "sccp show version", 'param' => ''),
'get_device' => array('cmd' => "sccp show devices", 'param' => ''),
'get_hints' => array('cmd' => "core show hints", 'param' => ''),
'sccp_reload' => array('cmd' => "sccp reload force", 'param' => ''),
@@ -1064,7 +1068,38 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
}
return $ast_key;
}
-
+ /*
+ * Итого res = (0,1,10,11)
+ */
+ public function get_comatable_sccp() {
+ $res = 0;
+ $ast_out = $this->sccp_version();
+ if ($ast_out[0] >= '4.3.0'){
+ $res = 1;
+ }
+ if (!empty($ast_out[1]) && $ast_out[1] == 'develop'){
+ $res = 10;
+ if (!empty($ast_out[3])) {
+ if (base_convert($ast_out[3],16,10) >= base_convert('702487a',16,10)){
+ $res += 1;
+ }
+ }
+ }
+ $res = 0;
+
+ return $res;
+
+ }
+
+ public function sccp_version() {
+ $ast_out = $this->sccp_core_comands(array('cmd' => 'get_version'));
+ if (preg_match("/Release.*\(/", $ast_out['data'] , $matches)) {
+ $ast_out = substr($matches[0],9,-1);
+ return explode(' ', $ast_out);
+ } else {
+ return aray('unknown');
+ }
+ }
public function sccp_list_keysets() {
$ast_out = $this->sccp_core_comands(array('cmd' => 'get_softkey'));
@@ -1462,7 +1497,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
function init_sccp_path() {
global $db;
- global $amp_conf;
+ global $amp_conf;
+
$confDir = $amp_conf["ASTETCDIR"];
if (empty($this->sccppath["asterisk"])) {
if (strlen($confDir) < 1) {
@@ -1516,11 +1552,17 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
copy($filename, $dst_path . basename($filename));
}
}
+ $this->sccpvalues['sccp_comatable'] = $this->get_comatable_sccp();
$dst = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/core/functions.inc/drivers/Sccp.class.php';
if (!file_exists($dst)) {
- $src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst);
- copy($src_path, $dst);
+ $src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst).'.v'.$this->sccpvalues['sccp_comatable'];
+ if (file_exists($src_path)) {
+ copy($src_path, $dst);
+ } else {
+ $src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst);
+ copy($src_path, $dst);
+ }
}
if (!file_exists($this->sccppath["sccp_conf"])) { // System re Config
@@ -1528,6 +1570,20 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
file_put_contents($this->sccppath["sccp_conf"], $sccpfile);
}
+ $dst = __DIR__ . '/views/sccpgeneral.xml';
+ if (!file_exists($dst)) {
+ $src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst).'.v'.$this->sccpvalues['sccp_comatable'];
+ if (file_exists($src_path)) {
+ // Plz Test directory permission run "amportal chown"
+ copy($src_path, $dst);
+ } else {
+ // Plz Test directory ermission run "amportal chown"
+ $src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst);
+ copy($src_path, $dst);
+ }
+ }
+
+
$this->sccp_conf_init = $this->cnf_read->getConfig('sccp.conf');
// $this->sccp_conf_init = @parse_ini_file($this->sccppath["sccp_conf"], true);
@@ -1929,8 +1985,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
case 'networkLocaleInfo':
case 'networkLocale':
$hwlang = '';
- if (!empty($var_hw_config["hwlang"])) {
- $hwlang = explode(':', $var_hw_config["hwlang"]);
+ if (!empty($var_hw_config["_hwlang"])) {
+ $hwlang = explode(':', $var_hw_config["_hwlang"]);
}
if (($key == 'networkLocaleInfo') || ($key == 'networkLocale')) {
// $lang=$this->sccpvalues['netlang']['data'];
diff --git a/conf/Sccp.class.php.v11 b/conf/Sccp.class.php.v11
new file mode 100644
index 0000000..052cabb
--- /dev/null
+++ b/conf/Sccp.class.php.v11
@@ -0,0 +1,222 @@
+'pin', "label" => 'label', "accountcode" => 'account',
+ "context" =>'context',"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',
+ 'namedcallgroup'=>'namedcallgroup', 'namedpickupgroup' => 'namedpickupgroup'
+ );
+
+ public function getInfo() {
+ return array(
+ "rawName" => "sccp",
+ "hardware" => "sccp_custom",
+ "prettyName" => _("Sccp Custom Driver"),
+ "shortName" => _("Sccp"),
+ "description" => _("Sccp Device")
+ );
+ }
+ 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, id';
+ $sqlv = 'values ("'.$id.'", "'.$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 id = ?";
+ $sth = $this->database->prepare($sql);
+ $sth->execute(array($id));
+ return true;
+ }
+
+
+ public function getDevice($id) {
+ $sccp_line = array();
+ $sql = "SELECT id";
+ foreach($this->data_fld as $key => $val) {
+ $sql .= ',`'. $key .'` as '.$val;
+ }
+ $sql .= " FROM sccpline WHERE id = ?";
+ $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++
+ ),
+ "context" => 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++
+ ),
+ "musicclass" => array(
+ "value" => "default",
+ "flag" => $flag++
+ ),
+ );
+ return array(
+ "dial" => $dial,
+ "settings" => $settings
+ );
+ }
+
+ public function getDeviceDisplay($display, $deviceInfo, $currentcomponent, $primarySection) {
+ $section = _("Settings");
+ $category = "general";
+ $tmparr = array();
+ $tt = _("The SCCP channel number for this port.");
+ $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.");
+ $tmparr['context'] = array('prompttext' => _('Line context'), 'value' => 'from-internal', 'tt' => $tt, 'level' => 1);
+ $tt = _("Phone call group callgroup=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);
+ $tt = _("sets the named caller groups this line is a member of (ast111)");
+ $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);
+ $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)");
+ $tmparr['pin'] = array('value' => '', 'tt' => $tt, 'level' => 1);
+
+ 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 calcel");
+ $tmparr['echocancel'] = array('prompttext' => _('Echo calcel'), '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');
+ $tt = _("Do Not Disturb.");
+ $tmparr['dnd'] = array('prompttext' => _('DND'), 'value' => 'user', '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 suported");
+ $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 = _("Musik On Hold ");
+ $tmparr['musicclass'] = array('prompttext' => _('Musik On Hold'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1);
+
+
+
+ $devopts = $tmparr;
+ return $devopts;
+ }
+}
diff --git a/views/sccpgeneral.xml b/conf/sccpgeneral.xml
similarity index 99%
rename from views/sccpgeneral.xml
rename to conf/sccpgeneral.xml
index 69c4787..aedd11f 100644
--- a/views/sccpgeneral.xml
+++ b/conf/sccpgeneral.xml
@@ -2,9 +2,8 @@
-
diff --git a/conf/sccpgeneral.xml.v0 b/conf/sccpgeneral.xml.v0
new file mode 100644
index 0000000..daae640
--- /dev/null
+++ b/conf/sccpgeneral.xml.v0
@@ -0,0 +1,908 @@
+
+
+
+
+
+
+
+ dev_sshUserId
+ cisco
+
+ Help.
+
+
+
+ dev_sshPassword
+ cisco
+
+ Help.
+
+
+
+ dev_deviceProtocol
+ SCCP
+
+ 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.
+ :
+
+
+
+ externip
+
+ sccp-custom
+
+
+ External IP Address of the firewall, required in case the PBX is running on a seperate 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
+
+
+
+ Alow network settings. Blank fields will be ignored used Network 0.0.0.0.
+
+
+
+
+ deny
+ 0.0.0.0/0.0.0.0
+
+
+
+ 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
+
+
+
+ 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
+ Russian_Russia
+
+ 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 settings 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: Slience 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.
+
+ pickupmodeanswer
+ 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 syncronization
+
+
+
+
+
+ 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.
+
+
+
+ hotline_enabled
+ no
+
+
+ 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_context
+ defauly
+ 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_templet
+ 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
+
+
+ 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
+ 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
+ Russian_Russia
+
+ 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/ 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
+
+ pickupexten
+ yes
+
+
+ Enable Pickup function to direct pickup an extension. Default is On
+
+ pickupmodeanswer
+ 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
+
+
+
+ pickupcontext
+
+ sccp-custom
+
+ Context where direct pickup search for extensions. if not set current contect 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_net
+ 0.0.0.0
+ sccp-custom
+
+
+ permit_mask
+ 0.0.0.0
+ sccp-custom
+
+ Local network settings. Blank fields will be ignored used Network 0.0.0.0.
+ /
+
+
+
+ deny_net
+ 0.0.0.0
+ sccp-custom
+
+
+ deny_mask
+ 0.0.0.0
+ sccp-custom
+
+ IP deny: IP Address deny netmask. 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 strem will be open in the progress and connected state. Valid options: none, progress, offhook, dial, ringout. Default may be Progress.
+
+
+
+
+
+
+
+ dialtemplete_name
+
+ form-control
+
+ Help.
+
+
+
+
+
+
+ dialtemplete
+ */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
+
+ Alow network settings. Blank fields will be ignored used Network 0.0.0.0.
+
+
+
+
diff --git a/conf/sccpgeneral.xml.v11 b/conf/sccpgeneral.xml.v11
new file mode 100644
index 0000000..aedd11f
--- /dev/null
+++ b/conf/sccpgeneral.xml.v11
@@ -0,0 +1,907 @@
+
+
+
+
+
+
+ dev_sshUserId
+ cisco
+
+ Help.
+
+
+
+ dev_sshPassword
+ cisco
+
+ Help.
+
+
+
+ dev_deviceProtocol
+ SCCP
+
+ 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.
+ :
+
+
+
+ externip
+
+ sccp-custom
+
+
+ External IP Address of the firewall, required in case the PBX is running on a seperate 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
+
+
+
+ Alow network settings. Blank fields will be ignored used Network 0.0.0.0.
+
+
+
+
+ deny
+ 0.0.0.0/0.0.0.0
+
+
+
+ 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
+
+
+
+ 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
+ Russian_Russia
+
+ 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 settings 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: Slience 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 syncronization
+
+
+
+
+
+ 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.
+
+
+
+ hotline_enabled
+ no
+
+
+ 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_context
+ defauly
+ 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_templet
+ 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
+
+
+ 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
+ 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
+ Russian_Russia
+
+ 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/ 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 contect 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_net
+ 0.0.0.0
+ sccp-custom
+
+
+ permit_mask
+ 0.0.0.0
+ sccp-custom
+
+ Local network settings. Blank fields will be ignored used Network 0.0.0.0.
+ /
+
+
+
+ deny_net
+ 0.0.0.0
+ sccp-custom
+
+
+ deny_mask
+ 0.0.0.0
+ sccp-custom
+
+ IP deny: IP Address deny netmask. 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 strem will be open in the progress and connected state. Valid options: none, progress, offhook, dial, ringout. Default may be Progress.
+
+
+
+
+
+
+
+ dialtemplete_name
+
+ form-control
+
+ Help.
+
+
+
+
+
+
+ dialtemplete
+ */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
+
+ Alow network settings. Blank fields will be ignored used Network 0.0.0.0.
+
+
+
+
diff --git a/install.php b/install.php
index d9f6c25..77c6a09 100644
--- a/install.php
+++ b/install.php
@@ -6,11 +6,129 @@ if (!defined('FREEPBX_IS_AUTH')) {
global $db;
global $amp_conf;
+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'),
+ 'loadinformationid' => array('create' => "VARCHAR(30) NULL DEFAULT NULL" )
+ ),
+ 'sccpdevice' => array(
+ '_hwlang' => array('create' => 'varchar(12) NULL DEFAULT NULL'),
+// 'useRedialMenu' => array('create' => "VARCHAR(5) NULL DEFAULT 'no' AFTER `_hwlang`"),
+// 'dtmfmode' => array('create' => "VARCHAR(10) default 'outofband'", 'modyfy' => "VARCHAR(10)", 'def_modyfy'=> 'outofband'),
+ 'deny' => array('create' => 'VARCHAR(100) NULL DEFAULT NULL','modyfy' => "VARCHAR(100)"),
+ 'permit' => array('create' => 'VARCHAR(100) NULL DEFAULT NULL','modyfy' => "VARCHAR(100)"),
+ 'backgroundImage' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL','modyfy' => "VARCHAR(255)"),
+ 'ringtone' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL','modyfy' => "VARCHAR(255)"),
+
+ 'transfer' =>array('def_modyfy' => "on"),
+ 'cfwdall' =>array('def_modyfy' => "on"),
+ 'cfwdbusy' =>array('def_modyfy' => "on"),
+ 'directrtp' =>array('def_modyfy' => "off"),
+ 'dndFeature' =>array('def_modyfy' => "on"),
+ 'earlyrtp' =>array('def_modyfy' => "on"),
+ 'audio_tos'=>array('def_modyfy' => "0xB8"),
+ 'audio_cos'=>array('def_modyfy' => "6"),
+ 'video_tos'=>array('def_modyfy' => "0x88"),
+ 'video_cos'=>array('def_modyfy' => "5"),
+
+ 'mwilamp' =>array('def_modyfy' => "on"),
+ 'mwioncall' =>array('def_modyfy' => "on"),
+ 'private' =>array('def_modyfy' => "on"),
+ 'privacy' =>array('def_modyfy' => "off"),
+ 'nat' =>array('def_modyfy' => "auto"),
+ 'softkeyset' =>array('def_modyfy' => "softkeyset")
+ ),
+
+ 'sccpline' => array('namedcallgroup' =>array('create' => "VARCHAR(100) NULL DEFAULT NULL AFTER `setvar`", 'modyfy' => "VARCHAR(100)"),
+ 'namedpickupgroup' =>array('create' => "VARCHAR(100) NULL DEFAULT NULL AFTER `namedcallgroup`", 'modyfy' => "VARCHAR(100)"),
+ 'adhocNumber' =>array('create' => "VARCHAR(45) NULL DEFAULT NULL AFTER `namedpickupgroup`"),
+ 'meetme' =>array('create' => "VARCHAR(5) NULL DEFAULT NULL AFTER `adhocNumber`"),
+ 'meetmenum' =>array('create' => "VARCHAR(45) NULL DEFAULT NULL AFTER `meetme`"),
+ 'meetmeopts' =>array('create' => "VARCHAR(45) NULL DEFAULT NULL AFTER `meetmenum`"),
+ 'regexten' =>array('create' => "VARCHAR(45) NULL DEFAULT NULL AFTER `meetmeopts`"),
+ 'incominglimit' =>array('def_modyfy' => "2"),
+ 'transfer' =>array('def_modyfy' => "on"),
+ 'vmnum' =>array('def_modyfy' => "*97"),
+ 'musicclass' =>array('def_modyfy' => "default"),
+ 'echocancel' =>array('def_modyfy' => "on"),
+ 'silencesuppression' =>array('def_modyfy' => "off"),
+ 'dndFeature' =>array('create' => 'VARCHAR( 12 ) DEFAULT "on" AFTER `amaflags`', 'modyfy' => "VARCHAR(12)", 'def_modyfy' =>"on"),
+ 'dnd' =>array('create' => 'VARCHAR( 12 ) DEFAULT "reject" AFTER `amaflags`', 'modyfy' => "VARCHAR(12)", 'def_modyfy' =>"reject")
+ )
+ );
+
+
+$db_config_v3 = array('sccpdevmodel' => array('enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
+ 'nametemplet' => array('create' => 'VARCHAR(50) NULL DEFAULT NULL'),
+ 'loadinformationid' => array('create' => "VARCHAR(30) NULL DEFAULT NULL" )
+ ),
+ 'sccpdevice' => array(
+ 'pickupexten' => array('rename' => "directed_pickup"),
+ 'directed_pickup' => array('create' => "VARCHAR(5) NULL DEFAULT 'yes'"),
+ 'pickupcontext' => array('rename' => "directed_pickup_context"),
+ 'directed_pickup_context' => array('create' => "VARCHAR(100) NULL DEFAULT NULL"),
+ 'pickupmodeanswer' => array('rename' => "directed_pickup_modeanswer"),
+ 'directed_pickup_modeanswer' => array('create' => "VARCHAR(5) NULL DEFAULT 'yes'"),
+ 'hwlang' => array('rename' => "_hwlang"),
+ '_hwlang' => array('create' => 'varchar(12) NULL DEFAULT NULL'),
+ 'useRedialMenu' => array('create' => "VARCHAR(5) NULL DEFAULT 'no' AFTER `_hwlang`"),
+
+// 'dtmfmode' => array('create' => "VARCHAR(10) default 'outofband'", 'modyfy' => "VARCHAR(10)", 'def_modyfy'=> 'outofband'),
+ 'dtmfmode' => array('drop' => "yes"),
+
+ 'deny' => array('create' => 'VARCHAR(100) NULL DEFAULT NULL','modyfy' => "VARCHAR(100)"),
+ 'permit' => array('create' => 'VARCHAR(100) NULL DEFAULT NULL','modyfy' => "VARCHAR(100)"),
+ 'backgroundImage' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL','modyfy' => "VARCHAR(255)"),
+ 'ringtone' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL','modyfy' => "VARCHAR(255)"),
+
+ 'transfer' =>array('def_modyfy' => "on"),
+ 'cfwdall' =>array('def_modyfy' => "on"),
+ 'cfwdbusy' =>array('def_modyfy' => "on"),
+ 'directrtp' =>array('def_modyfy' => "off"),
+ 'dndFeature' =>array('def_modyfy' => "on"),
+ 'earlyrtp' =>array('def_modyfy' => "on"),
+ 'audio_tos'=>array('def_modyfy' => "0xB8"),
+ 'audio_cos'=>array('def_modyfy' => "6"),
+ 'video_tos'=>array('def_modyfy' => "0x88"),
+ 'video_cos'=>array('def_modyfy' => "5"),
+ 'trustphoneip'=>array('drop' => "yes"),
+
+ 'mwilamp' =>array('def_modyfy' => "on"),
+ 'mwioncall' =>array('def_modyfy' => "on"),
+ 'private' =>array('def_modyfy' => "on"),
+ 'privacy' =>array('def_modyfy' => "off"),
+ 'nat' =>array('def_modyfy' => "auto"),
+ 'softkeyset' =>array('def_modyfy' => "softkeyset")
+ ),
+
+ 'sccpline' => array('namedcallgroup' =>array('create' => "VARCHAR(100) NULL DEFAULT NULL AFTER `setvar`", 'modyfy' => "VARCHAR(100)"),
+ 'namedpickupgroup' =>array('create' => "VARCHAR(100) NULL DEFAULT NULL AFTER `namedcallgroup`", 'modyfy' => "VARCHAR(100)"),
+ 'adhocNumber' =>array('create' => "VARCHAR(45) NULL DEFAULT NULL AFTER `namedpickupgroup`"),
+ 'meetme' =>array('create' => "VARCHAR(5) NULL DEFAULT NULL AFTER `adhocNumber`"),
+ 'meetmenum' =>array('create' => "VARCHAR(45) NULL DEFAULT NULL AFTER `meetme`"),
+ 'meetmeopts' =>array('create' => "VARCHAR(45) NULL DEFAULT NULL AFTER `meetmenum`"),
+ 'regexten' =>array('create' => "VARCHAR(45) NULL DEFAULT NULL AFTER `meetmeopts`"),
+ 'rtptos' => array('drop' => "yes"),
+ 'audio_tos' => array('drop' => "yes"),
+ 'audio_cos' => array('drop' => "yes"),
+ 'video_tos' => array('drop' => "yes"),
+ 'video_cos' => array('drop' => "yes"),
+ 'incominglimit' =>array('def_modyfy' => "2"),
+ 'transfer' =>array('def_modyfy' => "on"),
+ 'vmnum' =>array('def_modyfy' => "*97"),
+ 'musicclass' =>array('def_modyfy' => "default"),
+ 'echocancel' =>array('def_modyfy' => "on"),
+ 'silencesuppression' =>array('def_modyfy' => "off"),
+ 'dndFeature' =>array('create' => 'VARCHAR( 12 ) DEFAULT "on" AFTER `amaflags`', 'modyfy' => "VARCHAR(12)", 'def_modyfy' =>"on"),
+ 'dnd' =>array('create' => 'VARCHAR( 12 ) DEFAULT "reject" AFTER `amaflags`', 'modyfy' => "VARCHAR(12)", 'def_modyfy' =>"reject")
+ )
+ );
+
$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT" : "AUTO_INCREMENT";
-$table_req = array('sccpdevice', 'sccpline', 'buttonconfig', 'sccpdeviceconfig');
+$table_req = array('sccpdevice', 'sccpline', 'buttonconfig');
$sql = <<< END
CREATE TABLE IF NOT EXISTS `sccpsettings` (
@@ -31,7 +149,8 @@ foreach ($table_req as $value) {
// 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(_("none, creating table: " . $value));
+ die("!!!! Instalation error. Can not find required ".$value." table !!!!!!\n");
+// die_freepbx("!!!! Instalation error. Can not find required ".$value." table !!!!!!\n");
}
}
@@ -39,6 +158,11 @@ foreach ($table_req as $value) {
$version = FreePBX::Config()->get('ASTVERSION');
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"');
+}
+
if (!empty($version)) {
// Woo, we have a version
if (version_compare($version, "12.2.0", ">=")) {
@@ -47,16 +171,43 @@ if (!empty($version)) {
} else {
// Well. I don't know what version of Asterisk I'm running.
// Assume less than 12.
+
$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;
+ }
+ }
+
+// test
+// $sccp_ver = 0;
+// $db_config = $db_config_v0;
+// test
out(_("none, creating table"));
$check = $db->query($sql);
-// sql($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 '',
@@ -75,69 +226,86 @@ if (!empty($version)) {
if (db::IsError($check)) {
die_freepbx("Can not create sccpsettings table\n");
}
- if ($db->getAll('SHOW COLUMNS FROM sccpdevice WHERE FIELD = "pickupexten"')) {
- out(_("none, modify table from old scheme"));
- $sql = "ALTER TABLE `sccpdevice`
- CHANGE COLUMN `pickupexten` `directed_pickup` VARCHAR(5) NULL DEFAULT 'yes',
- CHANGE COLUMN `pickupcontext` `directed_pickup_context` VARCHAR(100) NULL DEFAULT '' ,
- CHANGE COLUMN `pickupmodeanswer` `directed_pickup_modeanswer` VARCHAR(5) NULL DEFAULT 'yes'";
- $check = $db->query($sql);
- if (DB::IsError($check)) {
- die_freepbx("Can not add loadinformationid into sccpdevmodel table\n");
- }
- }
-
+ out(_("none, Modify DB schama"));
- if (!$db->getAll('SHOW COLUMNS FROM sccpdevmodel WHERE FIELD = "loadinformationid"')) {
- out(_("none, modify table from old scheme"));
- $sql = "ALTER TABLE `sccpdevmodel` ADD `loadinformationid` varchar(30);";
- $check = $db->query($sql);
- if (DB::IsError($check)) {
- die_freepbx("Can not add loadinformationid into sccpdevmodel table\n");
+ foreach ($db_config as $tabl_name => &$tab_modify) {
+// 0 - name 1-type 4- default
+ $sql = "DESCRIBE ".$tabl_name."";
+ $db_result= $db->getAll($sql);
+ if (DB::IsError($db_result)) {
+ die_freepbx("Can not add get informations from ".$tabl_name." table\n");
+ }
+ foreach ($db_result as $tabl_data){
+ $fld_id = $tabl_data[0];
+ if (!empty($tab_modify[$fld_id])) {
+ $db_config[$tabl_name][$fld_id]['status'] = 'yes';
+ if (!empty($tab_modify[$fld_id]['def_modyfy'])) {
+ if (strtoupper($tab_modify[$fld_id]['def_modyfy']) == strtoupper($tabl_data[4])) {
+ $db_config[$tabl_name][$fld_id]['def_mod_stat'] = 'no';
+ }
+ if ( strtoupper ($tab_modify[$fld_id]['modyfy']) == strtoupper($tabl_data[1])) {
+ $db_config[$tabl_name][$fld_id]['mod_stat'] = 'no';
+ }
+ }
+ if (!empty($tab_modify[$fld_id]['rename'])) {
+ $fld_id_source = $tab_modify[$fld_id]['rename'];
+ $db_config[$tabl_name][$fld_id_source]['status'] = 'yes';
+ $db_config[$tabl_name][$fld_id]['create'] = $db_config[$tabl_name][$fld_id_source]['create'];
+ }
+ }
+ }
+ $sql_create ='';
+ $sql_modify ='';
+
+ foreach ($tab_modify as $row_fld => $row_data){
+ if (empty($row_data['status'])) {
+ if (!empty($row_data['create'])) {
+ $sql_create .='ADD COLUMN `'.$row_fld.'` '. $row_data['create'].', ';
+ }
+ } else {
+ if (!empty($row_data['rename'])) {
+ $sql_modify .= 'CHANGE COLUMN `'.$row_fld.'` `'. $row_data['rename'].'` '.$row_data['create'].', ';
+
+ }
+ if (!empty($row_data['modyfy'])) {
+ if (empty($row_data['mod_stat'])) {
+ if (!empty($row_data['create'])) {
+ $sql_modify .= "CHANGE COLUMN `".$row_fld."` `".$row_fld."` ".$row_data['create'].", ";
+ } else {
+ $sql_modify .= "CHANGE COLUMN `".$row_fld."` `".$row_fld."` ".$row_data['modyfy']." DEFAULT '".$row_data['def_modyfy']."', ";
+ }
+ $row_data['def_mod_stat'] = 'no';
+ }
+ }
+ if (!empty($row_data['def_modyfy'])) {
+ if (empty($row_data['def_mod_stat'])) {
+ $sql_modify .= "ALTER COLUMN `".$row_fld."` SET DEFAULT '".$row_data['def_modyfy']."', ";
+ }
+ }
+ if (!empty($row_data['drop'])) {
+ $sql_create .='DROP COLUMN `'.$row_fld.'`, ';
+ }
+
+ }
+ }
+ if (!empty($sql_create)) {
+ $sql_create = "ALTER TABLE `".$tabl_name."` ". substr($sql_create,0,-2);
+ $check = $db->query($sql_create);
+ if (db::IsError($check)) {
+ die_freepbx("Can not create ".$tabl_name." table sql: ".$sql_create."n");
+ die_freepbx("Can not create ".$tabl_name." table\n");
+ }
+
+ }
+ if (!empty($sql_modify)) {
+ $sql_modify = "ALTER TABLE `".$tabl_name."` ". substr($sql_modify,0,-2);
+ $check = $db->query($sql_modify);
+ if (db::IsError($check)) {
+ die_freepbx("Can not modify ".$tabl_name." table sql: ".$sql_modify."n");
+ die_freepbx("Can not modify ".$tabl_name." table\n");
+ }
}
}
- if (!$db->getAll('SHOW COLUMNS FROM sccpdevmodel WHERE FIELD = "nametemplet"')) {
- out(_("none, modify table from old scheme"));
- $sql = "ALTER TABLE `sccpdevmodel` ADD COLUMN `enabled` INT(2) NULL DEFAULT '0', ADD COLUMN `nametemplet` VARCHAR(50) NULL DEFAULT NULL,";
- $check = $db->query($sql);
- if (DB::IsError($check)) {
- die_freepbx("Can not add loadinformationid into sccpdevmodel table\n");
- }
- }
- if (!$db->getAll('SHOW COLUMNS FROM sccpdevice WHERE FIELD = "hwlang"')) {
- out(_("none, modify table from old scheme"));
- $sql = "ALTER TABLE `sccpdevice` ADD COLUMN `hwlang` varchar(12) NULL DEFAULT NULL,
- ADD COLUMN `useRedialMenu` VARCHAR(5) NULL DEFAULT 'no' AFTER `hwlang`
- ";
- $check = $db->query($sql);
- if (DB::IsError($check)) {
- die_freepbx("Can not add loadinformationid into sccpdevmodel table\n");
- }
- }
- if (!$db->getAll('SHOW COLUMNS FROM sccpdevice WHERE FIELD = "dtmfmode"')) {
- out(_("none, modify table from old scheme"));
- $sql = "ALTER TABLE `sccpdevice` ADD COLUMN `dtmfmode` varchar(10) default NULL";
- $check = $db->query($sql);
- if (DB::IsError($check)) {
- die_freepbx("Can not add loadinformationid into sccpdevmodel table\n");
- }
- }
- if (!$db->getAll('SHOW COLUMNS FROM sccpline WHERE FIELD = "adhocNumber"')) {
- out(_("none, modify sccpline table from old scheme"));
- $sql = "ALTER TABLE `sccpline`
- ADD COLUMN `namedcallgroup` VARCHAR(45) NULL DEFAULT NULL AFTER `setvar`,
- ADD COLUMN `namedpickupgroup` VARCHAR(45) NULL DEFAULT NULL AFTER `namedcallgroup`,
- ADD COLUMN `adhocNumber` VARCHAR(45) NULL DEFAULT NULL AFTER `namedpickupgroup`,
- ADD COLUMN `meetme` VARCHAR(5) NULL DEFAULT NULL AFTER `adhocNumber`,
- ADD COLUMN `meetmenum` VARCHAR(45) NULL DEFAULT NULL AFTER `meetme`,
- ADD COLUMN `meetmeopts` VARCHAR(45) NULL DEFAULT NULL AFTER `meetmenum`,
- ADD COLUMN `regexten` VARCHAR(45) NULL DEFAULT NULL AFTER `meetmeopts`;";
- $check = $db->query($sql);
- if (DB::IsError($check)) {
- die_freepbx("Can not add loadinformationid into sccpdevmodel table\n");
- }
- }
-
out(_("none, Uptade Table Info"));
@@ -152,41 +320,13 @@ if (!empty($version)) {
if (DB::IsError($check)) {
die_freepbx("Can not REPLACE defaults into sccpdevmodel table\n");
}
-
- $sql = "ALTER TABLE sccpline
- ALTER COLUMN incominglimit SET DEFAULT '2',
- ALTER COLUMN transfer SET DEFAULT 'on',
- ALTER COLUMN vmnum SET DEFAULT '*97',
- ALTER COLUMN musicclass SET DEFAULT 'default',
- ALTER COLUMN echocancel SET DEFAULT 'on',
- ALTER COLUMN silencesuppression SET DEFAULT 'off',
- CHANGE COLUMN `dnd` `dnd` VARCHAR(12) NULL DEFAULT 'off'
- ";
-
+
+ $sql = 'UPDATE `sccpdevice` set audio_tos="0xB8",audio_cos="6",video_tos="0x88",video_cos="5" where audio_tos=NULL or audio_tos="";';
$check = $db->query($sql);
if (DB::IsError($check)) {
- die_freepbx("Can not modify sccpline table\n");
- }
-
- $sql = "ALTER TABLE sccpdevice
- ALTER COLUMN transfer SET DEFAULT 'on',
- ALTER COLUMN cfwdall SET DEFAULT 'on',
- ALTER COLUMN cfwdbusy SET DEFAULT 'on',
- ALTER COLUMN dtmfmode SET DEFAULT 'outofband',
- ALTER COLUMN dndFeature SET DEFAULT 'on',
- ALTER COLUMN directrtp SET DEFAULT 'off',
- ALTER COLUMN earlyrtp SET DEFAULT 'progress',
- ALTER COLUMN mwilamp SET DEFAULT 'on',
- ALTER COLUMN mwioncall SET DEFAULT 'on',
- ALTER COLUMN private SET DEFAULT 'on',
- ALTER COLUMN privacy SET DEFAULT 'off',
- ALTER COLUMN nat SET DEFAULT 'off',
- ALTER COLUMN softkeyset SET DEFAULT 'softkeyset'
- ";
- $check = $db->query($sql);
- if (DB::IsError($check)) {
- die_freepbx("Can not modify sccpdevice table\n");
+ die_freepbx("Can not REPLACE defaults into sccpdevice table\n");
}
+
$sql = "DROP TRIGGER IF EXISTS trg_buttonconfig;
DELIMITER $$
CREATE TRIGGER trg_buttonconfig BEFORE INSERT ON buttonconfig
@@ -204,7 +344,7 @@ if (!empty($version)) {
if (DB::IsError($check)) {
die_freepbx("Can not modify sccpdevice table\n");
}
- $sql = "CREATE OR REPLACE
+ $sql_v3 = "CREATE OR REPLACE
ALGORITHM = MERGE
VIEW sccpdeviceconfig AS
SELECT GROUP_CONCAT( CONCAT_WS( ',', buttonconfig.type, buttonconfig.name, buttonconfig.options )
@@ -213,30 +353,35 @@ if (!empty($version)) {
FROM sccpdevice
LEFT JOIN buttonconfig ON ( buttonconfig.device = sccpdevice.name )
GROUP BY sccpdevice.name;";
+
- $sql = "CREATE OR REPLACE
- ALGORITHM = MERGE
+ $sql_v0 = "CREATE OR REPLACE
+ ALGORITHM = MERGE
VIEW sccpdeviceconfig AS
+
SELECT GROUP_CONCAT( CONCAT_WS( ',', buttonconfig.type, buttonconfig.name, buttonconfig.options )
ORDER BY instance ASC
SEPARATOR ';' ) AS button,
`sccpdevice`.`type` AS `type`,`sccpdevice`.`addon` AS `addon`,`sccpdevice`.`description` AS `description`,`sccpdevice`.`tzoffset` AS `tzoffset`,
`sccpdevice`.`transfer` AS `transfer`,`sccpdevice`.`cfwdall` AS `cfwdall`,`sccpdevice`.`cfwdbusy` AS `cfwdbusy`,`sccpdevice`.`imageversion` AS `imageversion`,
`sccpdevice`.`deny` AS `deny`,`sccpdevice`.`permit` AS `permit`,`sccpdevice`.`dndFeature` AS `dndFeature`,`sccpdevice`.`directrtp` AS `directrtp`,
- `sccpdevice`.`earlyrtp` AS `earlyrtp`,`sccpdevice`.`mwilamp` AS `mwilamp`,`sccpdevice`.`mwioncall` AS `mwioncall`,`sccpdevice`.`directed_pickup` AS `directed_pickup`,
- `sccpdevice`.`directed_pickup_context` AS `directed_pickup_context`,`sccpdevice`.`directed_pickup_modeanswer` AS `directed_pickup_modeanswer`,
- `sccpdevice`.`private` AS `private`,`sccpdevice`.`privacy` AS `privacy`,`sccpdevice`.`nat` AS `nat`,`sccpdevice`.`softkeyset` AS `softkeyset`,
- `sccpdevice`.`audio_tos` AS `audio_tos`,`sccpdevice`.`audio_cos` AS `audio_cos`,`sccpdevice`.`video_tos` AS `video_tos`,`sccpdevice`.`video_cos` AS `video_cos`,
- `sccpdevice`.`conf_allow` AS `conf_allow`,`sccpdevice`.`conf_play_general_announce` AS `conf_play_general_announce`,
- `sccpdevice`.`conf_play_part_announce` AS `conf_play_part_announce`,`sccpdevice`.`conf_mute_on_entry` AS `conf_mute_on_entry`,
- `sccpdevice`.`conf_music_on_hold_class` AS `conf_music_on_hold_class`,`sccpdevice`.`conf_show_conflist` AS `conf_show_conflist`,
- `sccpdevice`.`setvar` AS `setvar`,`sccpdevice`.`disallow` AS `disallow`,`sccpdevice`.`allow` AS `allow`,`sccpdevice`.`backgroundImage` AS `backgroundImage`,
- `sccpdevice`.`ringtone` AS `ringtone`,`sccpdevice`.`name` AS `name`,`sccpdevice`.`dtmfmode` AS `dtmfmode`,`sccpdevice`.`useRedialMenu` AS `useRedialMenu`
+ `sccpdevice`.`earlyrtp` AS `earlyrtp`,`sccpdevice`.`mwilamp` AS `mwilamp`,`sccpdevice`.`mwioncall` AS `mwioncall`,`sccpdevice`.`pickupexten` AS `pickupexten`,
+ `sccpdevice`.`pickupcontext` AS `pickupcontext`,`sccpdevice`.`pickupmodeanswer` AS `pickupmodeanswer`,`sccpdevice`.`private` AS `private`,
+ `sccpdevice`.`privacy` AS `privacy`,`sccpdevice`.`nat` AS `nat`,`sccpdevice`.`softkeyset` AS `softkeyset`,`sccpdevice`.`audio_tos` AS `audio_tos`,
+ `sccpdevice`.`audio_cos` AS `audio_cos`,`sccpdevice`.`video_tos` AS `video_tos`,`sccpdevice`.`video_cos` AS `video_cos`,`sccpdevice`.`conf_allow` AS `conf_allow`,
+ `sccpdevice`.`conf_play_general_announce` AS `conf_play_general_announce`,`sccpdevice`.`conf_play_part_announce` AS `conf_play_part_announce`,
+ `sccpdevice`.`conf_mute_on_entry` AS `conf_mute_on_entry`,`sccpdevice`.`conf_music_on_hold_class` AS `conf_music_on_hold_class`,
+ `sccpdevice`.`conf_show_conflist` AS `conf_show_conflist`,`sccpdevice`.`setvar` AS `setvar`,`sccpdevice`.`disallow` AS `disallow`,
+ `sccpdevice`.`allow` AS `allow`,`sccpdevice`.`backgroundImage` AS `backgroundImage`,`sccpdevice`.`ringtone` AS `ringtone`,`sccpdevice`.`name` AS `name`
FROM sccpdevice
LEFT JOIN buttonconfig ON ( buttonconfig.device = sccpdevice.name )
GROUP BY sccpdevice.name;";
- $check = $db->query($sql);
+ if ($sccp_ver == 11) {
+ $check = $db->query($sql_v3);
+ } else {
+ $check = $db->query($sql_v0);
+ }
if (DB::IsError($check)) {
die_freepbx("Can not modify sccpdevice table\n");
}
diff --git a/module.xml b/module.xml
index 561425a..7159645 100644
--- a/module.xml
+++ b/module.xml
@@ -1,7 +1,7 @@
sccp_managerSCCP Manager
- 13.0.0.1
+ 13.0.0.2setupSCCP ConnectivityAlex GP
@@ -13,6 +13,7 @@
* Version 13.0.0.1 * - Alfa Release tested on freepbx v.13.0.192.16, v.14.0.1.5
+ * Version 13.0.0.2 * - Release tested
diff --git a/views/form.adddevice.php b/views/form.adddevice.php
index 344bba5..53556e0 100644
--- a/views/form.adddevice.php
+++ b/views/form.adddevice.php
@@ -20,7 +20,7 @@ if (!empty($_REQUEST['id'])) {
$val = str_replace('SEP', '', $val);
$val = implode('.',sscanf($val, '%4s%4s%4s')); // Convert to Cisco display Format
break;
- case 'hwlang':
+ case '_hwlang':
$tmpar = explode(":",$val);
$def_val['netlang'] = array("keyword" => 'netlang', "data" => $tmpar[0], "seq" => "99");
$def_val['devlang'] = array("keyword" => 'devlang', "data" => $tmpar[1], "seq" => "99");
diff --git a/views/server.setting.php b/views/server.setting.php
index e3265ea..4267192 100644
--- a/views/server.setting.php
+++ b/views/server.setting.php
@@ -7,9 +7,28 @@
// vim: set ai ts=4 sw=4 ft=phtml:
// $var_hw_config = $this->get_db_SccpTableData("get_sccpdevice_byid", array('id' => 'SEPB8BEBF224790'));
+ global $astman;
+ $ast_out = $astman->Command("sccp show version");
+ if (preg_match("/Release.*\(/", $ast_out['data'] , $matches)) {
+ $ast_out = explode(' ', substr($matches[0],9,-1));
+ $res = 0;
+ if ($ast_out[0] >= '4.3.0'){
+ $res = 1;
+ }
+ if (!empty($ast_out[1]) && $ast_out[1] == 'develop'){
+ $res = 10;
+ if (!empty($ast_out[3]) && $ast_out[3] >= '702487a'){
+ $res += 1;
+ }
+ } else {
+ $res = 0;
+ }
+ }
-
-
+print_r(base_convert('702487a', 16, 10));
+print_r(' ');
+print_r($version);
+print_r(' ');
?>