From 147aef6dc55d80a5f395540cd223543cee48ef7c Mon Sep 17 00:00:00 2001 From: DanB Date: Thu, 23 May 2013 14:23:52 +0200 Subject: [PATCH] Adding mediation tables, modified cdrs_primary to include source host of the CDR --- data/storage/mysql/create_cdrs_tables.sql | 4 ++-- data/storage/mysql/create_mediator_tables.sql | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 data/storage/mysql/create_mediator_tables.sql diff --git a/data/storage/mysql/create_cdrs_tables.sql b/data/storage/mysql/create_cdrs_tables.sql index f3dd01c16..39d8e29d6 100644 --- a/data/storage/mysql/create_cdrs_tables.sql +++ b/data/storage/mysql/create_cdrs_tables.sql @@ -1,11 +1,12 @@ -- -- Table structure for table `cdrs_primary` -- -DROP TABLE IF EXISTS `cdrs_primary`; CREATE TABLE `cdrs_primary` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cgrid` char(40) NOT NULL, `accid` varchar(64) NOT NULL, + `cdrhost` varchar(64) NOT NULL, + `reqtype` varchar(24) NOT NULL, `direction` enum('0','1','2') NOT NULL DEFAULT '1', `tenant` varchar(64) NOT NULL, `tor` varchar(8) NOT NULL, @@ -21,7 +22,6 @@ CREATE TABLE `cdrs_primary` ( -- -- Table structure for table cdrs_extra -- -DROP TABLE IF EXISTS `cdrs_extra`; CREATE TABLE `cdrs_extra` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cgrid` char(40) NOT NULL, diff --git a/data/storage/mysql/create_mediator_tables.sql b/data/storage/mysql/create_mediator_tables.sql new file mode 100644 index 000000000..1a8e6d452 --- /dev/null +++ b/data/storage/mysql/create_mediator_tables.sql @@ -0,0 +1,13 @@ + +-- +-- Table structure for table `rater_cdrs` +-- +CREATE TABLE `rated_cdrs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cgrid` char(40) NOT NULL, + `cost` double(20,4) default NULL, + `cgrcostid` int(11) NOT NULL, + `cdrsrc` char(64) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `cgrid` (`cgrid`) +);