diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php
index 8ce4b99..92b7eaa 100644
--- a/Sccp_manager.class.php
+++ b/Sccp_manager.class.php
@@ -71,6 +71,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
private $sccp_driver_ver = '11.2';
private $tftpLang = array();
private $hint_context = '@ext-local'; /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Get it from Config !!!
+ private $val_null = 'NONE'; /// REPLACE to null Field
+
public $sccp_model_list = array();
private $cnf_wr = null;
public $sccppath = array();
@@ -636,7 +638,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
if (!empty($request[$value])) {
$save_settings[$value] = $request[$value];
} else {
- $save_settings[$value] = 'none';
+ $save_settings[$value] = $val_null; // null
}
}
$this->dbinterface->sccp_save_db('sccpdevmodel', $save_settings, $upd_mode, "model");
diff --git a/Sccp_manager.inc/dbinterface.class.php b/Sccp_manager.inc/dbinterface.class.php
index fc1aa11..89c62f7 100644
--- a/Sccp_manager.inc/dbinterface.class.php
+++ b/Sccp_manager.inc/dbinterface.class.php
@@ -8,6 +8,7 @@
namespace FreePBX\modules\Sccp_manager;
class dbinterface {
+ private $val_null = 'NONE'; /// REPLACE to null Field
public function __construct() {
}
@@ -160,7 +161,7 @@ class dbinterface {
if (!empty($sql_var)) {
$sql_var .= ', ';
}
- if ($data === 'none') {
+ if ($data === $this->val_null) {
$sql_var .= '`' . $key_v . '`=NULL';
} else {
$sql_var .= '`' . $key_v . '`="' . $data . '"';
diff --git a/conf/Sccp.class.php b/conf/Sccp.class.php
index 1896bc1..af13a09 100644
--- a/conf/Sccp.class.php
+++ b/conf/Sccp.class.php
@@ -52,8 +52,8 @@ class Sccp extends \FreePBX\modules\Core\Driver {
if (empty($settings['cid_num']['value'])) {
$settings['cid_num']['value']= $id;
}
- $sql = 'INSERT INTO sccpline (name, id';
- $sqlv = 'values ("'.$id.'", "'.$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'])){
@@ -78,7 +78,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
public function getDevice($id) {
$sccp_line = array();
- $sql = "SELECT name as id";
+ $sql = "SELECT name as id, name as name";
foreach($this->data_fld as $key => $val) {
$sql .= ',`'. $key .'` as '.$val;
}
diff --git a/conf/Sccp.class.php.v11 b/conf/Sccp.class.php.v11
index 2a2418e..67a55f3 100644
--- a/conf/Sccp.class.php.v11
+++ b/conf/Sccp.class.php.v11
@@ -68,8 +68,8 @@ class Sccp extends \FreePBX\modules\Core\Driver {
// die(print_r($settings));
- $sql = 'REPLACE INTO sccpline (name, id';
- $sqlv = 'values ("'.$id.'", "'.$id.'"';
+ $sql = 'REPLACE INTO sccpline (name';
+ $sqlv = 'values ("'.$id.'"';
foreach($this->data_fld as $key => $val) {
switch ($key) {
case 'secondary_dialtone_digits':
@@ -111,7 +111,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
public function getDevice($id) {
$sccp_line = array();
- $sql = "SELECT name as id";
+ $sql = "SELECT name as id, name as name ";
foreach($this->data_fld as $key => $val) {
$sql .= ',`'. $key .'` as '.$val;
}
@@ -203,11 +203,11 @@ class Sccp extends \FreePBX\modules\Core\Driver {
"flag" => $flag++
),
"transfer" => array(
- "value" => "yes",
+ "value" => "on",
"flag" => $flag++
),
"echocancel" => array(
- "value" => "yes",
+ "value" => "on",
"flag" => $flag++
),
"dnd" => array(
@@ -215,7 +215,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
"flag" => $flag++
),
"silencesuppression" => array(
- "value" => "no",
+ "value" => "off",
"flag" => $flag++
),
"musicclass" => array(
@@ -339,34 +339,34 @@ class Sccp extends \FreePBX\modules\Core\Driver {
unset($select);
- $select[] = array('value' => 'yes', 'text' => 'Yes');
- $select[] = array('value' => 'no', 'text' => 'No');
+ $select[] = array('value' => 'on', 'text' => 'Yes');
+ $select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Allow call transfer.");
// $tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section, 'category' => 'general');
- $tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
+ $tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => 'on', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
- $select[] = array('value' => 'yes', 'text' => 'Yes');
- $select[] = array('value' => 'no', 'text' => 'No');
+ $select[] = array('value' => 'on', 'text' => 'Yes');
+ $select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Echo cancel");
- $tmparr['echocancel'] = array('prompttext' => _('Echo cancel'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
+ $tmparr['echocancel'] = array('prompttext' => _('Echo cancel'), 'value' => 'on', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'off', 'text' => 'Off');
$select[] = array('value' => 'reject', 'text' => 'Reject');
$select[] = array('value' => 'silent', 'text' => 'Silent');
- $select[] = array('value' => '', 'text' => 'Cycle');
+ $select[] = array('value' => 'user', 'text' => 'Cycle');
$tt = _("DND: Means how will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / Cycle").' '.
_("Cycle - 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' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
+ $tmparr['dnd'] = array('prompttext' => _('DND'), 'value' => 'reject', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
- $select[] = array('value' => 'yes', 'text' => 'Yes');
- $select[] = array('value' => 'no', 'text' => 'No');
+ $select[] = array('value' => 'on', 'text' => 'Yes');
+ $select[] = array('value' => 'off', 'text' => 'No');
$tt = _("Silence Suppression. Asterisk Not suported");
- $tmparr['silencesuppression'] = array('prompttext' => _('Silence Suppression'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
+ $tmparr['silencesuppression'] = array('prompttext' => _('Silence Suppression'), 'value' => 'off', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section);
unset($select);
$select[] = array('value' => 'default', 'text' => _('default'));
@@ -380,7 +380,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
}
$tt = _("Music on hold");
- $tmparr['musicclass'] = array('prompttext' => _('Music on hold'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1, 'section' => $section);
+ $tmparr['musicclass'] = array('prompttext' => _('Music on hold'), 'value' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'section' => $section);
$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, 'section' => $section);
diff --git a/conf/sccpgeneral.xml b/conf/sccpgeneral.xml
index a697f54..d2cc65a 100644
--- a/conf/sccpgeneral.xml
+++ b/conf/sccpgeneral.xml
@@ -74,8 +74,8 @@ and open the template in the editor. Base Version before all crash :-)
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
-
+ NONE
+
@@ -88,8 +88,8 @@ and open the template in the editor. Base Version before all crash :-)
permit0.0.0.0/0.0.0.0
-
-
+
+ Allow network settings. Blank fields will be ignored, use Network 0.0.0.0.
@@ -98,8 +98,8 @@ and open the template in the editor. Base Version before all crash :-)
deny0.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'.
@@ -108,8 +108,8 @@ and open the template in the editor. Base Version before all crash :-)
localnet0.0.0.0/0.0.0.0
-
-
+
+ Local network settings. Blank fields will be ignored used Network 0.0.0.0.
@@ -477,14 +477,14 @@ and open the template in the editor. Base Version before all crash :-)
musicclass
- none
+ NONEform-controlMusic Class: Available MOH Classes. These are the MOH classes listed in your current server.dial_template
- none
+ NONEsccp-customHelp.
@@ -586,7 +586,7 @@ and open the template in the editor. Base Version before all crash :-)
addon
- none
+ NONEhw_select sccp-customAddon: 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.
@@ -628,7 +628,7 @@ and open the template in the editor. Base Version before all crash :-)
addon
- none
+ NONEsccp-custom
@@ -836,8 +836,8 @@ and open the template in the editor. Base Version before all crash :-)
permit/
-
-
+
+ Allow network settings. Blank fields will be ignored used Network 0.0.0.0.
@@ -846,8 +846,8 @@ and open the template in the editor. Base Version before all crash :-)
deny/
-
-
+
+ All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'.
@@ -875,8 +875,8 @@ and open the template in the editor. Base Version before all crash :-)
-
- The audio stream will be open in the progress and connected state. Valid options: none, progress, offhook, dial, ringout. Default may be Progress.
+
+ The audio stream will be open in the progress and connected state. Valid options: NONE, progress, offhook, dial, ringout. Default may be Progress.
@@ -896,11 +896,11 @@ and open the template in the editor. Base Version before all crash :-)
dialtemplate*/10/*title
-
-
+
+ text1
-
-
+
+
empty
Bellcore-Alerting
@@ -986,8 +986,8 @@ and open the template in the editor. Base Version before all crash :-)
srst_ip3/
-
-
+
+
@@ -996,8 +996,8 @@ and open the template in the editor. Base Version before all crash :-)
srst_sip3/
-
-
+
+
diff --git a/conf/sccpgeneral.xml.v11 b/conf/sccpgeneral.xml.v11
index 54b124b..ebb3637 100644
--- a/conf/sccpgeneral.xml.v11
+++ b/conf/sccpgeneral.xml.v11
@@ -75,8 +75,8 @@ and open the template in the editor. Base Version before all crash :-)
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
-
+ NONE
+
@@ -89,8 +89,8 @@ and open the template in the editor. Base Version before all crash :-)
permit0.0.0.0/0.0.0.0
-
-
+
+ Alow network settings. Blank fields will be ignored used Network 0.0.0.0.
@@ -99,8 +99,8 @@ and open the template in the editor. Base Version before all crash :-)
deny0.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'.
@@ -109,8 +109,8 @@ and open the template in the editor. Base Version before all crash :-)
localnet0.0.0.0/0.0.0.0
-
-
+
+ Local network settings. Blank fields will be ignored used Network 0.0.0.0.
@@ -201,27 +201,27 @@ and open the template in the editor. Base Version before all crash :-)
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
-
-
+ off
+
+
Echo Cancel: Echo Cancellation (On or Off).silencesuppression
- no
-
-
+ off
+
+
Silence Suppression: Slience Suppression on the phone.private
- yes
-
-
+ on
+
+
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
-
-
+ off
+
+
Directed Pickup Mode (Answer): If a call is sent with the "directed pickup" flag, the phone will answer when set to "Yes".callanswerorder
@@ -240,9 +240,9 @@ and open the template in the editor. Base Version before all crash :-)
Set the MWI lamp style when MWI active to on, off, wink, flash or blinkmwioncall
- no
-
-
+ off
+
+
Set the MWI on call.
@@ -250,9 +250,9 @@ and open the template in the editor. Base Version before all crash :-)
ntp_config_enabled
- no
-
-
+ off
+
+
Enabling NTP settings in device configuration.
@@ -310,7 +310,7 @@ and open the template in the editor. Base Version before all crash :-)
srst_Option
- no
+ off
@@ -343,8 +343,8 @@ and open the template in the editor. Base Version before all crash :-)
srst_ip3/
-
-
+
+ Help.
@@ -353,8 +353,8 @@ and open the template in the editor. Base Version before all crash :-)
srst_sip3/
-
-
+
+ Help.
@@ -502,9 +502,9 @@ and open the template in the editor. Base Version before all crash :-)
hotline_enabled
- no
-
-
+ off
+
+
Hotline Enabled: This allows unregistered extensions to connect to the system and dial the number listed below.
@@ -549,14 +549,14 @@ and open the template in the editor. Base Version before all crash :-)
musicclass
- none
+ NONEform-controlMusic Class: Available MOH Classes. These are the MOH classes listed in your current server.dial_template
- none
+ NONEsccp-customHelp.
@@ -564,15 +564,15 @@ and open the template in the editor. Base Version before all crash :-)
autoselectline_enabled
- no
-
-
+ off
+
+
Enables and disables auto line selection.meetme
- no
-
-
+ off
+
+
enable/disable conferencing via meetme (on/off), make sure you have one of the meetme apps mentioned below activated in module.conf
@@ -587,15 +587,15 @@ and open the template in the editor. Base Version before all crash :-)
autocall_select
- no
-
-
+ off
+
+
backgroundImageAccess
- no
-
-
+ off
+
+
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.
@@ -629,9 +629,9 @@ and open the template in the editor. Base Version before all crash :-)
createlangdir
- no
-
-
+ off
+
+
Say 'yes' if you need to create cisco default language directory in tftp path.
@@ -658,7 +658,7 @@ and open the template in the editor. Base Version before all crash :-)
addon
- none
+ NONEhw_select sccp-customAddon: 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.
@@ -700,7 +700,7 @@ and open the template in the editor. Base Version before all crash :-)
addon
- none
+ NONEsccp-custom
@@ -774,44 +774,44 @@ and open the template in the editor. Base Version before all crash :-)
transfer
- no
-
-
+ off
+
+
Transfer allowedcfwdall
- no
-
-
+ off
+
+
Activate the callforward softkeys. Default is Oncfwdbusy
- no
-
-
+ off
+
+
Activate the callforward busy softkeys. Default is On
- DND
+ dndFeature
- On
+ onDo Not Disturb. Default is Offdirected_pickup
- yes
+ onno
-
-
+
+
Enable Pickup function to direct pickup an extension. Default is Onconf_allow
- yes
+ onno
-
-
+
+
Allow the use of conference
@@ -827,9 +827,9 @@ and open the template in the editor. Base Version before all crash :-)
Context where direct pickup search for extensions. if not set current contect will be use.directed_pickup_modeanswer
- yes
-
-
+ on
+
+
On (Default)= the call has been answered when picked up. Off = call manager way, the phone who picked up the call rings the callOptions: 'Immediate Answer' or 'Show CallerID' ??????
@@ -838,13 +838,13 @@ and open the template in the editor. Base Version before all crash :-)
useRedialMenu
- no
-
-
+ off
+
+
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.
-
+ dtmfmodeoutofband
@@ -871,33 +871,33 @@ and open the template in the editor. Base Version before all crash :-)
conf_play_general_announce
- yes
-
-
+ on
+
+
Playback General Announcements (like: 'You are Entering/Leaving the conference')conf_play_part_announce
- yes
-
-
+ on
+
+
Playback Personal/Participant Announcements, (like: 'You have been muted / You have been kicked')conf_mute_on_entry
- no
-
-
+ off
+
+
Mute new participants from the startconf_show_conflist
- yes
-
-
+ on
+
+
Automatically show conference list to the moderator
@@ -916,8 +916,8 @@ and open the template in the editor. Base Version before all crash :-)
permit/
-
-
+
+ Alow network settings. Blank fields will be ignored used Network 0.0.0.0.
@@ -926,16 +926,16 @@ and open the template in the editor. Base Version before all crash :-)
deny/
-
-
+
+ All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'.nat
- none
-
+ auto
+
Device NAT support (default Auto)
@@ -944,8 +944,8 @@ and open the template in the editor. Base Version before all crash :-)
directrtp
- none
-
+ NONE
+
This option allow devices to do direct RTP sessions (default Off)
@@ -954,13 +954,13 @@ and open the template in the editor. Base Version before all crash :-)
earlyrtpnone
-
-
Immediate
-
+
+
-
- The audio strem will be open in the progress and connected state. Valid options: none, progress, offhook, dial, ringout. Default may be Progress.
+
+
+ The audio strem will be open in the progress and connected state. Valid options: NONE, progress, offhook, dial, ringout. Default may be Progress.
@@ -1004,11 +1004,11 @@ and open the template in the editor. Base Version before all crash :-)
dialtemplate*/10/*title
-
-
+
+ text1
-
-
+
+
empty
Bellcore-Alerting
diff --git a/install.php b/install.php
index 733d163..f896ca5 100644
--- a/install.php
+++ b/install.php
@@ -41,6 +41,7 @@ function astman_retrieveJSFromMetaData($astman, $segment = "") {
}
}
+function Get_DB_config($sccp_comatable) {
$db_config_v0 = array(
'sccpdevmodel' => array(
'enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
@@ -94,7 +95,7 @@ $db_config_v0 = array(
)
);
-$db_config_v3 = array(
+$db_config_v5 = array(
'sccpdevmodel' => array(
'enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
'nametemplate' => array('create' => 'VARCHAR(50) NULL DEFAULT NULL'),
@@ -161,13 +162,98 @@ $db_config_v3 = array(
)
);
+$db_config_v3 = array(
+ 'sccpdevmodel' => array(
+ 'enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
+ 'nametemplate' => 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' => " enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"),
+ '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'", 'modify' => "VARCHAR(10)", 'def_modify'=> 'outofband'),
+ 'dtmfmode' => array('drop' => "yes"),
+
+ 'deny' => array('create' => 'VARCHAR(100) NULL DEFAULT NULL','modify' => "VARCHAR(100)"),
+ 'permit' => array('create' => 'VARCHAR(100) NULL DEFAULT NULL','modify' => "VARCHAR(100)"),
+ 'backgroundImage' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL','modify' => "VARCHAR(255)"),
+ 'ringtone' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL','modify' => "VARCHAR(255)"),
+
+ 'transfer' =>array('create' => "enum('on','off') NOT NULL default 'on'",'modify' => "enum('on','off')"),
+ 'cfwdall' =>array('create' => "enum('on','off') NOT NULL default 'on'",'modify' => "enum('on','off')"),
+ 'cfwdbusy' =>array('create' => "enum('on','off') NOT NULL default 'on'",'modify' => "enum('on','off')"),
+ 'directrtp' =>array('create' => "enum('on','off') NULL default 'off'",'modify' => "enum('on','off')"),
+ 'dndFeature' =>array('create' => "enum('on','off') NOT NULL default 'on'",'modify' => "enum('on','off')"),
+ 'earlyrtp' =>array('create' => "enum('immediate','offHook','dialing','ringout','progress','none') NOT NULL default 'progress'",'modify' => "enum('immediate','offHook','dialing','ringout','progress','none')"),
+ 'audio_tos'=>array('def_modify' => "0xB8"),
+ 'audio_cos'=>array('def_modify' => "6"),
+ 'video_tos'=>array('def_modify' => "0x88"),
+ 'video_cos'=>array('def_modify' => "5"),
+ 'trustphoneip'=>array('drop' => "yes"),
+
+ 'mwilamp' =>array('create' => "enum('on','off','wink','flash','blink') default 'on'",'modify' => "enum('on','off','wink','flash','blink')"),
+ 'mwioncall' =>array('create' => "enum('on','off') NOT NULL default 'on'",'modify' => "enum('on','off')"),
+ 'private' =>array('create' => "enum('on','off') NOT NULL default 'off'",'modify' => "enum('on','off')"),
+ 'privacy' =>array('create' => "enum('full','on','off') NOT NULL default 'full'",'modify' => "enum('full','on','off')"),
+ 'nat' =>array('create' => "enum('on','off','auto') NOT NULL default 'auto'",'modify' => "enum('on','off','auto')"),
+ 'conf_allow' =>array('create' => "enum('on','off') NOT NULL default 'on'",'modify' => "enum('on','off')"),
+ 'conf_play_part_announce' =>array('create' => "enum('on','off') NOT NULL default 'on'",'modify' => "enum('on','off')"),
+ 'conf_mute_on_entry' =>array('create' => "enum('on','off') NOT NULL default 'off'",'modify' => "enum('on','off')"),
+ 'conf_show_conflist' =>array('create' => "enum('on','off') NOT NULL default 'on'",'modify' => "enum('on','off')"),
+
+ 'type' =>array('create' => 'VARCHAR(15) NULL DEFAULT NULL','modify' => "VARCHAR(15)"),
+ 'imageversion' =>array('create' => 'VARCHAR(31) NULL DEFAULT NULL','modify' => "VARCHAR(31)"),
+
+ 'softkeyset' =>array('def_modify' => "softkeyset")
+ ),
+ 'sccpline' => array(
+ 'namedcallgroup' =>array('create' => "VARCHAR(100) NULL DEFAULT NULL AFTER `setvar`", 'modify' => "VARCHAR(100)"),
+ 'namedpickupgroup' =>array('create' => "VARCHAR(100) NULL DEFAULT NULL AFTER `namedcallgroup`", 'modify' => "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_modify' => "2"),
+ 'transfer' =>array('create' => "enum('on','off') NOT NULL default 'on'",'modify' => "enum('on','off')"),
+ 'vmnum' =>array('def_modify' => "*97"),
+ 'musicclass' =>array('def_modify' => "default"),
+ 'id' =>array('create' => 'MEDIUMINT(9) NOT NULL AUTO_INCREMENT, ADD UNIQUE(id);', 'modify' => "MEDIUMINT(9)",'index' =>'id'),
+// 'id' =>array('create' => 'VARCHAR( 20 ) NULL DEFAULT NULL', 'modify' => "VARCHAR(20)", 'def_modify' =>"NULL"),
+
+ 'echocancel' =>array('create' => "enum('on','off') NOT NULL default 'off'",'modify' => "enum('on','off')"),
+ 'silencesuppression' =>array('create' => "enum('on','off') NOT NULL default 'off'",'modify' => "enum('on','off')"),
+ 'dnd' => array('create' => "enum('off','reject','silent','user') NOT NULL default 'reject'", 'modify' => "enum('off','reject','silent','user')", 'def_modify' =>"reject")
+ )
+);
+ if ($sccp_comatable >= 11) {
+ return $db_config_v3;
+ } else {
+ return $db_config_v0;
+ }
+}
+
$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT" : "AUTO_INCREMENT";
$table_req = array('sccpdevice', 'sccpline', 'buttonconfig');
$ss = FreePBX::create()->Sccp_manager;
$astman = FreePBX::create()->astman;
-$sccp_ver = 0;
-$db_config = $db_config_v0;
+$sccp_comatable = 0;
+//$db_config = $db_config_v0;
+$db_config = '';
function CheckSCCPManagerDBTables($table_req) {
global $db;
@@ -210,69 +296,16 @@ function CheckAsteriskVersion() {
return $ver_compatible;
}
-function CheckChanSCCPVersion() {
- global $db_config, $db_config_v0, $db_config_v3, $srvinterface,$astman;
+function CheckChanSCCPСomatable() {
+ global $srvinterface,$astman;
if (!$astman) {
ie_freepbx('No asterisk manager connection provided!. Installation Failed');
}
- $sccp_ver = $srvinterface->get_comatable_sccp();
- outn("