mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 06:38:45 +05:00
Merge fixes
This commit is contained in:
@@ -111,7 +111,6 @@
|
||||
// "enabled": false, // start the CDR Server service: <true|false>
|
||||
// "extra_fields": [], // extra fields to store in CDRs for non-generic CDRs
|
||||
// "store_cdrs": true, // store cdrs in storDb
|
||||
// "cdr_account_summary": false, // add account information from dataDB
|
||||
// "sm_cost_retries": 5, // number of queries to sm_costs before recalculating CDR
|
||||
// "rals_conns": [
|
||||
// {"address": "*internal"} // address where to reach the Rater for cost calculation, empty to disable functionality: <""|*internal|x.y.z.y:1234>
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// Used for cgradmin
|
||||
// Starts rater, scheduler
|
||||
|
||||
"general": {
|
||||
"log_level": 7,
|
||||
},
|
||||
|
||||
"listen": {
|
||||
"rpc_json": ":2012", // RPC JSON listening address
|
||||
"rpc_gob": ":2013", // RPC GOB listening address
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
{"tag": "Category", "field_id": "Category", "type": "*composed", "value": "^call", "mandatory": true},
|
||||
{"tag": "Account", "field_id": "Account", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Subject", "field_id": "Subject", "type": "*composed", "value": "^*users", "mandatory": true},
|
||||
{"tag": "Destination", "field_id": "Destination", "type": "*composed", "value": "Service-Information>IN-Information>Real-Called-Number", "mandatory": true},
|
||||
{"tag": "Destination", "field_id": "Destination", "type": "*composed",
|
||||
"value": "Service-Information>IN-Information>Real-Called-Number", "mandatory": true},
|
||||
{"tag": "SetupTime", "field_id": "SetupTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "AnswerTime", "field_id": "AnswerTime", "type": "*composed", "value": "Event-Timestamp", "mandatory": true},
|
||||
{"tag": "Usage", "field_id": "Usage", "type": "*handler", "handler_id": "*ccr_usage", "mandatory": true},
|
||||
@@ -29,7 +30,9 @@
|
||||
{"tag": "ResultCode", "field_filter":"CGRError(USER_NOT_FOUND)",
|
||||
"field_id": "Result-Code", "type": "*constant", "value": "5030"},
|
||||
{"tag": "GrantedUnits", "field_filter":"CGRError(^$)",
|
||||
"field_id": "Granted-Service-Unit>CC-Time", "type": "*composed", "value": "CGRMaxUsage", "mandatory": true},
|
||||
"field_id": "Granted-Service-Unit>CC-Time",
|
||||
"type": "*handler", "handler_id": "*value_exponent",
|
||||
"value": "CGRMaxUsage;^|-9", "mandatory": true},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -54,7 +57,9 @@
|
||||
],
|
||||
"cca_fields":[ // fields returned in CCA
|
||||
{"tag": "GrantedUnits", "field_filter":"CGRError(^$)",
|
||||
"field_id": "Granted-Service-Unit>CC-Time", "type": "*composed", "value": "CGRMaxUsage", "mandatory": true},
|
||||
"field_id": "Granted-Service-Unit>CC-Time",
|
||||
"type": "*handler", "handler_id": "*value_exponent",
|
||||
"value": "CGRMaxUsage;^|-9", "mandatory": true},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -79,7 +84,9 @@
|
||||
],
|
||||
"cca_fields":[ // fields returned in CCA
|
||||
{"tag": "GrantedUnits", "field_filter":"CGRError(^$)",
|
||||
"field_id": "Granted-Service-Unit>CC-Time", "type": "*composed", "value": "CGRMaxUsage", "mandatory": true},
|
||||
"field_id": "Granted-Service-Unit>CC-Time",
|
||||
"type": "*handler", "handler_id": "*value_exponent",
|
||||
"value": "CGRMaxUsage;^|-9", "mandatory": true},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
|
||||
"rals": {
|
||||
"enabled": true, // enable Rater service: <true|false>
|
||||
"max_computed_usage": { // do not compute usage higher than this, prevents memory overload
|
||||
"*any": "189h",
|
||||
"*voice": "72h",
|
||||
"*data": "102400",
|
||||
"*sms": "10000"
|
||||
},
|
||||
},
|
||||
|
||||
"scheduler": {
|
||||
@@ -33,6 +39,9 @@
|
||||
"sm_generic": {
|
||||
"enabled": true,
|
||||
"session_ttl": "50ms",
|
||||
"rals_conns": [
|
||||
{"address": "127.0.0.1:2012", "transport": "*json"}
|
||||
]
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
ALTER TABLE cdrs CHANGE COLUMN `usage` `usage_old` DECIMAL(30,9);
|
||||
ALTER TABLE cdrs ADD `usage` BIGINT;
|
||||
UPDATE cdrs SET `usage` = `usage_old` * 1000000000 WHERE usage_old IS NOT NULL;
|
||||
|
||||
@@ -5,30 +5,25 @@
|
||||
DROP TABLE IF EXISTS cdrs;
|
||||
CREATE TABLE cdrs (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
cgrid char(40) NOT NULL,
|
||||
cgrid varchar(40) NOT NULL,
|
||||
run_id varchar(64) NOT NULL,
|
||||
origin_host varchar(64) NOT NULL,
|
||||
source varchar(64) NOT NULL,
|
||||
origin_id varchar(64) NOT NULL,
|
||||
tor varchar(16) NOT NULL,
|
||||
request_type varchar(24) NOT NULL,
|
||||
direction varchar(8) NOT NULL,
|
||||
tenant varchar(64) NOT NULL,
|
||||
category varchar(32) NOT NULL,
|
||||
account varchar(128) NOT NULL,
|
||||
subject varchar(128) NOT NULL,
|
||||
destination varchar(128) NOT NULL,
|
||||
setup_time datetime NOT NULL,
|
||||
pdd DECIMAL(12,9) NOT NULL,
|
||||
answer_time datetime NOT NULL,
|
||||
`usage` DECIMAL(30,9) NOT NULL,
|
||||
supplier varchar(128) NOT NULL,
|
||||
disconnect_cause varchar(64) NOT NULL,
|
||||
`usage` BIGINT NOT NULL,
|
||||
extra_fields text NOT NULL,
|
||||
cost_source varchar(64) NOT NULL,
|
||||
cost DECIMAL(20,4) NOT NULL,
|
||||
cost_details text,
|
||||
account_summary text,
|
||||
extra_info text,
|
||||
created_at TIMESTAMP NULL,
|
||||
updated_at TIMESTAMP NULL,
|
||||
@@ -40,12 +35,12 @@ CREATE TABLE cdrs (
|
||||
DROP TABLE IF EXISTS sm_costs;
|
||||
CREATE TABLE sm_costs (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
cgrid char(40) NOT NULL,
|
||||
cgrid varchar(40) NOT NULL,
|
||||
run_id varchar(64) NOT NULL,
|
||||
origin_host varchar(64) NOT NULL,
|
||||
origin_id varchar(64) NOT NULL,
|
||||
cost_source varchar(64) NOT NULL,
|
||||
`usage` DECIMAL(30,9) NOT NULL,
|
||||
`usage` BIGINT NOT NULL,
|
||||
cost_details text,
|
||||
created_at TIMESTAMP NULL,
|
||||
deleted_at TIMESTAMP NULL,
|
||||
|
||||
@@ -491,6 +491,7 @@ CREATE TABLE tp_filters (
|
||||
-- Table structure for table `tp_lcr`
|
||||
--
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS tp_lcr;
|
||||
CREATE TABLE tp_lcr (
|
||||
`pk` int(11) NOT NULL AUTO_INCREMENT,
|
||||
|
||||
@@ -5,30 +5,25 @@
|
||||
DROP TABLE IF EXISTS cdrs;
|
||||
CREATE TABLE cdrs (
|
||||
id SERIAL PRIMARY KEY,
|
||||
cgrid CHAR(40) NOT NULL,
|
||||
cgrid VARCHAR(40) NOT NULL,
|
||||
run_id VARCHAR(64) NOT NULL,
|
||||
origin_host VARCHAR(64) NOT NULL,
|
||||
source VARCHAR(64) NOT NULL,
|
||||
origin_id VARCHAR(64) NOT NULL,
|
||||
tor VARCHAR(16) NOT NULL,
|
||||
request_type VARCHAR(24) NOT NULL,
|
||||
direction VARCHAR(8) NOT NULL,
|
||||
tenant VARCHAR(64) NOT NULL,
|
||||
category VARCHAR(32) NOT NULL,
|
||||
account VARCHAR(128) NOT NULL,
|
||||
subject VARCHAR(128) NOT NULL,
|
||||
destination VARCHAR(128) NOT NULL,
|
||||
setup_time TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
pdd NUMERIC(12,9) NOT NULL,
|
||||
answer_time TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
usage NUMERIC(30,9) NOT NULL,
|
||||
supplier VARCHAR(128) NOT NULL,
|
||||
disconnect_cause VARCHAR(64) NOT NULL,
|
||||
usage BIGINT NOT NULL,
|
||||
extra_fields jsonb NOT NULL,
|
||||
cost_source VARCHAR(64) NOT NULL,
|
||||
cost NUMERIC(20,4) DEFAULT NULL,
|
||||
cost_details jsonb,
|
||||
account_summary jsonb,
|
||||
extra_info text,
|
||||
created_at TIMESTAMP WITH TIME ZONE,
|
||||
updated_at TIMESTAMP WITH TIME ZONE NULL,
|
||||
@@ -43,12 +38,12 @@ CREATE INDEX deleted_at_cp_idx ON cdrs (deleted_at);
|
||||
DROP TABLE IF EXISTS sm_costs;
|
||||
CREATE TABLE sm_costs (
|
||||
id SERIAL PRIMARY KEY,
|
||||
cgrid CHAR(40) NOT NULL,
|
||||
cgrid VARCHAR(40) NOT NULL,
|
||||
run_id VARCHAR(64) NOT NULL,
|
||||
origin_host VARCHAR(64) NOT NULL,
|
||||
origin_id VARCHAR(64) NOT NULL,
|
||||
cost_source VARCHAR(64) NOT NULL,
|
||||
usage NUMERIC(30,9) NOT NULL,
|
||||
usage BIGINT NOT NULL,
|
||||
cost_details jsonb,
|
||||
created_at TIMESTAMP WITH TIME ZONE,
|
||||
deleted_at TIMESTAMP WITH TIME ZONE NULL,
|
||||
@@ -62,4 +57,3 @@ DROP INDEX IF EXISTS run_origin_smcost_idx;
|
||||
CREATE INDEX run_origin_smcost_idx ON sm_costs (run_id, origin_id);
|
||||
DROP INDEX IF EXISTS deleted_at_smcost_idx;
|
||||
CREATE INDEX deleted_at_smcost_idx ON sm_costs (deleted_at);
|
||||
|
||||
|
||||
@@ -480,7 +480,9 @@ CREATE TABLE tp_filters (
|
||||
CREATE INDEX tp_filters_idx ON tp_filters (tpid);
|
||||
CREATE INDEX tp_filters_unique ON tp_filters ("tpid","tenant", "id", "filter_type", "filter_field_name");
|
||||
|
||||
|
||||
--
|
||||
|
||||
-- Table structure for table `tp_lcr`
|
||||
--
|
||||
|
||||
@@ -500,8 +502,9 @@ CREATE TABLE tp_filters (
|
||||
"weight" decimal(8,2) NOT NULL,
|
||||
"created_at" TIMESTAMP WITH TIME ZONE
|
||||
);
|
||||
CREATE INDEX tp_lcr_idx ON tp_lcr (tpid);
|
||||
CREATE INDEX tp_lcr_unique ON tp_lcr ("tpid", "tenant", "id", "filter_ids");
|
||||
CREATE INDEX tp_lcr_idx ON tp_lcr (tpid);
|
||||
CREATE INDEX tp_lcr_unique ON tp_lcr ("tpid", "tenant", "id", "filter_ids");
|
||||
|
||||
|
||||
--
|
||||
-- Table structure for table `versions`
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#Id,ActionsId,TimingId,Weight
|
||||
PACKAGE_1,LOG,*asap,10
|
||||
PACKAGE_1,LOG,FIRST_OF_YEAR_2020,10
|
||||
PACKAGE_2,LOG,FIRST_OF_YEAR_2020,10
|
||||
PACKAGE_2,LOG,FIRST_OF_YEAR_2020,10
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
LOG,*log,,,,,,,,,,,,,,false,false,10
|
||||
#ActionsId[0],Action[1],ExtraParameters[2],Filter[3],BalanceId[4],BalanceType[5],Directions[6],Categories[7],DestinationIds[8],RatingSubject[9],SharedGroup[10],ExpiryTime[11],TimingIds[12],Units[13],BalanceWeight[14],BalanceBlocker[15],BalanceDisabled[16],Weight[17]
|
||||
LOG,*log,,,,,,,,,,,,,,false,false,10
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
#Id,DestinationId,RatesTag,RoundingMethod,RoundingDecimals,MaxCost,MaxCostStrategy
|
||||
DR_DATA1,*any,RT_DATA1,*up,5,,
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
#Id,ConnectFee,Rate,RateUnit,RateIncrement,GroupIntervalStart
|
||||
RT_DATA1,0,0.0,1048576,10240,0
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
#Id,DestinationRatesId,TimingTag,Weight
|
||||
RP_DATA1,DR_DATA1,*any,10
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
#Direction,Tenant,Category,Subject,ActivationTime,RatingPlanId,RatesFallbackSubject,CdrStatQueueIds
|
||||
*out,cgrates.org,data1,rpdata1,2015-01-01T00:00:00Z,RP_DATA1,,
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
FIRST_OF_YEAR_2020,2020,1,1,*any,00:00:00
|
||||
#Tag,Years,Months,MonthDays,WeekDays,Time
|
||||
FIRST_OF_YEAR_2020,2020,1,1,*any,00:00:00
|
||||
|
||||
|
@@ -3,4 +3,4 @@ RT_1CENT,0,1,1s,1s,0s
|
||||
RT_DATA_2c,0,0.002,10,10,0
|
||||
RT_SMS_5c,0,0.005,1,1,0
|
||||
RT_DATA_r,0,0.1,1048576,10240,0
|
||||
RT_ZERO,0,0,1,1,0
|
||||
RT_ZERO,0,0,1s,1s,0s
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#ActionsId[0],Action[1],ExtraParameters[2],Filter[3],BalanceId[4],BalanceType[5],Directions[6],Categories[7],DestinationIds[8],RatingSubject[9],SharedGroup[10],ExpiryTime[11],TimingIds[12],Units[13],BalanceWeight[14],BalanceBlocker[15],BalanceDisabled[16],Weight[17]
|
||||
TOPUP_RST_10,*topup_reset,,,,*monetary,*out,,*any,,,*unlimited,,10,10,false,false,10
|
||||
TOPUP_RST_5,*topup_reset,,,,*monetary,*out,,*any,,,*unlimited,,5,20,false,false,10
|
||||
TOPUP_RST_5,*topup_reset,,,,*voice,*out,,DST_1002,SPECIAL_1002,,*unlimited,,90,20,false,false,10
|
||||
TOPUP_120_DST1003,*topup_reset,,,,*voice,*out,,DST_1003,,,*unlimited,,120,20,false,false,10
|
||||
TOPUP_RST_5,*topup_reset,,,,*voice,*out,,DST_1002,SPECIAL_1002,,*unlimited,,90s,20,false,false,10
|
||||
TOPUP_120_DST1003,*topup_reset,,,,*voice,*out,,DST_1003,,,*unlimited,,120s,20,false,false,10
|
||||
TOPUP_RST_SHARED_5,*topup,,,,*monetary,*out,,*any,,SHARED_A,*unlimited,,5,10,false,false,10
|
||||
SHARED_A_0,*topup_reset,,,,*monetary,*out,,*any,,SHARED_A,*unlimited,,0,10,false,false,10
|
||||
TOPUP_RST_DATA_100,*topup_reset,,,,*data,*out,,*any,,,*unlimited,,102400,10,false,false,10
|
||||
|
||||
|
@@ -2,9 +2,10 @@
|
||||
*out,cgrates.org,call,*any,2014-01-14T00:00:00Z,RP_RETAIL1,,
|
||||
*out,cgrates.org,call,1001,2014-01-14T00:00:00Z,RP_RETAIL2,,
|
||||
*out,cgrates.org,call,SPECIAL_1002,2014-01-14T00:00:00Z,RP_SPECIAL_1002,,
|
||||
*out,cgrates.org,generic,*any,2014-01-14T00:00:00Z,RP_GENERIC,,
|
||||
*out,cgrates.org,data,*any,2014-01-14T00:00:00Z,RP_GENERIC,,
|
||||
*out,cgrates.org,lcr_profile1,suppl1,2014-01-14T00:00:00Z,RP_RETAIL1,,STATS_SUPPL1
|
||||
*out,cgrates.org,lcr_profile1,suppl2,2014-01-14T00:00:00Z,RP_RETAIL2,,STATS_SUPPL2
|
||||
*out,cgrates.org,lcr_profile2,suppl1,2014-01-14T00:00:00Z,RP_RETAIL2,,STATS_SUPPL1
|
||||
*out,cgrates.org,lcr_profile2,suppl2,2014-01-14T00:00:00Z,RP_RETAIL1,,STATS_SUPPL2
|
||||
*out,cgrates.org,lcr_profile2,suppl3,2014-01-14T00:00:00Z,RP_SPECIAL_1002,,
|
||||
*out,cgrates.org,generic,*any,2014-01-14T00:00:00Z,RP_GENERIC,,
|
||||
|
||||
|
Reference in New Issue
Block a user