-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.php
164 lines (147 loc) · 5.78 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
global $db;
$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT";
$sql = "CREATE TABLE IF NOT EXISTS `sccpdevmodel` (
`id` int(2) NOT NULL AUTO_INCREMENT,
`model` varchar(20) NOT NULL DEFAULT '',
`vendor` varchar(40) DEFAULT '',
`dns` int(2) DEFAULT '1',
`buttons` int(2) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1
";
$check = $db->query($sql);
if(DB::IsError($check)) {
die_freepbx("Can not create sccpdevmodel table\n");
}
$sql = "INSERT IGNORE INTO `sccpdevmodel` VALUES (1,'790X','CISCO',1,0),(2,'791X','CISCO',1,0),(3,'792X','CISCO',1,0),(4,'793X','CISCO',1,0),(5,'794X','CISCO',2,2),(6,'796X','CISCO',2,6),(7,'797X','CISCO',2,6),(8,'IP Communicator','CISCO',2,8)
";
$check = $db->query($sql);
if(DB::IsError($check)) {
die_freepbx("Can not insert into sccpdevmodel table\n");
}
$sql = "CREATE TABLE IF NOT EXISTS `sccpline` (
`id` varchar(45) default NULL,
`pin` varchar(45) default NULL,
`label` varchar(45) default NULL,
`description` varchar(45) default NULL,
`context` varchar(45) default NULL,
`incominglimit` varchar(45) default NULL,
`transfer` varchar(45) default NULL,
`mailbox` varchar(45) default NULL,
`vmnum` varchar(45) default NULL,
`cid_name` varchar(45) default NULL,
`cid_num` varchar(45) default NULL,
`trnsfvm` varchar(45) default NULL,
`secondary_dialtone_digits` varchar(45) default NULL,
`secondary_dialtone_tone` varchar(45) default NULL,
`musicclass` varchar(45) default NULL,
`language` varchar(45) default NULL,
`accountcode` varchar(45) default NULL,
`echocancel` varchar(45) default NULL,
`silencesuppression` varchar(45) default NULL,
`callgroup` varchar(45) default NULL,
`pickupgroup` varchar(45) default NULL,
`amaflags` varchar(45) default NULL,
`dnd` varchar(5) default 'on',
`setvar` varchar(50) default NULL,
`name` varchar(45) NOT NULL default '',
PRIMARY KEY (`name`)
) ENGINE=INNODB DEFAULT CHARSET=latin1;";
$check = $db->query($sql);
if(DB::IsError($check)) {
die_freepbx("Can not add sccpline 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',
ALTER COLUMN dnd SET DEFAULT 'on'
" ;
$check = $db->query($sql);
if(DB::IsError($check)) {
die_freepbx("Can not modify sccpline table\n");
}
$sql = "CREATE TABLE IF NOT EXISTS `sccpdevice` (
`type` varchar(45) default NULL,
`addon` varchar(45) default NULL,
`description` varchar(45) default NULL,
`tzoffset` varchar(5) default NULL,
`transfer` varchar(5) default 'on',
`cfwdall` varchar(5) default 'on',
`cfwdbusy` varchar(5) default 'on',
`dtmfmode` varchar(10) default NULL,
`imageversion` varchar(45) default NULL,
`deny` varchar(45) default NULL,
`permit` varchar(45) default NULL,
`dndFeature` varchar(5) default 'on',
`directrtp` varchar(3) default 'off',
`earlyrtp` varchar(8) default 'off',
`mwilamp` varchar(5) default 'on',
`mwioncall` varchar(5) default 'off',
`pickupexten` varchar(5) default 'on',
`pickupcontext` varchar(100) default '',
`pickupmodeanswer` varchar(5) default 'on',
`private` varchar(5) default 'off',
`privacy` varchar(100) default 'full',
`nat` varchar(15) default 'off',
`softkeyset` varchar(100) default '',
`audio_tos` varchar(11) default NULL,
`audio_cos` varchar(1) default NULL,
`video_tos` varchar(11) default NULL,
`video_cos` varchar(1) default NULL,
`conf_allow` varchar(3) default 'on',
`conf_play_general_announce` varchar(3) default 'on',
`conf_play_part_announce` varchar(3) default 'on',
`conf_mute_on_entry` varchar(3) default 'off',
`conf_music_on_hold_class` varchar(80) default 'default',
`setvar` varchar(100) default NULL,
`disallow` varchar(255) DEFAULT NULL,
`allow` varchar(255) DEFAULT NULL,
`backgroundImage` varchar(255) DEFAULT NULL,
`ringtone` varchar(255) DEFAULT NULL,
`name` varchar(15) NOT NULL default '',
PRIMARY KEY (`name`)
) ENGINE=INNODB DEFAULT CHARSET=latin1;";
$check = $db->query($sql);
if(DB::IsError($check)) {
die_freepbx("Can not add sccpdevice 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 pickupexten SET DEFAULT 'on',
ALTER COLUMN pickupmodeanswer 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");
}
$sql = "CREATE TABLE IF NOT EXISTS `buttonconfig` (
`device` varchar(15) NOT NULL default '',
`instance` tinyint(4) NOT NULL default '0',
`type` enum('line','speeddial','service','feature','empty') NOT NULL default 'line',
`name` varchar(36) default NULL,
`options` varchar(100) default NULL,
PRIMARY KEY (`device`,`instance`),
KEY `device` (`device`),
FOREIGN KEY (device) REFERENCES sccpdevice(name) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=INNODB DEFAULT CHARSET=latin1;";
$check = $db->query($sql);
if(DB::IsError($check)) {
die_freepbx("Can not add buttonconfig table\n");
}