| 1 | update log set reedit = SUBSTRING(reedit,10); |
|---|
| 2 | update log set rerun = SUBSTRING(rerun,10); |
|---|
| 3 | alter table auth_user change column only_customer domainFilter varchar(255) not null; |
|---|
| 4 | alter table auth_user change column only_cscode codeFilter varchar(255) not null; |
|---|
| 5 | alter table auth_user change column only_cli aNumberFilter varchar(255) not null; |
|---|
| 6 | alter table auth_user change column only_after_date afterDateFilter varchar(255) not null; |
|---|
| 7 | alter table auth_user drop column only_cardservice; |
|---|
| 8 | alter table auth_user drop column only_cardclass; |
|---|
| 9 | |
|---|
| 10 | alter table active_sessions add column count bigint(20) unsigned NOT NULL default '0' after changed; |
|---|
| 11 | alter table radacct change column Rate Rate text not null; |
|---|
| 12 | |
|---|
| 13 | alter table radacct add column SipMethod varchar(50) not null after H323ConfID; |
|---|
| 14 | alter table radacct add column SipResponseCode smallint unsigned not null after SipMethod; |
|---|
| 15 | alter table radacct add column SipToTag varchar(255) not null after SipResponseCode; |
|---|
| 16 | alter table radacct add column SipFromTag varchar(255) not null after SipToTag; |
|---|
| 17 | alter table radacct add column SipTranslatedRequestURI varchar(255) NOT NULL after SipFromTag; |
|---|
| 18 | |
|---|
| 19 | INSERT INTO sip_status VALUES (422,'SessionTimerTooSmall','Client-Error'); |
|---|
| 20 | INSERT INTO sip_status VALUES (202,'Accepted','Success'); |
|---|
| 21 | INSERT INTO sip_status VALUES (489,'UnknownEvent','Client-Error'); |
|---|
| 22 | INSERT INTO sip_status VALUES (490,'RequestUpdated','Client-Error'); |
|---|
| 23 | INSERT INTO sip_status VALUES (580,'PreconditionFailure','Server-Error'); |
|---|
| 24 | INSERT INTO sip_status VALUES (421,'ExtensionRequired','Client-Error'); |
|---|
| 25 | |
|---|
| 26 | # v 1.4.4 |
|---|
| 27 | alter table auth_user change column display_card compidFilter varchar(255) not null; |
|---|
| 28 | alter table auth_user add column serviceFilter varchar(255) not null after codeFilter; |
|---|
| 29 | alter table auth_user change column codeFilter cscodeFilter varchar(255) not null; |
|---|
| 30 | |
|---|
| 31 | # v 1.5.3 |
|---|
| 32 | alter table radacct add column RemotePartyId varchar(255) not null ; |
|---|
| 33 | alter table radacct add column BillingPartyId varchar(255) not null ; |
|---|
| 34 | alter table radacct add column SIPAccount varchar(255) not null ; |
|---|
| 35 | |
|---|
| 36 | # v 1.6 |
|---|
| 37 | alter table cdrtool.destinations add column gateway varchar(50) not null after id; |
|---|
| 38 | alter table cdrtool.destinations add column domain varchar(50) not null after gateway; |
|---|
| 39 | alter table cdrtool.destinations add column subscriber varchar(50) not null after domain; |
|---|
| 40 | alter table cdrtool.billing_customers add column profileNGN varchar(10) not null; |
|---|
| 41 | |
|---|
| 42 | CREATE TABLE cdrtool.billing_profilesNGN ( |
|---|
| 43 | id bigint(20) unsigned NOT NULL auto_increment, |
|---|
| 44 | name varchar(25) NOT NULL default '', |
|---|
| 45 | rate varchar(25) NOT NULL default '', |
|---|
| 46 | application varchar(255) NOT NULL, |
|---|
| 47 | PRIMARY KEY (id), |
|---|
| 48 | KEY name_idx (name) |
|---|
| 49 | ) ; |
|---|
| 50 | |
|---|
| 51 | CREATE TABLE cdrtool.billing_ratesNGN ( |
|---|
| 52 | id bigint(20) unsigned NOT NULL auto_increment, |
|---|
| 53 | name varchar(25) NOT NULL default '', |
|---|
| 54 | TrafficRate varchar(25) NOT NULL default '', |
|---|
| 55 | ConnectCost varchar(255) NOT NULL, |
|---|
| 56 | PRIMARY KEY (id), |
|---|
| 57 | KEY name_idx (name) |
|---|
| 58 | ) ; |
|---|
| 59 | |
|---|
| 60 | # v 1.7 |
|---|
| 61 | CREATE TABLE ser.user_quota ( |
|---|
| 62 | id int(10) unsigned NOT NULL auto_increment, |
|---|
| 63 | username varchar(64) NOT NULL default '', |
|---|
| 64 | domain varchar(128) NOT NULL default '', |
|---|
| 65 | notify_address varchar(255) NOT NULL default '', |
|---|
| 66 | notified smallint unsigned not null, |
|---|
| 67 | cost varchar(128) NOT NULL default '', |
|---|
| 68 | traffic varchar(128) NOT NULL, |
|---|
| 69 | PRIMARY KEY (id), |
|---|
| 70 | INDEX sipuser (username, domain) |
|---|
| 71 | ); |
|---|
| 72 | |
|---|
| 73 | alter table radacct add index caller_idx (CallingStationId); |
|---|
| 74 | alter table radacct add index called_idx (CalledStationId); |
|---|
| 75 | |
|---|
| 76 | alter table radacct add column SipUserAgents varchar(255) NOT NULL after SipTranslatedRequestURI; |
|---|
| 77 | alter table radacct add column SipApplicationType varchar(255) NOT NULL after SipUserAgents; |
|---|
| 78 | alter table radacct add column SipCodecs varchar(255) NOT NULL after SipApplicationType; |
|---|
| 79 | |
|---|
| 80 | update radacct set SipToTag = H323ConfID; |
|---|
| 81 | update radacct set SipFromTag = H323CallOrigin; |
|---|
| 82 | update radacct set SipTranslatedRequestURI = H323RemoteAddress; |
|---|
| 83 | update radacct set SipMethod = H323CallType; |
|---|
| 84 | update radacct set SipResponseCode = H323DisconnectCause; |
|---|
| 85 | update radacct set SipCodecs = FramedProtocol; |
|---|
| 86 | update radacct set UserName= CONCAT(UserName,'@',Realm) where UserName not like '%@%'; |
|---|
| 87 | update radacct set SipUserAgents = NASPortType; |
|---|
| 88 | |
|---|
| 89 | alter table radacct drop column BillingPartyId; |
|---|
| 90 | alter table radacct drop column RemotePartyId; |
|---|
| 91 | |
|---|
| 92 | alter table radacct change column SipToTag SipToTag varchar(128) not null; |
|---|
| 93 | alter table radacct change column SipFromTag SipFromTag varchar(128) not null; |
|---|
| 94 | |
|---|
| 95 | alter table radacct drop index sess_id; |
|---|
| 96 | alter table radacct add unique sess_id(AcctSessionId(128),SipFromTag,SipToTag) |
|---|
| 97 | alter table radacct drop column H323GWID; |
|---|
| 98 | alter table radacct drop column H323CallOrigin; |
|---|
| 99 | alter table radacct drop column H323CallType; |
|---|
| 100 | alter table radacct drop column H323SetupTime; |
|---|
| 101 | alter table radacct drop column H323ConnectTime; |
|---|
| 102 | alter table radacct drop column H323DisconnectTime; |
|---|
| 103 | alter table radacct drop column H323DisconnectCause; |
|---|
| 104 | alter table radacct drop column H323RemoteAddress; |
|---|
| 105 | alter table radacct drop column H323VoiceQuality; |
|---|
| 106 | alter table radacct drop column H323ConfID; |
|---|
| 107 | |
|---|
| 108 | alter table cdrtool.billing_customers add column timezone varchar(128) not null; |
|---|
| 109 | |
|---|
| 110 | 2.0.2 |
|---|
| 111 | alter table radacct drop column Redirected; |
|---|
| 112 | |
|---|
| 113 | 2.0.3 |
|---|
| 114 | Add to sql.conf |
|---|
| 115 | accounting_stop_query_alt = "UPDATE ${acct_table1} SET AcctStopTime = '%S',AcctSessionTime=unix_timestamp('%S') - unix_timestamp(AcctStartTime),AcctTerminateCause = '%{SIP-Response-Code}', AcctStopDelay ='%{Acct-Delay-Time}', ConnectInfo_stop = '%{Connect-Info}' WHEREAcctSessionId = '%{Acct-Session-Id}' AND (SipToTag = 'n/a' AND (SipFromTag= '%{Sip-From-Tag}' OR SipFromTag = '%{Sip-To-Tag}')) AND NASIPAddress ='%{NAS-IP-Address}'" |
|---|
| 116 | |
|---|
| 117 | 2.1.3 |
|---|
| 118 | alter table radacct add column SipRPID varchar(25) not null after SipCodecs; |
|---|
| 119 | |
|---|
| 120 | 2.2 |
|---|
| 121 | insert into sip_status values ('430','Quota exceeded','Client-Error'); |
|---|
| 122 | |
|---|
| 123 | 2.3 |
|---|
| 124 | alter table billing_customers add unique cust_idx (gateway,domain,subscriber); |
|---|
| 125 | alter table destinations add unique cust_dest_idx (gateway,domain,subscriber,dest_id); |
|---|
| 126 | alter table billing_profiles add unique profile_idx (name,hour1,hour2,hour3,hour4); |
|---|
| 127 | alter table billing_rates add unique rate_idx (name,destination); |
|---|
| 128 | alter table billing_ratesNGN add unique rate_idx (name); |
|---|
| 129 | alter table billing_profilesNGN add unique profile_idx (name,application); |
|---|
| 130 | |
|---|
| 131 | 2.5.3 |
|---|
| 132 | insert into sip_status values ('477','SendingError','Client-Error'); |
|---|
| 133 | insert into sip_status values ('478','UnresolvableNextHopAddress','Client-Error'); |
|---|
| 134 | insert into sip_status values ('479','UnparseableURI ','Client-Error'); |
|---|
| 135 | |
|---|
| 136 | 2.5.5 |
|---|
| 137 | insert into sip_status values ('434','User not online','Client-Error'); |
|---|
| 138 | |
|---|
| 139 | 2.5.9 |
|---|
| 140 | update sip_status set description = 'Canceled' where code = '487'; |
|---|
| 141 | update sip_status set description = 'Busy' where code = '486'; |
|---|
| 142 | update sip_status set description = 'TemporarilyUnavailable' where code = '480'; |
|---|
| 143 | update sip_status set description = 'NotAcceptable' where code = '488'; |
|---|
| 144 | update sip_status set description = 'Timeout' where code = '408'; |
|---|
| 145 | update sip_status set description = 'NotOnline' where code = '434'; |
|---|
| 146 | |
|---|
| 147 | 2.6.0 |
|---|
| 148 | alter table radacct add column SipRPIDHeader varchar(255) not null after SipRPID; |
|---|
| 149 | alter table radacct add column SourceIP varchar(255) not null; |
|---|
| 150 | alter table radacct add column SourcePort varchar(255) not null; |
|---|
| 151 | alter table radacct add column CanonicalURI varchar(255) not null; |
|---|
| 152 | alter table radacct add column DelayTime varchar(5) not null; |
|---|
| 153 | alter table radacct add column BillingId varchar(255) not null; |
|---|
| 154 | |
|---|
| 155 | insert into sip_status VALUES ('492','CrossReferencedURI','Client-Error'); |
|---|
| 156 | alter table sip_status add column isdn_cause smallint(5) unsigned not null; |
|---|
| 157 | update sip_status set isdn_cause = '57' where code = 401; |
|---|
| 158 | update sip_status set isdn_cause = '21' where code = 402; |
|---|
| 159 | update sip_status set isdn_cause = '57' where code = 403; |
|---|
| 160 | update sip_status set isdn_cause = '1' where code = 404; |
|---|
| 161 | update sip_status set isdn_cause = '127' where code = 405; |
|---|
| 162 | update sip_status set isdn_cause = '127' where code = 406; |
|---|
| 163 | update sip_status set isdn_cause = '21' where code = 407; |
|---|
| 164 | update sip_status set isdn_cause = '10' where code = 408; |
|---|
| 165 | update sip_status set isdn_cause = '41' where code = 409; |
|---|
| 166 | update sip_status set isdn_cause = '1' where code = 410; |
|---|
| 167 | update sip_status set isdn_cause = '127' where code = 413; |
|---|
| 168 | update sip_status set isdn_cause = '127' where code = 414; |
|---|
| 169 | update sip_status set isdn_cause = '79' where code = 415; |
|---|
| 170 | update sip_status set isdn_cause = '127' where code = 420; |
|---|
| 171 | update sip_status set isdn_cause = '127' where code = 422; |
|---|
| 172 | update sip_status set isdn_cause = '18' where code = 480; |
|---|
| 173 | update sip_status set isdn_cause = '127' where code = 481; |
|---|
| 174 | update sip_status set isdn_cause = '127' where code = 482; |
|---|
| 175 | update sip_status set isdn_cause = '127' where code = 483; |
|---|
| 176 | update sip_status set isdn_cause = '28' where code = 484; |
|---|
| 177 | update sip_status set isdn_cause = '1' where code = 485; |
|---|
| 178 | update sip_status set isdn_cause = '17' where code = 486; |
|---|
| 179 | update sip_status set isdn_cause = '127' where code = 487; |
|---|
| 180 | update sip_status set isdn_cause = '127' where code = 488; |
|---|
| 181 | update sip_status set isdn_cause = '41' where code = 500; |
|---|
| 182 | update sip_status set isdn_cause = '79' where code = 501; |
|---|
| 183 | update sip_status set isdn_cause = '38' where code = 502; |
|---|
| 184 | update sip_status set isdn_cause = '63' where code = 503; |
|---|
| 185 | update sip_status set isdn_cause = '102' where code = 504; |
|---|
| 186 | update sip_status set isdn_cause = '127' where code = 505; |
|---|
| 187 | update sip_status set isdn_cause = '47' where code = 580; |
|---|
| 188 | update sip_status set isdn_cause = '17' where code = 600; |
|---|
| 189 | update sip_status set isdn_cause = '21' where code = 603; |
|---|
| 190 | update sip_status set isdn_cause = '1' where code = 604; |
|---|
| 191 | update sip_status set isdn_cause = '58' where code = 606; |
|---|
| 192 | |
|---|
| 193 | 3.0 |
|---|
| 194 | CREATE TABLE prepaid ( |
|---|
| 195 | id int(10) unsigned NOT NULL auto_increment, |
|---|
| 196 | account varchar(255) NOT NULL default '', |
|---|
| 197 | balance decimal(10,4) not NULL default '0.0000', |
|---|
| 198 | balance_previous decimal(10,4) not NULL, |
|---|
| 199 | change_date datetime not null, |
|---|
| 200 | PRIMARY KEY (id), |
|---|
| 201 | INDEX acc_id (account) |
|---|
| 202 | ); |
|---|
| 203 | |
|---|
| 204 | 3.0.3 |
|---|
| 205 | alter table cdrtool.log add column datasource varchar(255) not null; |
|---|
| 206 | update cdrtool.log set datasource = SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(rerun, '?','-1'),'&','1'),'=','-1') ; |
|---|
| 207 | |
|---|
| 208 | 3.1.2 |
|---|
| 209 | alter table radius.radacct add index canon_idx (CanonicalURI); |
|---|
| 210 | alter table ser.sip_trace add index call_id(callid); |
|---|
| 211 | alter table prepaid add column last_call_price decimal(10,4) not null; |
|---|
| 212 | alter table prepaid add column expires date not null after change_date; |
|---|
| 213 | alter table prepaid add column disabled char(1) not null after expires; |
|---|
| 214 | alter table prepaid add column call_in_progress datetime not null after disabled; |
|---|
| 215 | alter table billing_customers add column profile_name1_alt varchar(10) not null after profile_name1; |
|---|
| 216 | alter table billing_customers add column profile_name2_alt varchar(10) not null after profile_name2; |
|---|
| 217 | |
|---|
| 218 | 3.2 |
|---|
| 219 | insert into settings (var_name,var_description,var_value) values |
|---|
| 220 | ('reloadRating','Rating tables have changed',''); |
|---|
| 221 | |
|---|
| 222 | 3.2.2 |
|---|
| 223 | alter table radacct change column Price Price double(20, 4); |
|---|
| 224 | |
|---|
| 225 | 3.2.4 |
|---|
| 226 | alter table prepaid add column call_lock enum ('0','1') default '0' after disabled; |
|---|
| 227 | alter table prepaid change column disabled disabled enum ('0','1') default '0' after account; |
|---|
| 228 | alter table prepaid drop index acc_id; |
|---|
| 229 | alter table prepaid add unique index acc_id(account); |
|---|
| 230 | |
|---|
| 231 | 3.2.7 |
|---|
| 232 | alter table cdrtool.settings add column billing_party varchar(255) not null after id; |
|---|
| 233 | insert into cdrtool.settings (billing_party,var_name,var_value) values ('domain.com','providerName','Provider Name'); |
|---|
| 234 | insert into cdrtool.settings (billing_party,var_name,var_value) values ('domain.com','fromEmail','support@example.com'); |
|---|
| 235 | |
|---|
| 236 | 3.3.2 |
|---|
| 237 | alter table cdrtool.billing_rates add column gateway varchar(50) NOT NULL default '' after id; |
|---|
| 238 | alter table cdrtool.billing_rates add column domain varchar(50) NOT NULL default '' after gateway; |
|---|
| 239 | alter table cdrtool.billing_rates add column subscriber varchar(50) NOT NULL default '' after domain; |
|---|
| 240 | alter table cdrtool.billing_profiles add column gateway varchar(50) NOT NULL default '' after id; |
|---|
| 241 | alter table cdrtool.billing_profiles add column domain varchar(50) NOT NULL default '' after gateway; |
|---|
| 242 | alter table cdrtool.billing_profiles add column subscriber varchar(50) NOT NULL default '' after domain; |
|---|
| 243 | alter table cdrtool.billing_ratesNGN add column gateway varchar(50) NOT NULL default '' after id; |
|---|
| 244 | alter table cdrtool.billing_ratesNGN add column domain varchar(50) NOT NULL default '' after gateway; |
|---|
| 245 | alter table cdrtool.billing_ratesNGN add column subscriber varchar(50) NOT NULL default '' after domain; |
|---|
| 246 | alter table cdrtool.billing_profilesNGN add column gateway varchar(50) NOT NULL default '' after id; |
|---|
| 247 | alter table cdrtool.billing_profilesNGN add column domain varchar(50) NOT NULL default '' after gateway; |
|---|
| 248 | alter table cdrtool.billing_profilesNGN add column subscriber varchar(50) NOT NULL default '' after domain; |
|---|
| 249 | |
|---|
| 250 | alter table cdrtool.destinations drop column asr; |
|---|
| 251 | |
|---|
| 252 | alter table cdrtool.prepaid drop column disabled; |
|---|
| 253 | alter table cdrtool.prepaid drop column balance_previous; |
|---|
| 254 | alter table cdrtool.prepaid drop column expires; |
|---|
| 255 | alter table cdrtool.prepaid add column maxsessiontime bigint unsigned not null; |
|---|
| 256 | alter table cdrtool.prepaid add column destination varchar(50) not null; |
|---|
| 257 | |
|---|
| 258 | 3.3.4 |
|---|
| 259 | alter table radacct drop index FramedIPAddress; |
|---|
| 260 | alter table radacct add index source_ip_idx (SourceIP); |
|---|
| 261 | alter table radacct add index billing_id_idx (BillingId); |
|---|
| 262 | alter table radacct add index dest_id_idx (DestinationId); |
|---|
| 263 | alter table radacct drop column CiscoNASPort; |
|---|
| 264 | |
|---|
| 265 | 3.3.5 |
|---|
| 266 | alter table asterisk_cdr add index calldate_idx (calldate); |
|---|
| 267 | alter table asterisk_cdr add index clid_idx (clid); |
|---|
| 268 | alter table asterisk_cdr add index src_idx (src); |
|---|
| 269 | alter table asterisk_cdr add index dst_idx (dst); |
|---|
| 270 | alter table asterisk_cdr add index channel_idx (channel); |
|---|
| 271 | alter table asterisk_cdr add index dstchannel_idx (dstchannel); |
|---|
| 272 | |
|---|
| 273 | 3.3.6 |
|---|
| 274 | alter table radacct add index sip_req_uri_idx (SipTranslatedRequestURI); |
|---|
| 275 | alter table radacct add index sip_req_uri_idx (SIPAccount); |
|---|
| 276 | |
|---|
| 277 | 3.4.0 |
|---|
| 278 | alter table radacct add index normalize_idx(Normalized); |
|---|
| 279 | |
|---|
| 280 | 4.0.3 |
|---|
| 281 | alter table radacct add column MediaInfo varchar(32) default NULL; |
|---|
| 282 | alter table radacct add index MediaInfo_idx(MediaInfo); |
|---|
| 283 | update radacct set MediaInfo = '' where AcctStopTime != '0000-00-00 00:00:00'; |
|---|
| 284 | update radacct set MediaInfo = 'timeout' where AcctStopTime = '0000-00-00 00:00:00' and AcctSessionTime > 0; |
|---|
| 285 | update radacct set MediaInfo = 'timeout' where AcctStopTime = '0000-00-00 00:00:00' and AcctInputOctets > 0; |
|---|
| 286 | update radacct set MediaInfo = 'timeout' where AcctStopTime = '0000-00-00 00:00:00' and AcctOutputOctets > 0; |
|---|
| 287 | update radacct set MediaInfo = 'timeout' where AcctStopTime = '0000-00-00 00:00:00' and SipCodecs != ''; |
|---|
| 288 | |
|---|
| 289 | 4.1.2 |
|---|
| 290 | alter table radacct add index Realm_idx(Realm); |
|---|
| 291 | |
|---|
| 292 | 4.1.3 |
|---|
| 293 | alter table settings change column var_value var_value text not null; |
|---|
| 294 | |
|---|
| 295 | 4.1.2 |
|---|
| 296 | alter table radacct add column RTPStatistics text not null after MediaInfo; |
|---|
| 297 | |
|---|
| 298 | 4.2 |
|---|
| 299 | CREATE TABLE `prepaid_history` ( |
|---|
| 300 | `id` bigint(20) unsigned NOT NULL auto_increment, |
|---|
| 301 | `username` varchar(64) NOT NULL default '', |
|---|
| 302 | `domain` varchar(64) NOT NULL default '', |
|---|
| 303 | `action` varchar(255) NOT NULL default '', |
|---|
| 304 | `number` varchar(255) NOT NULL default '', |
|---|
| 305 | `value` float(10,2) NOT NULL default '0.00', |
|---|
| 306 | `balance` float(10,2) NOT NULL default '0.00', |
|---|
| 307 | `date` datetime default NULL, |
|---|
| 308 | PRIMARY KEY (`id`), |
|---|
| 309 | KEY `acct_id` (`username`,`domain`) |
|---|
| 310 | ); |
|---|
| 311 | |
|---|
| 312 | CREATE TABLE `prepaid_cards` ( |
|---|
| 313 | `id` bigint(20) unsigned NOT NULL auto_increment, |
|---|
| 314 | `batch` varchar(255) NOT NULL default '', |
|---|
| 315 | `number` bigint(20) unsigned NOT NULL default '0', |
|---|
| 316 | `value` smallint(5) unsigned NOT NULL default '0', |
|---|
| 317 | `blocked` enum('0','1') NOT NULL default '0', |
|---|
| 318 | `date_active` date NOT NULL default '0000-00-00', |
|---|
| 319 | `date_batch` date NOT NULL default '0000-00-00', |
|---|
| 320 | `service` varchar(255) NOT NULL default 'sip', |
|---|
| 321 | PRIMARY KEY (`id`), |
|---|
| 322 | UNIQUE KEY `card_idx` (`number`), |
|---|
| 323 | KEY `nr_id` (`number`) |
|---|
| 324 | ); |
|---|
| 325 | |
|---|
| 326 | alter table radacct |
|---|
| 327 | add column FromHeader varchar(128) not null, |
|---|
| 328 | add column UserAgent varchar(128) not null, |
|---|
| 329 | add column Contact varchar(128) not null; |
|---|
| 330 | |
|---|
| 331 | 4.3 |
|---|
| 332 | update radacct set SIPApplicationType = 'audio' where SIPApplicationType=''; |
|---|
| 333 | |
|---|
| 334 | 4.3.1 |
|---|
| 335 | alter table asterisk_cdr change column Rate Rate text not null; |
|---|
| 336 | |
|---|
| 337 | 4.4.5 |
|---|
| 338 | update radacct set |
|---|
| 339 | CalledStationId = trim(leading 'sip:' from trim(leading 'sips:' from CalledStationId)), |
|---|
| 340 | CallingStationId = trim(leading 'sip:' from trim(leading 'sips:' from CallingStationId)), |
|---|
| 341 | CanonicalURI = trim(leading 'sip:' from trim(leading 'sips:' from CanonicalURI)), |
|---|
| 342 | SipTranslatedRequestURI = trim(leading 'sip:' from trim(leading 'sips:' from SipTranslatedRequestURI)) |
|---|
| 343 | where Normalized = 1 and CalledStationId like 'sip:%'; |
|---|
| 344 | |
|---|
| 345 | 4.4.6 |
|---|
| 346 | INSERT INTO sip_status VALUES (435,'Diverted','Client-Error','0'); |
|---|
| 347 | |
|---|
| 348 | 4.5.9 |
|---|
| 349 | alter table log add index login_idx(login); |
|---|
| 350 | |
|---|
| 351 | 4.6-4 |
|---|
| 352 | update sip_status set description = 'NotAcceptableMedia' where code = 488; |
|---|
| 353 | |
|---|
| 354 | 4.7-0 |
|---|
| 355 | DROP TABLE IF EXISTS `memcache`; |
|---|
| 356 | CREATE TABLE `memcache` ( |
|---|
| 357 | `key` varchar(255) NOT NULL, |
|---|
| 358 | `value` text NOT NULL, |
|---|
| 359 | PRIMARY KEY (`key`) |
|---|
| 360 | ) ; |
|---|
| 361 | |
|---|
| 362 | 4.7-6 |
|---|
| 363 | alter table billing_customers add column increment smallint unsigned not null; |
|---|
| 364 | alter table billing_customers add column min_duration smallint unsigned not null; |
|---|
| 365 | |
|---|
| 366 | 4.8.1 |
|---|
| 367 | alter table asterisk_cdr change column disposition disposition varchar(45) not null default ''; |
|---|
| 368 | |
|---|
| 369 | 5.0-2 |
|---|
| 370 | alter table billing_profiles drop index `profile_idx` ; |
|---|
| 371 | alter table billing_profiles add UNIQUE KEY `profile_idx` (`gateway`,`domain`,`subscriber`,`name`); |
|---|
| 372 | |
|---|
| 373 | alter table billing_rates drop index `rate_idx` ; |
|---|
| 374 | alter table billing_rates add UNIQUE KEY `rate_idx` (`gateway`,`domain`,`subscriber`,`name`,`destination`); |
|---|
| 375 | |
|---|
| 376 | alter table billing_customers add column country_code varchar(8) not NULL; |
|---|
| 377 | |
|---|
| 378 | alter table billing_profilesNGN drop index `profile_idx` ; |
|---|
| 379 | alter table billing_profilesNGN add UNIQUE KEY `profile_idx` (`gateway`,`domain`,`subscriber`,`name`); |
|---|
| 380 | |
|---|
| 381 | alter table billing_ratesNGN drop index `rate_idx` ; |
|---|
| 382 | alter table billing_ratesNGN add UNIQUE KEY `rate_idx` (`gateway`,`domain`,`subscriber`,`name`); |
|---|
| 383 | |
|---|
| 384 | 5.0.10 |
|---|
| 385 | alter table destinations change column dest_id dest_id varchar(100) not null; |
|---|
| 386 | alter table billing_rates change column destination destination varchar(100) not null; |
|---|
| 387 | |
|---|
| 388 | 5.1.0 |
|---|
| 389 | alter table billing_rates change column `name` `name` varchar(25) not null; |
|---|
| 390 | alter table billing_profiles change column `name` `name` varchar(25) not null; |
|---|
| 391 | alter table billing_customers change column `profile_name1` `profile_name1` varchar(25) not null; |
|---|
| 392 | alter table billing_customers change column `profile_name1_alt` `profile_name1_alt` varchar(25) not null; |
|---|
| 393 | alter table billing_customers change column `profile_name2` `profile_name2` varchar(25) not null; |
|---|
| 394 | alter table billing_customers change column `profile_name2_alt` `profile_name2_alt` varchar(25) not null; |
|---|
| 395 | |
|---|
| 396 | CREATE TABLE `billing_rates_history` ( |
|---|
| 397 | `id` bigint(20) unsigned NOT NULL auto_increment, |
|---|
| 398 | `gateway` varchar(50) NOT NULL default '', |
|---|
| 399 | `domain` varchar(50) NOT NULL default '', |
|---|
| 400 | `subscriber` varchar(50) NOT NULL default '', |
|---|
| 401 | `name` varchar(25) NOT NULL default '', |
|---|
| 402 | `destination` varchar(100) NOT NULL default '', |
|---|
| 403 | `durationRate` varchar(25) NOT NULL default '', |
|---|
| 404 | `trafficRate` varchar(25) NOT NULL default '', |
|---|
| 405 | `application` varchar(25) NOT NULL default '', |
|---|
| 406 | `connectCost` varchar(25) NOT NULL default '', |
|---|
| 407 | `startDate` date NOT NULL, |
|---|
| 408 | `endDate` date NOT NULL, |
|---|
| 409 | PRIMARY KEY (`id`), |
|---|
| 410 | UNIQUE KEY `rate_idx` (`gateway`,`domain`,`subscriber`,`name`,`destination`,`application`,`startDate`,`endDate`), |
|---|
| 411 | KEY `name_idx` (`name`), |
|---|
| 412 | KEY `dest_idx` (`destination`) |
|---|
| 413 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
|---|
| 414 | |
|---|
| 415 | alter table billing_rates change column applicationRate application varchar(25) not null default 'audio'; |
|---|
| 416 | |
|---|
| 417 | update billing_rates set application ='audio'; |
|---|
| 418 | |
|---|
| 419 | update billing_rates_history set application ='audio'; |
|---|
| 420 | |
|---|
| 421 | alter table billing_customers drop column profileNGN; |
|---|
| 422 | |
|---|
| 423 | alter table billing_rates drop index rate_idx; |
|---|
| 424 | |
|---|
| 425 | alter table billing_rates add UNIQUE KEY `rate_idx` (`gateway`,`domain`,`subscriber`,`name`,`destination`,`application`); |
|---|
| 426 | |
|---|
| 427 | |
|---|
| 428 | 5.2.1 |
|---|
| 429 | Apply again the MySQL stored procedures to radius database from: |
|---|
| 430 | setup/radius/OpenSER/radius_accounting.proc |
|---|
| 431 | |
|---|
| 432 | 5.2.7 |
|---|
| 433 | alter table auth_user add column reseller bigint unsigned not null; |
|---|
| 434 | |
|---|
| 435 | CREATE TABLE `billing_enum_tlds` ( |
|---|
| 436 | `id` bigint(20) unsigned NOT NULL auto_increment, |
|---|
| 437 | `gateway` varchar(50) NOT NULL default '', |
|---|
| 438 | `domain` varchar(50) NOT NULL default '', |
|---|
| 439 | `subscriber` varchar(50) NOT NULL default '', |
|---|
| 440 | `enum_tld` varchar(100) NOT NULL, |
|---|
| 441 | `e164_regexp` varchar(100) NOT NULL, |
|---|
| 442 | `discount` varchar(25) NOT NULL default '', |
|---|
| 443 | PRIMARY KEY (`id`), |
|---|
| 444 | UNIQUE KEY `enum_idx` (`gateway`,`domain`,`subscriber`,`enum_tld`), |
|---|
| 445 | KEY `tld_idx` (`enum_tld`) |
|---|
| 446 | ); |
|---|
| 447 | |
|---|
| 448 | INSERT into billing_enum_tlds (enum_tld,e164_regexp,discount) values ('e164.example.com','([1-9][0-9]{7,})','25'); |
|---|
| 449 | |
|---|
| 450 | alter table radius.radacctYYYMMDD change column FramedProtocol ENUMtld varchar(64) not NULL; |
|---|
| 451 | |
|---|
| 452 | 5.4 |
|---|
| 453 | alter table prepaid_cards change column blocked blocked smallint unsigned not null; |
|---|
| 454 | alter table prepaid_history change column value value decimal(10,4) not null; |
|---|
| 455 | alter table prepaid_history change column balance balance decimal(10,4) not null; |
|---|
| 456 | alter table auth_user change column reseller impersonate varchar(50) not null; |
|---|
| 457 | |
|---|
| 458 | 6.2.3 |
|---|
| 459 | alter table cdrtool.billing_customers change column domain domain varchar(64) not null; |
|---|
| 460 | alter table cdrtool.billing_customers change column subscriber subscriber varchar(128) not null; |
|---|
| 461 | alter table cdrtool.billing_customers change column gateway gateway varchar(15) not null; |
|---|
| 462 | |
|---|
| 463 | alter table cdrtool.billing_profiles change column domain domain varchar(64) not null; |
|---|
| 464 | alter table cdrtool.billing_profiles change column subscriber subscriber varchar(128) not null; |
|---|
| 465 | alter table cdrtool.billing_profiles change column gateway gateway varchar(15) not null; |
|---|
| 466 | |
|---|
| 467 | alter table cdrtool.billing_rates change column domain domain varchar(64) not null; |
|---|
| 468 | alter table cdrtool.billing_rates change column subscriber subscriber varchar(128) not null; |
|---|
| 469 | alter table cdrtool.billing_rates change column gateway gateway varchar(15) not null; |
|---|
| 470 | |
|---|
| 471 | alter table cdrtool.billing_rates_history change column domain domain varchar(64) not null; |
|---|
| 472 | alter table cdrtool.billing_rates_history change column subscriber subscriber varchar(128) not null; |
|---|
| 473 | alter table cdrtool.billing_rates_history change column gateway gateway varchar(15) not null; |
|---|
| 474 | |
|---|
| 475 | alter table cdrtool.billing_enum_tlds change column domain domain varchar(64) not null; |
|---|
| 476 | alter table cdrtool.billing_enum_tlds change column subscriber subscriber varchar(128) not null; |
|---|
| 477 | alter table cdrtool.billing_enum_tlds change column gateway gateway varchar(15) not null; |
|---|
| 478 | |
|---|
| 479 | alter table cdrtool.billing_ratesNGN change column domain domain varchar(64) not null; |
|---|
| 480 | alter table cdrtool.billing_ratesNGN change column subscriber subscriber varchar(128) not null; |
|---|
| 481 | alter table cdrtool.billing_ratesNGN change column gateway gateway varchar(15) not null; |
|---|
| 482 | |
|---|
| 483 | alter table cdrtool.prepaid change column account account varchar(128) not null; |
|---|
| 484 | |
|---|
| 485 | optimize table billing_rates; |
|---|
| 486 | optimize table billing_rates_history; |
|---|
| 487 | optimize table billing_customers; |
|---|
| 488 | optimize table billing_profiles; |
|---|
| 489 | optimize table prepaid; |
|---|
| 490 | |
|---|
| 491 | 6.3.3 |
|---|
| 492 | |
|---|
| 493 | DROP TABLE IF EXISTS `quota_usage`; |
|---|
| 494 | CREATE TABLE `quota_usage` ( |
|---|
| 495 | `id` int(10) unsigned NOT NULL auto_increment, |
|---|
| 496 | `datasource` varchar(50) NOT NULL, |
|---|
| 497 | `account` varchar(128) NOT NULL default '', |
|---|
| 498 | `domain` varchar(64) default NULL, |
|---|
| 499 | `quota` int(11) unsigned NOT NULL, |
|---|
| 500 | `blocked` enum('0','1') NOT NULL default '0', |
|---|
| 501 | `notified` datetime NOT NULL, |
|---|
| 502 | `calls` int(10) unsigned NOT NULL, |
|---|
| 503 | `duration` bigint(20) unsigned NOT NULL, |
|---|
| 504 | `cost` decimal(10,4) NOT NULL, |
|---|
| 505 | `traffic` varchar(50) NOT NULL, |
|---|
| 506 | `change_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, |
|---|
| 507 | PRIMARY KEY (`id`), |
|---|
| 508 | UNIQUE KEY `account_idx` (`datasource`,`account`) |
|---|
| 509 | ); |
|---|
| 510 | |
|---|
| 511 | alter table memcache change `value` `value` longblob not null; |
|---|
| 512 | |
|---|
| 513 | |
|---|
| 514 | 6.6.0 |
|---|
| 515 | |
|---|
| 516 | alter table prepaid add column active_sessions text not null; |
|---|
| 517 | alter table prepaid add column session_counter int unsigned not null; |
|---|
| 518 | |
|---|
| 519 | |
|---|
| 520 | 6.7.0 |
|---|
| 521 | alter table billing_rates drop column trafficRate; |
|---|
| 522 | alter table cdrtool.billing_rates_history drop column trafficRate; |
|---|
| 523 | |
|---|
| 524 | alter table billing_rates_history modify application varchar(25) not null default 'audio' after destination; |
|---|
| 525 | alter table billing_rates modify application varchar(25) not null default 'audio' after destination; |
|---|
| 526 | |
|---|
| 527 | alter table billing_rates_history modify connectCost varchar(25) not null after application; |
|---|
| 528 | alter table billing_rates modify connectCost varchar(25) not null after application; |
|---|
| 529 | |
|---|
| 530 | alter table billing_rates add column connectCostIn varchar(25) not null; |
|---|
| 531 | alter table billing_rates add column durationRateIn varchar(25) not null; |
|---|
| 532 | |
|---|
| 533 | alter table cdrtool.billing_rates_history add column connectCostIn varchar(25) not null after durationRate; |
|---|
| 534 | alter table cdrtool.billing_rates_history add column durationRateIn varchar(25) not null after connectCostIn; |
|---|
| 535 | alter table prepaid_history add column duration bigint unsigned not null after action; |
|---|
| 536 | alter table prepaid_history add column session varchar(255) not null after duration; |
|---|
| 537 | alter table prepaid_history add column destination varchar (15) not null after duration; |
|---|
| 538 | alter table prepaid_history add index session_idx(session); |
|---|
| 539 | |
|---|
| 540 | alter table prepaid add column duration bigint(20) unsigned not null after destination; |
|---|
| 541 | alter table prepaid add column domain varchar(128) not null after account; |
|---|
| 542 | update prepaid set domain = SUBSTRING_INDEX(account, '@',-1); |
|---|
| 543 | |
|---|
| 544 | 6.7.6 |
|---|
| 545 | alter table prepaid drop column call_lock; |
|---|
| 546 | |
|---|
| 547 | 6.8.0 |
|---|
| 548 | alter table prepaid_history change column `number` `description` varchar(255) not null; |
|---|
| 549 | alter table billing_rates add column increment smallint unsigned not null; |
|---|
| 550 | alter table billing_rates add column min_duration smallint unsigned not null; |
|---|
| 551 | alter table billing_rates_history add column increment smallint unsigned not null after durationRateIn; |
|---|
| 552 | alter table billing_rates_history add column min_duration smallint unsigned not null after increment; |
|---|
| 553 | |
|---|
| 554 | alter table prepaid drop column call_lock; |
|---|
| 555 | alter table prepaid drop column call_in_progress; |
|---|
| 556 | alter table prepaid add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 557 | alter table prepaid add key reseller_idx (reseller_id); |
|---|
| 558 | |
|---|
| 559 | alter table prepaid_cards add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 560 | alter table prepaid_cards add key reseller_idx (reseller_id); |
|---|
| 561 | |
|---|
| 562 | alter table prepaid_history add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 563 | alter table prepaid_history add key reseller_idx (reseller_id); |
|---|
| 564 | |
|---|
| 565 | alter table quota_usage add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 566 | alter table quota_usage add key reseller_idx (reseller_id); |
|---|
| 567 | |
|---|
| 568 | alter table billing_customers add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 569 | alter table billing_customers add key reseller_idx (reseller_id); |
|---|
| 570 | alter table billing_customers drop column country_code; |
|---|
| 571 | |
|---|
| 572 | alter table billing_profiles add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 573 | alter table billing_profiles add key reseller_idx (reseller_id); |
|---|
| 574 | |
|---|
| 575 | alter table billing_rates add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 576 | alter table billing_rates add key reseller_idx (reseller_id); |
|---|
| 577 | |
|---|
| 578 | alter table billing_rates_history add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 579 | alter table billing_rates_history add key reseller_idx (reseller_id); |
|---|
| 580 | |
|---|
| 581 | alter table billing_enum_tlds add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 582 | alter table billing_enum_tlds add key reseller_idx (reseller_id); |
|---|
| 583 | |
|---|
| 584 | alter table destinations add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 585 | alter table destinations add key reseller_idx (reseller_id); |
|---|
| 586 | |
|---|
| 587 | alter table billing_profiles drop column gateway; |
|---|
| 588 | alter table billing_profiles drop column subscriber; |
|---|
| 589 | alter table billing_profiles drop column domain; |
|---|
| 590 | |
|---|
| 591 | alter table billing_rates drop column gateway; |
|---|
| 592 | alter table billing_rates drop column subscriber; |
|---|
| 593 | alter table billing_rates drop column domain; |
|---|
| 594 | |
|---|
| 595 | alter table billing_rates_history drop column gateway; |
|---|
| 596 | alter table billing_rates_history drop column subscriber; |
|---|
| 597 | alter table billing_rates_history drop column domain; |
|---|
| 598 | |
|---|
| 599 | alter table billing_enum_tlds drop column gateway; |
|---|
| 600 | alter table billing_enum_tlds drop column subscriber; |
|---|
| 601 | alter table billing_enum_tlds drop column domain; |
|---|
| 602 | |
|---|
| 603 | drop table billing_profilesNGN; |
|---|
| 604 | drop table billing_ratesNGN; |
|---|
| 605 | |
|---|
| 606 | alter table log add column reseller_id int(10) unsigned not NULL after id; |
|---|
| 607 | alter table log add key reseller_idx (reseller_id); |
|---|
| 608 | |
|---|
| 609 | alter table destinations drop KEY `cust_dest_idx`; |
|---|
| 610 | alter table destinations add KEY `cust_dest_idx` (`reseller_id`,`gateway`,`domain`,`subscriber`,`dest_id`); |
|---|
| 611 | alter table prepaid_cards change column `value` `value` decimal(10,4) default 0; |
|---|
| 612 | alter table billing_rates add column `maxPrice` varchar(25) NOT NULL default ''; |
|---|
| 613 | |
|---|
| 614 | alter table prepaid drop column last_call_price; |
|---|
| 615 | alter table prepaid drop column destination; |
|---|
| 616 | alter table prepaid drop column duration; |
|---|
| 617 | alter table prepaid drop column maxsessiontime; |
|---|
| 618 | |
|---|
| 619 | |
|---|
| 620 | 6.9.3 |
|---|
| 621 | alter table prepaid drop column domain; |
|---|
| 622 | |
|---|
| 623 | 6.7.0 |
|---|
| 624 | alter table prepaid add column max_sessions int(10) unsigned not null default 1; |
|---|
| 625 | |
|---|
| 626 | alter table billing_enum_tlds drop KEY `enum_idx`; |
|---|
| 627 | alter table billing_enum_tlds add UNIQUE `enum_idx` (`reseller_id`,`enum_tld`); |
|---|
| 628 | |
|---|
| 629 | alter table billing_rates drop KEY `rate_idx`; |
|---|
| 630 | alter table billing_rates add UNIQUE `rate_idx` (`reseller_id`,`name`,`destination`,`application`); |
|---|
| 631 | |
|---|
| 632 | alter table billing_rates_history drop KEY `rate_idx`; |
|---|
| 633 | alter table billing_rates_history add UNIQUE `rate_idx` (`reseller_id`,`name`,`destination`,`startDate`,`endDate`,`application`); |
|---|
| 634 | |
|---|
| 635 | alter table billing_profiles drop KEY `name_idx`; |
|---|
| 636 | alter table billing_profiles add UNIQUE `name_idx` (`reseller_id`,`name`); |
|---|
| 637 | |
|---|
| 638 | alter table billing_rates drop column maxPrice; |
|---|
| 639 | |
|---|
| 640 | alter table billing_rates drop column min_duration; |
|---|
| 641 | alter table billing_rates drop column increment; |
|---|
| 642 | |
|---|
| 643 | alter table billing_rates_history drop column min_duration; |
|---|
| 644 | alter table billing_rates_history drop column increment; |
|---|
| 645 | |
|---|
| 646 | alter table billing_customers drop column min_duration; |
|---|
| 647 | alter table billing_customers drop column increment; |
|---|
| 648 | |
|---|
| 649 | alter table destinations add column increment smallint unsigned not null; |
|---|
| 650 | alter table destinations add column min_duration smallint unsigned not null; |
|---|
| 651 | alter table destinations add column max_duration bigint unsigned not null; |
|---|
| 652 | alter table destinations add column max_price varchar(25) NOT NULL default ''; |
|---|
| 653 | |
|---|
| 654 | 7.1.1 |
|---|
| 655 | CREATE TABLE `subscriber_docs` ( |
|---|
| 656 | `id` int(11) NOT NULL auto_increment, |
|---|
| 657 | `username` varchar(64) NOT NULL, |
|---|
| 658 | `domain` varchar(64) NOT NULL, |
|---|
| 659 | `name` varchar(64) NOT NULL, |
|---|
| 660 | `document` varchar(64) NOT NULL, |
|---|
| 661 | `file_content` mediumblob NOT NULL, |
|---|
| 662 | `file_name` varchar(255) NOT NULL default '', |
|---|
| 663 | `file_size` varchar(255) NOT NULL default '', |
|---|
| 664 | `file_type` varchar(255) NOT NULL default '', |
|---|
| 665 | `file_date` datetime NOT NULL default '0000-00-00 00:00:00', |
|---|
| 666 | `last_digits` varchar(64) NOT NULL, |
|---|
| 667 | `mobile_number` varchar(15) NOT NULL, |
|---|
| 668 | PRIMARY KEY (`id`), |
|---|
| 669 | UNIQUE KEY `document_idx` (`username`,`domain`,`document`) |
|---|
| 670 | ); |
|---|
| 671 | |
|---|
| 672 | 8.0.0 |
|---|
| 673 | alter table destinations add column region varchar(50) not null after dest_id ; |
|---|
| 674 | |
|---|
| 675 | drop table if exists billing_discounts; |
|---|
| 676 | CREATE TABLE `billing_discounts` ( |
|---|
| 677 | `id` bigint(20) unsigned NOT NULL auto_increment, |
|---|
| 678 | `reseller_id` int(10) unsigned not NULL, |
|---|
| 679 | `gateway` varchar(50) NOT NULL default '', |
|---|
| 680 | `domain` varchar(50) NOT NULL default '', |
|---|
| 681 | `subscriber` varchar(50) NOT NULL default '', |
|---|
| 682 | `application` varchar(25) NOT NULL default '', |
|---|
| 683 | `destination` varchar(100) NOT NULL default '', |
|---|
| 684 | `region` varchar(25) NOT NULL default '', |
|---|
| 685 | `connect` smallint unsigned NOT NULL, |
|---|
| 686 | `duration` smallint unsigned NOT NULL, |
|---|
| 687 | PRIMARY KEY (`id`), |
|---|
| 688 | UNIQUE KEY `rate_idx` (`gateway`,`domain`,`subscriber`,`destination`,`region`), |
|---|
| 689 | KEY `name_idx` (`region`), |
|---|
| 690 | KEY `dest_idx` (`destination`) |
|---|
| 691 | ) ; |
|---|
| 692 | |
|---|
| 693 | alter table quota_usage add column cost_today decimal(10,4) not null after cost; |
|---|
| 694 | alter table log change column login login varchar(128) not null; |
|---|
| 695 | alter table billing_customers add column increment smallint unsigned not null; |
|---|
| 696 | alter table billing_customers add column min_duration smallint unsigned not null; |
|---|
| 697 | |
|---|