-
Notifications
You must be signed in to change notification settings - Fork 11
/
mya2billing_schema.sql
1863 lines (1645 loc) · 105 KB
/
mya2billing_schema.sql
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
create DATABASE if not exists `mya2billing`;
USE `mya2billing`;
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* This file is part of A2Billing (http://www.a2billing.net/)
*
* A2Billing, Commercial Open Source Telecom Billing platform,
* powered by Star2billing S.L. <http://www.star2billing.com/>
*
* @copyright Copyright (C) 2004-2009 - Star2billing S.L.
* @author Belaid Arezqui <[email protected]>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html
* @package A2Billing
*
* Software License Agreement (GNU Affero General Public License)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
**/
--
-- A2Billing database script - Create user & create database for MYSQL 5.X
--
-- Usage:
-- mysql -u root -p"root password" < a2billing-mysql-schema-v1.3.0.sql
--
-- A2Billing database - Create database schema
--
CREATE TABLE cc_didgroup (
id BIGINT NOT NULL AUTO_INCREMENT,
iduser INT DEFAULT 0 NOT NULL,
didgroupname CHAR(50) NOT NULL,
creationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_did_use (
id BIGINT NOT NULL AUTO_INCREMENT,
id_cc_card BIGINT ,
id_did BIGINT NOT NULL,
reservationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
releasedate TIMESTAMP,
activated INT DEFAULT 0,
month_payed INT DEFAULT 0,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_did (
id BIGINT NOT NULL AUTO_INCREMENT,
id_cc_didgroup BIGINT NOT NULL,
id_cc_country INT NOT NULL,
activated INT DEFAULT '1' NOT NULL,
reserved INT DEFAULT '0',
iduser BIGINT DEFAULT '0' NOT NULL,
did CHAR(50) NOT NULL,
creationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
startingdate TIMESTAMP,
expirationdate TIMESTAMP,
description MEDIUMTEXT,
secondusedreal INT DEFAULT 0,
billingtype INT DEFAULT 0,
fixrate FLOAT DEFAULT 0 NOT NULL,
PRIMARY KEY (id),
UNIQUE cons_cc_did_did (did)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
-- billtype: 0 = fix per month + dialoutrate, 1= fix per month, 2 = dialoutrate, 3 = free
CREATE TABLE cc_did_destination (
id BIGINT NOT NULL AUTO_INCREMENT,
destination CHAR(50) NOT NULL,
priority INT DEFAULT 0 NOT NULL,
id_cc_card BIGINT NOT NULL,
id_cc_did BIGINT NOT NULL,
creationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
activated INT DEFAULT 1 NOT NULL,
secondusedreal INT DEFAULT 0,
voip_call INT DEFAULT 0,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_charge (
id BIGINT NOT NULL AUTO_INCREMENT,
id_cc_card BIGINT NOT NULL,
iduser INT DEFAULT '0' NOT NULL,
creationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
amount FLOAT DEFAULT 0 NOT NULL,
currency CHAR(3) DEFAULT 'USD',
chargetype INT DEFAULT 0,
description MEDIUMTEXT,
id_cc_did BIGINT DEFAULT 0,
id_cc_subscription_fee BIGINT DEFAULT 0,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE INDEX ind_cc_charge_id_cc_card ON cc_charge (id_cc_card);
CREATE INDEX ind_cc_charge_id_cc_subscription_fee ON cc_charge (id_cc_subscription_fee);
CREATE INDEX ind_cc_charge_creationdate ON cc_charge (creationdate);
CREATE TABLE cc_paypal (
id INT (11) NOT NULL AUTO_INCREMENT,
payer_id VARCHAR(50) DEFAULT NULL,
payment_date VARCHAR(30) DEFAULT NULL,
txn_id VARCHAR(30) DEFAULT NULL,
first_name VARCHAR(40) DEFAULT NULL,
last_name VARCHAR(40) DEFAULT NULL,
payer_email VARCHAR(55) DEFAULT NULL,
payer_status VARCHAR(30) DEFAULT NULL,
payment_type VARCHAR(30) DEFAULT NULL,
memo TINYTEXT,
item_name VARCHAR(70) DEFAULT NULL,
item_number VARCHAR(70) DEFAULT NULL,
quantity INT (11) NOT NULL DEFAULT '0',
mc_gross DECIMAL(9,2) DEFAULT NULL,
mc_fee DECIMAL(9,2) DEFAULT NULL,
tax DECIMAL(9,2) DEFAULT NULL,
mc_currency CHAR(3) DEFAULT NULL,
address_name VARCHAR(50) NOT NULL DEFAULT '',
address_street VARCHAR(80) NOT NULL DEFAULT '',
address_city VARCHAR(40) NOT NULL DEFAULT '',
address_state VARCHAR(40) NOT NULL DEFAULT '',
address_zip VARCHAR(20) NOT NULL DEFAULT '',
address_country VARCHAR(30) NOT NULL DEFAULT '',
address_status VARCHAR(30) NOT NULL DEFAULT '',
payer_business_name VARCHAR(40) NOT NULL DEFAULT '',
payment_status VARCHAR(30) NOT NULL DEFAULT '',
pending_reason VARCHAR(50) NOT NULL DEFAULT '',
reason_code VARCHAR(30) NOT NULL DEFAULT '',
txn_type VARCHAR(30) NOT NULL DEFAULT '',
PRIMARY KEY (id),
UNIQUE KEY txn_id (txn_id),
KEY txn_id_2 (txn_id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_voucher (
id BIGINT NOT NULL AUTO_INCREMENT,
creationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
usedate TIMESTAMP,
expirationdate TIMESTAMP,
voucher CHAR(50) NOT NULL,
usedcardnumber CHAR(50),
tag CHAR(50),
credit FLOAT DEFAULT 0 NOT NULL,
activated CHAR(1) DEFAULT 'f' NOT NULL,
used INT DEFAULT 0,
currency CHAR(3) DEFAULT 'USD',
PRIMARY KEY (id),
UNIQUE cons_cc_voucher_voucher (voucher)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_service (
id BIGINT NOT NULL AUTO_INCREMENT,
name CHAR(100) NOT NULL,
amount FLOAT NOT NULL,
period INT NOT NULL DEFAULT '1',
rule INT NOT NULL DEFAULT '0',
daynumber INT NOT NULL DEFAULT '0',
stopmode INT NOT NULL DEFAULT '0',
maxnumbercycle INT NOT NULL DEFAULT '0',
status INT NOT NULL DEFAULT '0',
numberofrun INT NOT NULL DEFAULT '0',
datecreate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
datelastrun TIMESTAMP,
emailreport CHAR(100) NOT NULL,
totalcredit FLOAT NOT NULL DEFAULT '0',
totalcardperform INT NOT NULL DEFAULT '0',
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_service_report (
id BIGINT NOT NULL AUTO_INCREMENT,
cc_service_id BIGINT NOT NULL,
daterun TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
totalcardperform INT ,
totalcredit FLOAT ,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_callerid (
id BIGINT NOT NULL AUTO_INCREMENT,
cid CHAR(100) NULL,
id_cc_card BIGINT NOT NULL,
activated CHAR(1) DEFAULT 't' NOT NULL,
PRIMARY KEY (id),
UNIQUE cons_cc_callerid_cid (cid)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_ui_authen (
userid BIGINT NOT NULL AUTO_INCREMENT,
login CHAR(50) NOT NULL,
password CHAR(50) NOT NULL,
groupid INT ,
perms INT ,
confaddcust INT ,
name CHAR(50),
direction CHAR(80),
zipcode CHAR(20),
state CHAR(20),
phone CHAR(30),
fax CHAR(30),
datecreation TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (userid),
UNIQUE cons_cc_ui_authen_login (login)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_call (
id bigINT (20) NOT NULL AUTO_INCREMENT,
sessionid char(40) NOT NULL,
uniqueid char(30) NOT NULL,
username char(40) NOT NULL,
nasipaddress char(30) DEFAULT NULL,
starttime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
stoptime timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
sessiontime INT (11) DEFAULT NULL,
calledstation char(30) DEFAULT NULL,
startdelay INT (11) DEFAULT NULL,
stopdelay INT (11) DEFAULT NULL,
terminatecause char(20) DEFAULT NULL,
usertariff char(20) DEFAULT NULL,
calledprovider char(20) DEFAULT NULL,
calledcountry char(30) DEFAULT NULL,
calledsub char(20) DEFAULT NULL,
calledrate FLOAT DEFAULT NULL,
sessionbill FLOAT DEFAULT NULL,
destination char(40) DEFAULT NULL,
id_tariffgroup INT (11) DEFAULT NULL,
id_tariffplan INT (11) DEFAULT NULL,
id_ratecard INT (11) DEFAULT NULL,
id_trunk INT (11) DEFAULT NULL,
sipiax INT (11) DEFAULT '0',
src char(40) DEFAULT NULL,
id_did INT (11) DEFAULT NULL,
buyrate DECIMAL(15,5) DEFAULT 0,
buycost DECIMAL(15,5) DEFAULT 0,
id_card_package_offer INT (11) DEFAULT 0,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_templatemail (
mailtype CHAR(50),
fromemail CHAR(70),
fromname CHAR(70),
subject CHAR(70),
messagetext LONGTEXT,
messagehtml LONGTEXT,
UNIQUE cons_cc_templatemail_mailtype (mailtype)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_tariffgroup (
id INT NOT NULL AUTO_INCREMENT,
iduser INT DEFAULT 0 NOT NULL,
idtariffplan INT DEFAULT 0 NOT NULL,
tariffgroupname CHAR(50) NOT NULL,
lcrtype INT DEFAULT 0 NOT NULL,
creationdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
removeinterprefix INT DEFAULT 0 NOT NULL,
id_cc_package_offer BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_tariffgroup_plan (
idtariffgroup INT NOT NULL,
idtariffplan INT NOT NULL,
PRIMARY KEY (idtariffgroup, idtariffplan)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_tariffplan (
id INT NOT NULL AUTO_INCREMENT,
iduser INT DEFAULT 0 NOT NULL,
tariffname CHAR(50) NOT NULL,
creationdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
startingdate TIMESTAMP,
expirationdate TIMESTAMP,
description MEDIUMTEXT,
id_trunk INT DEFAULT 0,
secondusedreal INT DEFAULT 0,
secondusedcarrier INT DEFAULT 0,
secondusedratecard INT DEFAULT 0,
reftariffplan INT DEFAULT 0,
idowner INT DEFAULT 0,
dnidprefix CHAR(30) NOT NULL DEFAULT 'all',
calleridprefix CHAR(30) NOT NULL DEFAULT 'all',
PRIMARY KEY (id),
UNIQUE cons_cc_tariffplan_iduser_tariffname (iduser,tariffname)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_card (
id BIGINT NOT NULL AUTO_INCREMENT,
creationdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
firstusedate TIMESTAMP,
expirationdate TIMESTAMP,
enableexpire INT DEFAULT 0,
expiredays INT DEFAULT 0,
username CHAR(50) NOT NULL,
useralias CHAR(50) NOT NULL,
userpass CHAR(50) NOT NULL,
uipass CHAR(50),
credit DECIMAL(15,5) DEFAULT 0 NOT NULL,
tariff INT DEFAULT 0,
id_didgroup INT DEFAULT 0,
activated CHAR(1) DEFAULT 'f' NOT NULL,
lastname CHAR(50),
firstname CHAR(50),
address CHAR(100),
city CHAR(40),
state CHAR(40),
country CHAR(40),
zipcode CHAR(20),
phone CHAR(20),
email CHAR(70),
fax CHAR(20),
inuse INT DEFAULT 0,
simultaccess INT DEFAULT 0,
currency CHAR(3) DEFAULT 'USD',
lastuse TIMESTAMP,
nbused INT DEFAULT 0,
typepaid INT DEFAULT 0,
creditlimit INT DEFAULT 0,
voipcall INT DEFAULT 0,
sip_buddy INT DEFAULT 0,
iax_buddy INT DEFAULT 0,
language CHAR(5) DEFAULT 'en',
redial CHAR(50),
runservice INT DEFAULT 0,
nbservice INT DEFAULT 0,
id_campaign INT DEFAULT 0,
num_trials_done BIGINT DEFAULT 0,
callback CHAR(50),
vat FLOAT DEFAULT 0 NOT NULL,
servicelastrun TIMESTAMP,
initialbalance DECIMAL(15,5) DEFAULT 0 NOT NULL,
invoiceday INT DEFAULT 1,
autorefill INT DEFAULT 0,
loginkey CHAR(40),
activatedbyuser CHAR(1) DEFAULT 't' NOT NULL,
id_subscription_fee INT DEFAULT 0,
mac_addr CHAR(17) DEFAULT '00-00-00-00-00-00' NOT NULL,
PRIMARY KEY (id),
UNIQUE cons_cc_card_username (username),
UNIQUE cons_cc_card_useralias (useralias)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_ratecard (
id INT NOT NULL AUTO_INCREMENT,
idtariffplan INT DEFAULT 0 NOT NULL,
dialprefix CHAR(30) NOT NULL,
destination CHAR(50) NOT NULL,
buyrate FLOAT DEFAULT 0 NOT NULL,
buyrateinitblock INT DEFAULT 0 NOT NULL,
buyrateincrement INT DEFAULT 0 NOT NULL,
rateinitial FLOAT DEFAULT 0 NOT NULL,
initblock INT DEFAULT 0 NOT NULL,
billingblock INT DEFAULT 0 NOT NULL,
connectcharge FLOAT DEFAULT 0 NOT NULL,
disconnectcharge FLOAT DEFAULT 0 NOT NULL,
stepchargea FLOAT DEFAULT 0 NOT NULL,
chargea FLOAT DEFAULT 0 NOT NULL,
timechargea INT DEFAULT 0 NOT NULL,
billingblocka INT DEFAULT 0 NOT NULL,
stepchargeb FLOAT DEFAULT 0 NOT NULL,
chargeb FLOAT DEFAULT 0 NOT NULL,
timechargeb INT DEFAULT 0 NOT NULL,
billingblockb INT DEFAULT 0 NOT NULL,
stepchargec FLOAT DEFAULT 0 NOT NULL,
chargec FLOAT DEFAULT 0 NOT NULL,
timechargec INT DEFAULT 0 NOT NULL,
billingblockc INT DEFAULT 0 NOT NULL,
startdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
stopdate TIMESTAMP,
starttime SMALLINT (5) unsigned DEFAULT '0',
endtime SMALLINT (5) unsigned DEFAULT '10079',
id_trunk INT DEFAULT -1,
musiconhold CHAR(100) NOT NULL,
freetimetocall_package_offer INT NOT NULL DEFAULT 0,
id_outbound_cidgroup INT DEFAULT -1,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE INDEX ind_cc_ratecard_dialprefix ON cc_ratecard (dialprefix);
CREATE TABLE cc_logrefill (
id INT NOT NULL AUTO_INCREMENT,
date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
credit FLOAT NOT NULL,
card_id BIGINT NOT NULL,
reseller_id BIGINT ,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_logpayment (
id INT NOT NULL AUTO_INCREMENT,
date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
payment FLOAT NOT NULL,
card_id BIGINT NOT NULL,
reseller_id BIGINT ,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_trunk (
id_trunk INT NOT NULL AUTO_INCREMENT,
trunkcode CHAR(20) NOT NULL,
trunkprefix CHAR(20),
providertech CHAR(20) NOT NULL,
providerip CHAR(80) NOT NULL,
removeprefix CHAR(20),
secondusedreal INT DEFAULT 0,
secondusedcarrier INT DEFAULT 0,
secondusedratecard INT DEFAULT 0,
creationdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
failover_trunk INT ,
addparameter CHAR(120),
id_provider INT ,
PRIMARY KEY (id_trunk)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_sip_buddies (
id INT NOT NULL AUTO_INCREMENT,
id_cc_card INT DEFAULT 0 NOT NULL,
name CHAR(80) DEFAULT '' NOT NULL,
accountcode CHAR(20),
regexten CHAR(20),
amaflags CHAR(7),
callgroup CHAR(10),
callerid CHAR(80),
canreinvite CHAR(3) DEFAULT 'yes',
context CHAR(80),
DEFAULTip CHAR(15),
dtmfmode CHAR(7) DEFAULT 'RFC2833' NOT NULL,
fromuser CHAR(80),
fromdomain CHAR(80),
host CHAR(31) DEFAULT '' NOT NULL,
insecure CHAR(20),
language CHAR(2),
mailbox CHAR(50),
md5secret CHAR(80),
nat CHAR(3) DEFAULT 'yes',
permit CHAR(95),
deny CHAR(95),
mask CHAR(95),
pickupgroup CHAR(10),
port CHAR(5) DEFAULT '' NOT NULL,
qualify CHAR(7) DEFAULT 'yes',
restrictcid CHAR(1),
rtptimeout CHAR(3),
rtpholdtimeout CHAR(3),
secret CHAR(80),
type CHAR(6) DEFAULT 'friend' NOT NULL,
username CHAR(80) DEFAULT '' NOT NULL,
disallow CHAR(100) DEFAULT 'all',
allow CHAR(100) DEFAULT 'gsm,ulaw,alaw',
musiconhold CHAR(100),
regseconds INT DEFAULT 0 NOT NULL,
ipaddr CHAR(15) DEFAULT '' NOT NULL,
cancallforward CHAR(3) DEFAULT 'yes',
fullcontact VARCHAR(80) DEFAULT NULL,
setvar VARCHAR(100) NOT NULL DEFAULT '',
PRIMARY KEY (id),
UNIQUE cons_cc_sip_buddies_name (name)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_iax_buddies (
id INT NOT NULL AUTO_INCREMENT,
id_cc_card INT DEFAULT 0 NOT NULL,
name CHAR(80) DEFAULT '' NOT NULL,
accountcode CHAR(20),
regexten CHAR(20),
amaflags CHAR(7),
callgroup CHAR(10),
callerid CHAR(80),
canreinvite CHAR(3) DEFAULT 'yes',
context CHAR(80),
DEFAULTip CHAR(15),
dtmfmode CHAR(7) DEFAULT 'RFC2833' NOT NULL,
fromuser CHAR(80),
fromdomain CHAR(80),
host CHAR(31) DEFAULT '' NOT NULL,
insecure CHAR(20),
language CHAR(2),
mailbox CHAR(50),
md5secret CHAR(80),
nat CHAR(3) DEFAULT 'yes',
permit CHAR(95),
deny CHAR(95),
mask CHAR(95),
pickupgroup CHAR(10),
port CHAR(5) DEFAULT '' NOT NULL,
qualify CHAR(7) DEFAULT 'yes',
restrictcid CHAR(1),
rtptimeout CHAR(3),
rtpholdtimeout CHAR(3),
secret CHAR(80),
type CHAR(6) DEFAULT 'friend' NOT NULL,
username CHAR(80) DEFAULT '' NOT NULL,
disallow CHAR(100) DEFAULT 'all',
allow CHAR(100) DEFAULT 'gsm,ulaw,alaw',
musiconhold CHAR(100),
regseconds INT DEFAULT 0 NOT NULL,
ipaddr CHAR(15) DEFAULT '' NOT NULL,
cancallforward CHAR(3) DEFAULT 'yes',
PRIMARY KEY (id),
UNIQUE cons_cc_iax_buddies_name (name)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
INSERT INTO cc_ui_authen VALUES (1, 'root', 'myroot', 0, 32767, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CURRENT_TIMESTAMP);
INSERT INTO cc_templatemail (mailtype, fromemail, fromname, subject, messagetext, messagehtml) VALUES ('signup', '[email protected]', 'Call-Labs', 'SIGNUP CONFIRMATION', '
Thank you for registering with us
Please click on below link to activate your account.
http://myaccount.mydomainname.com/activate.php?key=$loginkey$
Please make sure you active your account by making payment to us either by
credit card, wire transfer, money order, cheque, and western union money
transfer, money Gram, and Pay pal.
Kind regards,
/My Company Name
', '');
INSERT INTO cc_templatemail (mailtype, fromemail, fromname, subject, messagetext, messagehtml) VALUES ('reminder', '[email protected]', 'Call-Labs', 'REMINDER', '
Our record indicates that you have less than $min_credit usd in your "$cardnumber$" account.
We hope this message provides you with enough notice to refill your account.
We value your business, but our system can disconnect you automatically
when you reach your pre-paid balance.
Please login to your account through our website to check your account
details. Plus, you can pay by credit card, on demand.
If you believe this information to be incorrect please contact
immediately.
Kind regards,
/My Company Name
', '');
INSERT INTO cc_templatemail (mailtype, fromemail, fromname, subject, messagetext, messagehtml) VALUES ('forgetpassword', '[email protected]', 'Call-Labs', 'Login Information', 'Your login information is as below:
Your account is $cardnumber$
Your password is $password$
Your login is $cardalias$
http://myaccount.mydomainname.com/
Kind regards,
/My Company Name
http://www.mydomainname.com
', '');
INSERT INTO cc_templatemail (mailtype, fromemail, fromname, subject, messagetext, messagehtml) VALUES ('signupconfirmed', '[email protected]', 'Call-Labs', 'SIGNUP CONFIRMATION', 'Thank you for registering with us
Please make sure you active your account by making payment to us either by
credit card, wire transfer, money order, cheque, and western union money
transfer, money Gram, and Pay pal.
Your account is $cardnumber$
Your password is $password$
To go to your account :
http://myaccount.mydomainname.com/
Kind regards,
/My Company Name
', '');
INSERT INTO cc_templatemail (mailtype, fromemail, fromname, subject, messagetext, messagehtml) VALUES ('epaymentverify', '[email protected]', 'Call-Labs', 'Epayment Gateway Security Verification Failed', 'Dear Administrator
Please check the Epayment Log, System has logged a Epayment Security failure. that may be a possible attack on epayment processing.
Time of Transaction: $time$
Payment Gateway: $paymentgateway$
Amount: $itemAmount$
Kind regards,
/My Company Name
http://www.mydomainname.com
', '');
INSERT INTO cc_templatemail (mailtype, fromemail, fromname, subject, messagetext, messagehtml) VALUES ('payment', '[email protected]', 'Call-Labs', 'PAYMENT CONFIRMATION', 'Thank you for shopping at Call-Labs.
Shopping details is as below.
Item Name = <b>$itemName$</b>
Item ID = <b>$itemID$</b>
Amount = <b>$itemAmount$</b>
Payment Method = <b>$paymentMethod$</b>
Status = <b>$paymentStatus$</b>
Kind regards,
/My Company Name
', '');
INSERT INTO cc_templatemail (mailtype, fromemail, fromname, subject, messagetext, messagehtml) VALUES ('invoice', '[email protected]', 'Call-Labs', 'A2BILLING INVOICE', 'Dear Customer.
Attached is the invoice.
Kind regards,
/My Company Name
http://www.mydomainname.com
', '');
INSERT INTO cc_trunk VALUES (1, 'DEFAULT', '011', 'IAX2', '[email protected]', '', 0, 0, 0, CURRENT_TIMESTAMP, 0, '', NULL);
--
-- Country table : Store the iso country list
--
CREATE TABLE cc_country (
id BIGINT NOT NULL AUTO_INCREMENT,
countrycode CHAR(80) NOT NULL,
countryprefix CHAR(80) NOT NULL,
countryname CHAR(80) NOT NULL,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
INSERT INTO cc_country VALUES (1, 'AFG' ,'93', 'Afghanistan');
INSERT INTO cc_country VALUES (2, 'ALB' ,'355', 'Albania');
INSERT INTO cc_country VALUES (3, 'DZA' ,'213', 'Algeria');
INSERT INTO cc_country VALUES (4, 'ASM' ,'684', 'American Samoa');
INSERT INTO cc_country VALUES (5, 'AND' ,'376', 'Andorra');
INSERT INTO cc_country VALUES (6, 'AGO' ,'244', 'Angola');
INSERT INTO cc_country VALUES (7, 'AIA' ,'1264', 'Anguilla');
INSERT INTO cc_country VALUES (8, 'ATA' ,'672', 'Antarctica');
INSERT INTO cc_country VALUES (9, 'ATG' ,'1268', 'Antigua And Barbuda');
INSERT INTO cc_country VALUES (10, 'ARG' ,'54', 'Argentina');
INSERT INTO cc_country VALUES (11, 'ARM' ,'374', 'Armenia');
INSERT INTO cc_country VALUES (12, 'ABW' ,'297', 'Aruba');
INSERT INTO cc_country VALUES (13, 'AUS' ,'61', 'Australia');
INSERT INTO cc_country VALUES (14, 'AUT' ,'43', 'Austria');
INSERT INTO cc_country VALUES (15, 'AZE' ,'994', 'Azerbaijan');
INSERT INTO cc_country VALUES (16, 'BHS' ,'1242', 'Bahamas');
INSERT INTO cc_country VALUES (17, 'BHR' ,'973', 'Bahrain');
INSERT INTO cc_country VALUES (18, 'BGD' ,'880', 'Bangladesh');
INSERT INTO cc_country VALUES (19, 'BRB' ,'1246', 'Barbados');
INSERT INTO cc_country VALUES (20, 'BLR' ,'375', 'Belarus');
INSERT INTO cc_country VALUES (21, 'BEL' ,'32', 'Belgium');
INSERT INTO cc_country VALUES (22, 'BLZ' ,'501', 'Belize');
INSERT INTO cc_country VALUES (23, 'BEN' ,'229', 'Benin');
INSERT INTO cc_country VALUES (24, 'BMU' ,'1441', 'Bermuda');
INSERT INTO cc_country VALUES (25, 'BTN' ,'975', 'Bhutan');
INSERT INTO cc_country VALUES (26, 'BOL' ,'591', 'Bolivia');
INSERT INTO cc_country VALUES (27, 'BIH' ,'387', 'Bosnia And Herzegovina');
INSERT INTO cc_country VALUES (28, 'BWA' ,'267', 'Botswana');
INSERT INTO cc_country VALUES (29, 'BVT' ,'0', 'Bouvet Island');
INSERT INTO cc_country VALUES (30, 'BRA' ,'55', 'Brazil');
INSERT INTO cc_country VALUES (31, 'IOT' ,'1284', 'British Indian Ocean Territory');
INSERT INTO cc_country VALUES (32, 'BRN' ,'673', 'Brunei Darussalam');
INSERT INTO cc_country VALUES (33, 'BGR' ,'359', 'Bulgaria');
INSERT INTO cc_country VALUES (34, 'BFA' ,'226', 'Burkina Faso');
INSERT INTO cc_country VALUES (35, 'BDI' ,'257', 'Burundi');
INSERT INTO cc_country VALUES (36, 'KHM' ,'855', 'Cambodia');
INSERT INTO cc_country VALUES (37, 'CMR' ,'237', 'Cameroon');
INSERT INTO cc_country VALUES (38, 'CAN' ,'1', 'Canada');
INSERT INTO cc_country VALUES (39, 'CPV' ,'238', 'Cape Verde');
INSERT INTO cc_country VALUES (40, 'CYM' ,'1345', 'Cayman Islands');
INSERT INTO cc_country VALUES (41, 'CAF' ,'236', 'Central African Republic');
INSERT INTO cc_country VALUES (42, 'TCD' ,'235', 'Chad');
INSERT INTO cc_country VALUES (43, 'CHL' ,'56', 'Chile');
INSERT INTO cc_country VALUES (44, 'CHN' ,'86', 'China');
INSERT INTO cc_country VALUES (45, 'CXR' ,'618', 'Christmas Island');
INSERT INTO cc_country VALUES (46, 'CCK' ,'61', 'Cocos (Keeling); Islands');
INSERT INTO cc_country VALUES (47, 'COL' ,'57', 'Colombia');
INSERT INTO cc_country VALUES (48, 'COM' ,'269', 'Comoros');
INSERT INTO cc_country VALUES (49, 'COG' ,'242', 'Congo');
INSERT INTO cc_country VALUES (50, 'COD' ,'243','Congo, The Democratic Republic Of The');
INSERT INTO cc_country VALUES (51, 'COK' ,'682', 'Cook Islands');
INSERT INTO cc_country VALUES (52, 'CRI' ,'506', 'Costa Rica');
INSERT INTO cc_country VALUES (54, 'HRV' ,'385', 'Croatia');
INSERT INTO cc_country VALUES (55, 'CUB' ,'53', 'Cuba');
INSERT INTO cc_country VALUES (56, 'CYP' ,'357', 'Cyprus');
INSERT INTO cc_country VALUES (57, 'CZE' ,'420', 'Czech Republic');
INSERT INTO cc_country VALUES (58, 'DNK' ,'45', 'Denmark');
INSERT INTO cc_country VALUES (59, 'DJI' ,'253', 'Djibouti');
INSERT INTO cc_country VALUES (60, 'DMA' ,'1767', 'Dominica');
INSERT INTO cc_country VALUES (61, 'DOM' ,'1809', 'Dominican Republic');
INSERT INTO cc_country VALUES (62, 'ECU' ,'593', 'Ecuador');
INSERT INTO cc_country VALUES (63, 'EGY' ,'20', 'Egypt');
INSERT INTO cc_country VALUES (64, 'SLV' ,'503', 'El Salvador');
INSERT INTO cc_country VALUES (65, 'GNQ' ,'240', 'Equatorial Guinea');
INSERT INTO cc_country VALUES (66, 'ERI' ,'291', 'Eritrea');
INSERT INTO cc_country VALUES (67, 'EST' ,'372', 'Estonia');
INSERT INTO cc_country VALUES (68, 'ETH' ,'251', 'Ethiopia');
INSERT INTO cc_country VALUES (69, 'FLK' ,'500', 'Falkland Islands (Malvinas);');
INSERT INTO cc_country VALUES (70, 'FRO' ,'298', 'Faroe Islands');
INSERT INTO cc_country VALUES (71, 'FJI' ,'679', 'Fiji');
INSERT INTO cc_country VALUES (72, 'FIN' ,'358', 'Finland');
INSERT INTO cc_country VALUES (73, 'FRA' ,'33', 'France');
INSERT INTO cc_country VALUES (74, 'GUF' ,'596', 'French Guiana');
INSERT INTO cc_country VALUES (75, 'PYF' ,'594', 'French Polynesia');
INSERT INTO cc_country VALUES (76, 'ATF' ,'689', 'French Southern Territories');
INSERT INTO cc_country VALUES (77, 'GAB' ,'241', 'Gabon');
INSERT INTO cc_country VALUES (78, 'GMB' ,'220', 'Gambia');
INSERT INTO cc_country VALUES (79, 'GEO' ,'995', 'Georgia');
INSERT INTO cc_country VALUES (80, 'DEU' ,'49', 'Germany');
INSERT INTO cc_country VALUES (81, 'GHA' ,'233', 'Ghana');
INSERT INTO cc_country VALUES (82, 'GIB' ,'350', 'Gibraltar');
INSERT INTO cc_country VALUES (83, 'GRC' ,'30', 'Greece');
INSERT INTO cc_country VALUES (84, 'GRL' ,'299', 'Greenland');
INSERT INTO cc_country VALUES (85, 'GRD' ,'1473', 'Grenada');
INSERT INTO cc_country VALUES (86, 'GLP' ,'590', 'Guadeloupe');
INSERT INTO cc_country VALUES (87, 'GUM' ,'1671', 'Guam');
INSERT INTO cc_country VALUES (88, 'GTM' ,'502', 'Guatemala');
INSERT INTO cc_country VALUES (89, 'GIN' ,'224', 'Guinea');
INSERT INTO cc_country VALUES (90, 'GNB' ,'245', 'Guinea-Bissau');
INSERT INTO cc_country VALUES (91, 'GUY' ,'592', 'Guyana');
INSERT INTO cc_country VALUES (92, 'HTI' ,'509', 'Haiti');
INSERT INTO cc_country VALUES (93, 'HMD' ,'0', 'Heard Island And McDonald Islands');
INSERT INTO cc_country VALUES (94, 'VAT' ,'0', 'Holy See (Vatican City State);');
INSERT INTO cc_country VALUES (95, 'HND' ,'504', 'Honduras');
INSERT INTO cc_country VALUES (96, 'HKG' ,'852', 'Hong Kong');
INSERT INTO cc_country VALUES (97, 'HUN' ,'36', 'Hungary');
INSERT INTO cc_country VALUES (98, 'ISL' ,'354', 'Iceland');
INSERT INTO cc_country VALUES (99, 'IND' ,'91', 'India');
INSERT INTO cc_country VALUES (100, 'IDN' ,'62', 'Indonesia');
INSERT INTO cc_country VALUES (101, 'IRN' ,'98', 'Iran, Islamic Republic Of');
INSERT INTO cc_country VALUES (102, 'IRQ' ,'964', 'Iraq');
INSERT INTO cc_country VALUES (103, 'IRL' ,'353', 'Ireland');
INSERT INTO cc_country VALUES (104, 'ISR' ,'972', 'Israel');
INSERT INTO cc_country VALUES (105, 'ITA' ,'39', 'Italy');
INSERT INTO cc_country VALUES (106, 'JAM' ,'1876', 'Jamaica');
INSERT INTO cc_country VALUES (107, 'JPN' ,'81', 'Japan');
INSERT INTO cc_country VALUES (108, 'JOR' ,'962', 'Jordan');
INSERT INTO cc_country VALUES (109, 'KAZ' ,'7', 'Kazakhstan');
INSERT INTO cc_country VALUES (110, 'KEN' ,'254', 'Kenya');
INSERT INTO cc_country VALUES (111, 'KIR' ,'686', 'Kiribati');
INSERT INTO cc_country VALUES (112, 'PRK' ,'850', 'Korea, Democratic People''s Republic Of');
INSERT INTO cc_country VALUES (113, 'KOR' ,'82', 'Korea, Republic of');
INSERT INTO cc_country VALUES (114, 'KWT' ,'965', 'Kuwait');
INSERT INTO cc_country VALUES (115, 'KGZ' ,'996', 'Kyrgyzstan');
INSERT INTO cc_country VALUES (116, 'LAO' ,'856', 'Lao People''s Democratic Republic');
INSERT INTO cc_country VALUES (117, 'LVA' ,'371', 'Latvia');
INSERT INTO cc_country VALUES (118, 'LBN' ,'961', 'Lebanon');
INSERT INTO cc_country VALUES (119, 'LSO' ,'266', 'Lesotho');
INSERT INTO cc_country VALUES (120, 'LBR' ,'231', 'Liberia');
INSERT INTO cc_country VALUES (121, 'LBY' ,'218', 'Libyan Arab Jamahiriya');
INSERT INTO cc_country VALUES (122, 'LIE' ,'423', 'Liechtenstein');
INSERT INTO cc_country VALUES (123, 'LTU' ,'370', 'Lithuania');
INSERT INTO cc_country VALUES (124, 'LUX' ,'352', 'Luxembourg');
INSERT INTO cc_country VALUES (125, 'MAC' ,'853', 'Macao');
INSERT INTO cc_country VALUES (126, 'MKD' ,'389', 'Macedonia, The Former Yugoslav Republic Of');
INSERT INTO cc_country VALUES (127, 'MDG' ,'261', 'Madagascar');
INSERT INTO cc_country VALUES (128, 'MWI' ,'265', 'Malawi');
INSERT INTO cc_country VALUES (129, 'MYS' ,'60', 'Malaysia');
INSERT INTO cc_country VALUES (130, 'MDV' ,'960', 'Maldives');
INSERT INTO cc_country VALUES (131, 'MLI' ,'223', 'Mali');
INSERT INTO cc_country VALUES (132, 'MLT' ,'356', 'Malta');
INSERT INTO cc_country VALUES (133, 'MHL' ,'692', 'Marshall islands');
INSERT INTO cc_country VALUES (134, 'MTQ' ,'596', 'Martinique');
INSERT INTO cc_country VALUES (135, 'MRT' ,'222', 'Mauritania');
INSERT INTO cc_country VALUES (136, 'MUS' ,'230', 'Mauritius');
INSERT INTO cc_country VALUES (137, 'MYT' ,'269', 'Mayotte');
INSERT INTO cc_country VALUES (138, 'MEX' ,'52', 'Mexico');
INSERT INTO cc_country VALUES (139, 'FSM' ,'691', 'Micronesia, Federated States Of');
INSERT INTO cc_country VALUES (140, 'MDA' ,'1808', 'Moldova, Republic Of');
INSERT INTO cc_country VALUES (141, 'MCO' ,'377', 'Monaco');
INSERT INTO cc_country VALUES (142, 'MNG' ,'976', 'Mongolia');
INSERT INTO cc_country VALUES (143, 'MSR' ,'1664', 'Montserrat');
INSERT INTO cc_country VALUES (144, 'MAR' ,'212', 'Morocco');
INSERT INTO cc_country VALUES (145, 'MOZ' ,'258', 'Mozambique');
INSERT INTO cc_country VALUES (146, 'MMR' ,'95', 'Myanmar');
INSERT INTO cc_country VALUES (147, 'NAM' ,'264', 'Namibia');
INSERT INTO cc_country VALUES (148, 'NRU' ,'674', 'Nauru');
INSERT INTO cc_country VALUES (149, 'NPL' ,'977', 'Nepal');
INSERT INTO cc_country VALUES (150, 'NLD' ,'31', 'Netherlands');
INSERT INTO cc_country VALUES (151, 'ANT' ,'599', 'Netherlands Antilles');
INSERT INTO cc_country VALUES (152, 'NCL' ,'687', 'New Caledonia');
INSERT INTO cc_country VALUES (153, 'NZL' ,'64', 'New Zealand');
INSERT INTO cc_country VALUES (154, 'NIC' ,'505', 'Nicaragua');
INSERT INTO cc_country VALUES (155, 'NER' ,'227', 'Niger');
INSERT INTO cc_country VALUES (156, 'NGA' ,'234', 'Nigeria');
INSERT INTO cc_country VALUES (157, 'NIU' ,'683', 'Niue');
INSERT INTO cc_country VALUES (158, 'NFK' ,'672', 'Norfolk Island');
INSERT INTO cc_country VALUES (159, 'MNP' ,'1670', 'Northern Mariana Islands');
INSERT INTO cc_country VALUES (160, 'NOR' ,'47', 'Norway');
INSERT INTO cc_country VALUES (161, 'OMN' ,'968', 'Oman');
INSERT INTO cc_country VALUES (162, 'PAK' ,'92', 'Pakistan');
INSERT INTO cc_country VALUES (163, 'PLW' ,'680', 'Palau');
INSERT INTO cc_country VALUES (164, 'PSE' ,'970', 'Palestinian Territory, Occupied');
INSERT INTO cc_country VALUES (165, 'PAN' ,'507', 'Panama');
INSERT INTO cc_country VALUES (166, 'PNG' ,'675', 'Papua New Guinea');
INSERT INTO cc_country VALUES (167, 'PRY' ,'595', 'Paraguay');
INSERT INTO cc_country VALUES (168, 'PER' ,'51', 'Peru');
INSERT INTO cc_country VALUES (169, 'PHL' ,'63', 'Philippines');
INSERT INTO cc_country VALUES (170, 'PCN' ,'0', 'Pitcairn');
INSERT INTO cc_country VALUES (171, 'POL' ,'48', 'Poland');
INSERT INTO cc_country VALUES (172, 'PRT' ,'351', 'Portugal');
INSERT INTO cc_country VALUES (173, 'PRI' ,'1787', 'Puerto Rico');
INSERT INTO cc_country VALUES (174, 'QAT' ,'974', 'Qatar');
INSERT INTO cc_country VALUES (175, 'REU' ,'262', 'Reunion');
INSERT INTO cc_country VALUES (176, 'ROU' ,'40', 'Romania');
INSERT INTO cc_country VALUES (177, 'RUS' ,'7', 'Russian Federation');
INSERT INTO cc_country VALUES (178, 'RWA' ,'250', 'Rwanda');
INSERT INTO cc_country VALUES (179, 'SHN' ,'290', 'SaINT Helena');
INSERT INTO cc_country VALUES (180, 'KNA' ,'1869', 'SaINT Kitts And Nevis');
INSERT INTO cc_country VALUES (181, 'LCA' ,'1758', 'SaINT Lucia');
INSERT INTO cc_country VALUES (182, 'SPM' ,'508', 'SaINT Pierre And Miquelon');
INSERT INTO cc_country VALUES (183, 'VCT' ,'1784', 'SaINT Vincent And The Grenadines');
INSERT INTO cc_country VALUES (184, 'WSM' ,'685', 'Samoa');
INSERT INTO cc_country VALUES (185, 'SMR' ,'378', 'San Marino');
INSERT INTO cc_country VALUES (186, 'STP' ,'239', 'São Tomé And Principe');
INSERT INTO cc_country VALUES (187, 'SAU' ,'966', 'Saudi Arabia');
INSERT INTO cc_country VALUES (188, 'SEN' ,'221', 'Senegal');
INSERT INTO cc_country VALUES (189, 'SYC' ,'248', 'Seychelles');
INSERT INTO cc_country VALUES (190, 'SLE' ,'232', 'Sierra Leone');
INSERT INTO cc_country VALUES (191, 'SGP' ,'65', 'Singapore');
INSERT INTO cc_country VALUES (192, 'SVK' ,'421', 'Slovakia');
INSERT INTO cc_country VALUES (193, 'SVN' ,'386', 'Slovenia');
INSERT INTO cc_country VALUES (194, 'SLB' ,'677', 'Solomon Islands');
INSERT INTO cc_country VALUES (195, 'SOM' ,'252', 'Somalia');
INSERT INTO cc_country VALUES (196, 'ZAF' ,'27', 'South Africa');
INSERT INTO cc_country VALUES (197, 'SGS' ,'0', 'South Georgia And The South Sandwich Islands');
INSERT INTO cc_country VALUES (198, 'ESP' ,'34', 'Spain');
INSERT INTO cc_country VALUES (199, 'LKA' ,'94', 'Sri Lanka');
INSERT INTO cc_country VALUES (200, 'SDN' ,'249', 'Sudan');
INSERT INTO cc_country VALUES (201, 'SUR' ,'597', 'Suriname');
INSERT INTO cc_country VALUES (202, 'SJM' ,'0', 'Svalbard and Jan Mayen');
INSERT INTO cc_country VALUES (203, 'SWZ' ,'268', 'Swaziland');
INSERT INTO cc_country VALUES (204, 'SWE' ,'46', 'Sweden');
INSERT INTO cc_country VALUES (205, 'CHE' ,'41', 'Switzerland');
INSERT INTO cc_country VALUES (206, 'SYR' ,'963', 'Syrian Arab Republic');
INSERT INTO cc_country VALUES (207, 'TWN' ,'886', 'Taiwan, Province Of China');
INSERT INTO cc_country VALUES (208, 'TJK' ,'992', 'Tajikistan');
INSERT INTO cc_country VALUES (209, 'TZA' ,'255', 'Tanzania, United Republic Of');
INSERT INTO cc_country VALUES (210, 'THA' ,'66', 'Thailand');
INSERT INTO cc_country VALUES (211, 'TLS' ,'670', 'Timor-Leste');
INSERT INTO cc_country VALUES (212, 'TGO' ,'228', 'Togo');
INSERT INTO cc_country VALUES (213, 'TKL' ,'690', 'Tokelau');
INSERT INTO cc_country VALUES (214, 'TON' ,'676', 'Tonga');
INSERT INTO cc_country VALUES (215, 'TTO' ,'1868', 'Trinidad And Tobago');
INSERT INTO cc_country VALUES (216, 'TUN' ,'216', 'Tunisia');
INSERT INTO cc_country VALUES (217, 'TUR' ,'90', 'Turkey');
INSERT INTO cc_country VALUES (218, 'TKM' ,'993', 'Turkmenistan');
INSERT INTO cc_country VALUES (219, 'TCA' ,'1649', 'Turks And Caicos Islands');
INSERT INTO cc_country VALUES (220, 'TUV' ,'688', 'Tuvalu');
INSERT INTO cc_country VALUES (221, 'UGA' ,'256', 'Uganda');
INSERT INTO cc_country VALUES (222, 'UKR' ,'380', 'Ukraine');
INSERT INTO cc_country VALUES (223, 'ARE' ,'971', 'United Arab Emirates');
INSERT INTO cc_country VALUES (224, 'GBR' ,'44', 'United Kingdom');
INSERT INTO cc_country VALUES (225, 'USA' ,'1', 'United States');
INSERT INTO cc_country VALUES (226, 'UMI' ,'0', 'United States Minor Outlying Islands');
INSERT INTO cc_country VALUES (227, 'URY' ,'598', 'Uruguay');
INSERT INTO cc_country VALUES (228, 'UZB' ,'998', 'Uzbekistan');
INSERT INTO cc_country VALUES (229, 'VUT' ,'678', 'Vanuatu');
INSERT INTO cc_country VALUES (230, 'VEN' ,'58', 'Venezuela');
INSERT INTO cc_country VALUES (231, 'VNM' ,'84', 'Vietnam');
INSERT INTO cc_country VALUES (232, 'VGB','1284', 'Virgin Islands, British');
INSERT INTO cc_country VALUES (233, 'VIR','808', 'Virgin Islands, U.S.');
INSERT INTO cc_country VALUES (234, 'WLF' ,'681', 'Wallis And Futuna');
INSERT INTO cc_country VALUES (235, 'ESH' ,'0', 'Western Sahara');
INSERT INTO cc_country VALUES (236, 'YEM' ,'967', 'Yemen');
INSERT INTO cc_country VALUES (237, 'YUG' ,'0', 'Yugoslavia');
INSERT INTO cc_country VALUES (238, 'ZMB' ,'260', 'Zambia');
INSERT INTO cc_country VALUES (239, 'ZWE' ,'263', 'Zimbabwe');
INSERT INTO cc_country VALUES (240, 'ASC' ,'0', 'Ascension Island');
INSERT INTO cc_country VALUES (241, 'DGA' ,'0', 'Diego Garcia');
INSERT INTO cc_country VALUES (242, 'XNM' ,'0', 'Inmarsat');
INSERT INTO cc_country VALUES (243, 'TMP' ,'0', 'East timor');
INSERT INTO cc_country VALUES (244, 'AK' ,'0', 'Alaska');
INSERT INTO cc_country VALUES (245, 'HI' ,'0', 'Hawaii');
INSERT INTO cc_country VALUES (53, 'CIV' ,'225', 'Côte d''Ivoire');
INSERT INTO cc_country VALUES (246, 'ALA' ,'35818', 'Aland Islands');
INSERT INTO cc_country VALUES (247, 'BLM' ,'0', 'Saint Barthelemy');
INSERT INTO cc_country VALUES (248, 'GGY' ,'441481', 'Guernsey');
INSERT INTO cc_country VALUES (249, 'IMN' ,'441624', 'Isle of Man');
INSERT INTO cc_country VALUES (250, 'JEY' ,'441534', 'Jersey');
INSERT INTO cc_country VALUES (251, 'MAF' ,'0', 'Saint Martin');
INSERT INTO cc_country VALUES (252, 'MNE' ,'382', 'Montenegro, Republic of');
INSERT INTO cc_country VALUES (253, 'SRB' ,'381', 'Serbia, Republic of');
INSERT INTO cc_country VALUES (254, 'CPT' ,'0', 'Clipperton Island');
INSERT INTO cc_country VALUES (255, 'TAA' ,'0', 'Tristan da Cunha');
--
-- Auto Dialer update database - Create database schema
--
CREATE TABLE cc_campaign (
id INT NOT NULL AUTO_INCREMENT,
campaign_name CHAR(50) NOT NULL,
creationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
startingdate TIMESTAMP,
expirationdate TIMESTAMP,
description MEDIUMTEXT,
id_trunk INT DEFAULT 0,
secondusedreal INT DEFAULT 0,
nb_callmade INT DEFAULT 0,
enable INT DEFAULT 0 NOT NULL,
PRIMARY KEY (id),
UNIQUE cons_cc_campaign_campaign_name (campaign_name)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE TABLE cc_phonelist (
id INT NOT NULL AUTO_INCREMENT,
id_cc_campaign INT DEFAULT 0 NOT NULL,
id_cc_card INT DEFAULT 0 NOT NULL,
numbertodial CHAR(50) NOT NULL,
name CHAR(60) NOT NULL,
inuse INT DEFAULT 0,
enable INT DEFAULT 1 NOT NULL,
num_trials_done INT DEFAULT 0,
creationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_attempt TIMESTAMP,
secondusedreal INT DEFAULT 0,
additionalinfo MEDIUMTEXT,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
CREATE INDEX ind_cc_phonelist_numbertodial ON cc_phonelist (numbertodial);
CREATE TABLE cc_provider(
id INT NOT NULL AUTO_INCREMENT,
provider_name CHAR(30) NOT NULL,
creationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
description MEDIUMTEXT,
PRIMARY KEY (id),
UNIQUE cons_cc_provider_provider_name (provider_name)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;
--
-- cc_currencies table
--
CREATE TABLE cc_currencies (
id SMALLINT (5) unsigned NOT NULL AUTO_INCREMENT,
currency CHAR(3) NOT NULL DEFAULT '',