Redefine defaults from db in sccp driver
This commit is contained in:
parent
310256dc5d
commit
2dad547e3d
|
@ -48,6 +48,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
"cbdisable" => false,
|
"cbdisable" => false,
|
||||||
"cbclass" => '')
|
"cbclass" => '')
|
||||||
);
|
);
|
||||||
|
private $line_defaults = array();
|
||||||
|
|
||||||
public function getInfo() {
|
public function getInfo() {
|
||||||
return array(
|
return array(
|
||||||
|
@ -105,6 +106,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
$sql = "DESCRIBE sccpline";
|
$sql = "DESCRIBE sccpline";
|
||||||
foreach ($this->database->query($sql) as $row) {
|
foreach ($this->database->query($sql) as $row) {
|
||||||
$tech[$row["Field"]]=$row["Field"];
|
$tech[$row["Field"]]=$row["Field"];
|
||||||
|
$this->line_defaults[$row["Field"]] = $row["Default"];
|
||||||
}
|
}
|
||||||
$sqlCol = 'name';
|
$sqlCol = 'name';
|
||||||
$sqlVal = "'{$id}'";
|
$sqlVal = "'{$id}'";
|
||||||
|
@ -170,15 +172,15 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
$dial = 'SCCP';
|
$dial = 'SCCP';
|
||||||
$settings = array(
|
$settings = array(
|
||||||
"mailbox" => array(
|
"mailbox" => array(
|
||||||
"value" => "",
|
"value" => $this->line_defaults['mailbox'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"pin" => array(
|
"pin" => array(
|
||||||
"value" => "",
|
"value" => $this->line_defaults['pin'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"incominglimit" => array(
|
"incominglimit" => array(
|
||||||
"value" => "",
|
"value" => $this->line_defaults['incominglimit'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"lcontext" => array(
|
"lcontext" => array(
|
||||||
|
@ -186,15 +188,15 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"callgroup" => array(
|
"callgroup" => array(
|
||||||
"value" => "",
|
"value" => $this->line_defaults['callgroup'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"namedcallgroup" => array(
|
"namedcallgroup" => array(
|
||||||
"value" => "",
|
"value" => $this->line_defaults['namedcallgroup'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"pickupgroup" => array(
|
"pickupgroup" => array(
|
||||||
"value" => "",
|
"value" => $this->line_defaults['pickupgroup'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"namedpickupgroup" => array(
|
"namedpickupgroup" => array(
|
||||||
|
@ -202,43 +204,43 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"transfer" => array(
|
"transfer" => array(
|
||||||
"value" => "on",
|
"value" => $this->line_defaults['transfer'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"adhocNumber" => array(
|
"adhocNumber" => array(
|
||||||
"value" => "",
|
"value" => $this->line_defaults['adhocNumber'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"echocancel" => array(
|
"echocancel" => array(
|
||||||
"value" => "no",
|
"value" => $this->line_defaults['echocancel'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"dnd" => array(
|
"dnd" => array(
|
||||||
"value" => "UserDefined",
|
"value" => $this->line_defaults['dnd'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"silencesuppression" => array(
|
"silencesuppression" => array(
|
||||||
"value" => "no",
|
"value" => $this->line_defaults['silencesuppression'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"secondary_dialtone_digits" => array(
|
"secondary_dialtone_digits" => array(
|
||||||
"value" => "9",
|
"value" => $this->line_defaults['secondary_dialtone_digits'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"secondary_dialtone_tone" => array(
|
"secondary_dialtone_tone" => array(
|
||||||
"value" => "0x22",
|
"value" => $this->line_defaults['secondary_dialtone_tone'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"musicclass" => array(
|
"musicclass" => array(
|
||||||
"value" => "default",
|
"value" => $this->line_defaults['musicclass'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"allow" => array(
|
"allow" => array(
|
||||||
"value" => "all",
|
"value" => $this->line_defaults['allow'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
"disallow" => array(
|
"disallow" => array(
|
||||||
"value" => "all",
|
"value" => $this->line_defaults['disallow'],
|
||||||
"flag" => $flag++
|
"flag" => $flag++
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -407,26 +409,23 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
$tmparr['secondary_dialtone_tone'] = array('prompttext' => _('Secondary dialtone'), 'value' => '0x22', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'select', 'section' => $section,'category' => $gn_category);
|
$tmparr['secondary_dialtone_tone'] = array('prompttext' => _('Secondary dialtone'), 'value' => '0x22', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'select', 'section' => $section,'category' => $gn_category);
|
||||||
|
|
||||||
unset($select);
|
unset($select);
|
||||||
$select[] = array('value' => '', 'text' => 'Inherit');
|
|
||||||
$select[] = array('value' => 'on', 'text' => 'Yes');
|
$select[] = array('value' => 'on', 'text' => 'Yes');
|
||||||
$select[] = array('value' => 'off', 'text' => 'No');
|
$select[] = array('value' => 'off', 'text' => 'No');
|
||||||
$tt = _("Enable/Disable the `directed` pickup softkey");
|
$tt = _("Enable/Disable the `directed` pickup softkey");
|
||||||
$tmparr['directed_pickup'] = array('prompttext' => _('Directed pickup'), 'value' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section,'category' => $gn_category);
|
$tmparr['directed_pickup'] = array('prompttext' => _('Directed pickup'), 'value' => $this->line_defaults['directed_pickup'], 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section,'category' => $gn_category);
|
||||||
|
|
||||||
unset($select);
|
unset($select);
|
||||||
$select[] = array('value' => '', 'text' => 'Inherit');
|
|
||||||
$select[] = array('value' => 'on', 'text' => 'Yes');
|
$select[] = array('value' => 'on', 'text' => 'Yes');
|
||||||
$select[] = array('value' => 'off', 'text' => 'No');
|
$select[] = array('value' => 'off', 'text' => 'No');
|
||||||
$tt = _("Should the picked/gpicked-up call be answered automatically");
|
$tt = _("Should the picked/gpicked-up call be answered automatically");
|
||||||
$tmparr['pickup_modeanswer'] = array('prompttext' => _('Pickup Modeanswer'), 'value' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section,'category' => $gn_category);
|
$tmparr['pickup_modeanswer'] = array('prompttext' => _('Pickup Modeanswer'), 'value' => $this->line_defaults['pickup_modeanswer'], 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section,'category' => $gn_category);
|
||||||
|
|
||||||
unset($select);
|
unset($select);
|
||||||
$select[] = array('value' => '', 'text' => 'Inherit');
|
|
||||||
$select[] = array('value' => 'on', 'text' => 'Yes');
|
$select[] = array('value' => 'on', 'text' => 'Yes');
|
||||||
$select[] = array('value' => 'off', 'text' => 'No');
|
$select[] = array('value' => 'off', 'text' => 'No');
|
||||||
$tt = _("Allow call transfer.");
|
$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, 'category' => 'general');
|
||||||
$tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => '', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section,'category' => $gn_category);
|
$tmparr['transfer'] = array('prompttext' => _('Call Transfer'), 'value' => $this->line_defaults['transfer'], 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio', 'section' => $section,'category' => $gn_category);
|
||||||
|
|
||||||
unset($select);
|
unset($select);
|
||||||
$select[] = array('value' => 'on', 'text' => 'Yes');
|
$select[] = array('value' => 'on', 'text' => 'Yes');
|
||||||
|
|
Loading…
Reference in a new issue