diff --git a/apier/v1/apier_it_test.go b/apier/v1/apier_it_test.go index b9733fa1a6..9ac452e545 100644 --- a/apier/v1/apier_it_test.go +++ b/apier/v1/apier_it_test.go @@ -169,7 +169,7 @@ func testApierLoadConfig(t *testing.T) { } func testApierCreateDirs(t *testing.T) { - for _, pathDir := range []string{cfg.CdreProfiles[utils.MetaDefault].ExportPath, "/var/log/cgrates/cdrc/in", "/var/log/cgrates/cdrc/out"} { + for _, pathDir := range []string{cfg.CdreProfiles[utils.MetaDefault].ExportPath, "/var/log/cgrates/ers/in", "/var/log/cgrates/ers/out"} { if err := os.RemoveAll(pathDir); err != nil { t.Fatal("Error removing folder: ", pathDir, err) } diff --git a/cmd/cgr-engine/cgr-engine.go b/cmd/cgr-engine/cgr-engine.go index 31221a314a..7fd06bcdbf 100644 --- a/cmd/cgr-engine/cgr-engine.go +++ b/cmd/cgr-engine/cgr-engine.go @@ -452,7 +452,7 @@ func main() { dmService := services.NewDataDBService(cfg, connManager) storDBService := services.NewStorDBService(cfg) - if dmService.ShouldRun() { // Some services can run without db, ie: CDRC + if dmService.ShouldRun() { // Some services can run without db, ie: ERs if err = dmService.Start(); err != nil { return } diff --git a/config/config_defaults.go b/config/config_defaults.go index 0f8657f108..72cc00362f 100755 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -319,8 +319,8 @@ const CGRATES_CFG_JSON = ` "header_define_character": ":", // the starting character for header definition used in case of CSV files "run_delay": "0", // sleep interval in seconds between consecutive runs, -1 to use automation via inotify or 0 to disable running all together "concurrent_requests": 1024, // maximum simultaneous requests/files to process, 0 for unlimited - "source_path": "/var/spool/cgrates/cdrc/in", // read data from this path - "processed_path": "/var/spool/cgrates/cdrc/out", // move processed data here + "source_path": "/var/spool/cgrates/ers/in", // read data from this path + "processed_path": "/var/spool/cgrates/ers/out", // move processed data here "xml_root_path": "", // path towards one event in case of XML CDRs "tenant": "", // tenant used by import "timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB> diff --git a/config/config_it_test.go b/config/config_it_test.go index d65fd88662..049504591d 100644 --- a/config/config_it_test.go +++ b/config/config_it_test.go @@ -465,8 +465,8 @@ func testCGRConfigReloadERs(t *testing.T) { HeaderDefineChar: ":", RunDelay: 0, ConcurrentReqs: 1024, - SourcePath: "/var/spool/cgrates/cdrc/in", - ProcessedPath: "/var/spool/cgrates/cdrc/out", + SourcePath: "/var/spool/cgrates/ers/in", + ProcessedPath: "/var/spool/cgrates/ers/out", Filters: []string{}, Flags: flagsDefault, Fields: content, @@ -858,10 +858,10 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) { "Flags": map[string]interface{}{}, "FailedCallsPrefix": "", "ID": "*default", - "ProcessedPath": "/var/spool/cgrates/cdrc/out", + "ProcessedPath": "/var/spool/cgrates/ers/out", "RowLength": 0, "RunDelay": 0, - "SourcePath": "/var/spool/cgrates/cdrc/in", + "SourcePath": "/var/spool/cgrates/ers/in", "Tenant": nil, "Timezone": "", "Type": utils.META_NONE, diff --git a/config/config_json_test.go b/config/config_json_test.go index 0b4356a40b..af5deac231 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -1638,67 +1638,6 @@ func TestDfSureTaxJsonCfg(t *testing.T) { } } -// func TestNewCgrJsonCfgFromFile(t *testing.T) { -// cgrJsonCfg, err := NewCgrJsonCfgFromFile("cfg_data.json") -// if err != nil { -// t.Error(err) -// } -// eCfg := &GeneralJsonCfg{Default_request_type: utils.StringPointer(utils.META_PSEUDOPREPAID)} -// if gCfg, err := cgrJsonCfg.GeneralJsonCfg(); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eCfg, gCfg) { -// t.Errorf("Expecting: %+v, received: %+v", eCfg, gCfg) -// } -// cdrFields := []*FcTemplateJsonCfg{ -// {Path: utils.StringPointer(utils.ToR), Value: utils.StringPointer("~7:s/^(voice|data|sms|mms|generic)$/*$1/")}, -// {Path: utils.StringPointer(utils.AnswerTime), Value: utils.StringPointer("~1")}, -// {Path: utils.StringPointer(utils.Usage), Value: utils.StringPointer(`~9:s/^(\d+)$/${1}s/`)}, -// } -// eCfgCdrc := []*CdrcJsonCfg{ -// { -// Id: utils.StringPointer("CDRC-CSV1"), -// Enabled: utils.BoolPointer(true), -// Cdr_in_path: utils.StringPointer("/tmp/cgrates/cdrc1/in"), -// Cdr_out_path: utils.StringPointer("/tmp/cgrates/cdrc1/out"), -// Cdr_source_id: utils.StringPointer("csv1"), -// }, -// { -// Id: utils.StringPointer("CDRC-CSV2"), -// Enabled: utils.BoolPointer(true), -// Run_delay: utils.IntPointer(1), -// Cdr_in_path: utils.StringPointer("/tmp/cgrates/cdrc2/in"), -// Cdr_out_path: utils.StringPointer("/tmp/cgrates/cdrc2/out"), -// Cdr_source_id: utils.StringPointer("csv2"), -// Fields: &cdrFields, -// }, -// } -// if cfg, err := cgrJsonCfg.CdrcJsonCfg(); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eCfgCdrc, cfg) { -// t.Errorf("Expecting: %+v \n received: %+v", utils.ToIJSON(eCfgCdrc), utils.ToIJSON(cfg)) -// } -// eCfgSmFs := &FreeswitchAgentJsonCfg{ -// Enabled: utils.BoolPointer(true), -// Event_socket_conns: &[]*FsConnJsonCfg{ -// { -// Address: utils.StringPointer("1.2.3.4:8021"), -// Password: utils.StringPointer("ClueCon"), -// Reconnects: utils.IntPointer(5), -// }, -// { -// Address: utils.StringPointer("2.3.4.5:8021"), -// Password: utils.StringPointer("ClueCon"), -// Reconnects: utils.IntPointer(5), -// }, -// }, -// } -// if smFsCfg, err := cgrJsonCfg.FreeswitchAgentJsonCfg(); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(eCfgSmFs, smFsCfg) { -// t.Error("Received: ", smFsCfg) -// } -// } - func TestDfHttpJsonCfg(t *testing.T) { eCfg := &HTTPJsonCfg{ Json_rpc_url: utils.StringPointer("/jsonrpc"), @@ -1854,8 +1793,8 @@ func TestDfEventReaderCfg(t *testing.T) { Header_define_character: utils.StringPointer(":"), Run_delay: utils.StringPointer("0"), Concurrent_requests: utils.IntPointer(1024), - Source_path: utils.StringPointer("/var/spool/cgrates/cdrc/in"), - Processed_path: utils.StringPointer("/var/spool/cgrates/cdrc/out"), + Source_path: utils.StringPointer("/var/spool/cgrates/ers/in"), + Processed_path: utils.StringPointer("/var/spool/cgrates/ers/out"), Xml_root_path: utils.StringPointer(utils.EmptyString), Tenant: utils.StringPointer(utils.EmptyString), Timezone: utils.StringPointer(utils.EmptyString), diff --git a/config/config_test.go b/config/config_test.go index 5a596d47db..73fd9b13ba 100755 --- a/config/config_test.go +++ b/config/config_test.go @@ -1816,8 +1816,8 @@ func TestCgrCdfEventReader(t *testing.T) { HeaderDefineChar: ":", RunDelay: time.Duration(0), ConcurrentReqs: 1024, - SourcePath: "/var/spool/cgrates/cdrc/in", - ProcessedPath: "/var/spool/cgrates/cdrc/out", + SourcePath: "/var/spool/cgrates/ers/in", + ProcessedPath: "/var/spool/cgrates/ers/out", XmlRootPath: utils.HierarchyPath{utils.EmptyString}, Tenant: nil, Timezone: utils.EmptyString, @@ -2110,8 +2110,8 @@ func TestCgrCfgEventReaderDefault(t *testing.T) { HeaderDefineChar: ":", RunDelay: time.Duration(0), ConcurrentReqs: 1024, - SourcePath: "/var/spool/cgrates/cdrc/in", - ProcessedPath: "/var/spool/cgrates/cdrc/out", + SourcePath: "/var/spool/cgrates/ers/in", + ProcessedPath: "/var/spool/cgrates/ers/out", XmlRootPath: utils.HierarchyPath{utils.EmptyString}, Tenant: nil, Timezone: utils.EmptyString, diff --git a/config/erscfg_test.go b/config/erscfg_test.go index 87fc1455e8..c18c2bad7d 100644 --- a/config/erscfg_test.go +++ b/config/erscfg_test.go @@ -111,8 +111,8 @@ func TestEventReaderLoadFromJSON(t *testing.T) { HeaderDefineChar: ":", RunDelay: time.Duration(0), ConcurrentReqs: 1024, - SourcePath: "/var/spool/cgrates/cdrc/in", - ProcessedPath: "/var/spool/cgrates/cdrc/out", + SourcePath: "/var/spool/cgrates/ers/in", + ProcessedPath: "/var/spool/cgrates/ers/out", XmlRootPath: utils.HierarchyPath{utils.EmptyString}, Tenant: nil, Timezone: utils.EmptyString, @@ -249,8 +249,8 @@ func TestEventReaderSameID(t *testing.T) { HeaderDefineChar: ":", RunDelay: time.Duration(0), ConcurrentReqs: 1024, - SourcePath: "/var/spool/cgrates/cdrc/in", - ProcessedPath: "/var/spool/cgrates/cdrc/out", + SourcePath: "/var/spool/cgrates/ers/in", + ProcessedPath: "/var/spool/cgrates/ers/out", XmlRootPath: utils.HierarchyPath{utils.EmptyString}, Tenant: nil, Timezone: utils.EmptyString, @@ -377,11 +377,11 @@ func TestERsCfgAsMapInterface(t *testing.T) { "flags": map[string][]interface{}{}, "id": "*default", "partial_record_cache": "0", - "processed_path": "/var/spool/cgrates/cdrc/out", + "processed_path": "/var/spool/cgrates/ers/out", "row_length": 0, "run_delay": "0", "partial_cache_expiry_action": "", - "source_path": "/var/spool/cgrates/cdrc/in", + "source_path": "/var/spool/cgrates/ers/in", "tenant": "", "timezone": "", "xml_root_path": []string{""}, diff --git a/config/xmldp.go b/config/xmldp.go index 2c48a7a6cd..10ea0261e8 100644 --- a/config/xmldp.go +++ b/config/xmldp.go @@ -98,7 +98,7 @@ func (xP *XmlProvider) RemoteHost() net.Addr { // ElementText will process the node to extract the elementName's text out of it (only first one found) // returns utils.ErrNotFound if the element is not found in the node -// Make the method exportable until we remove the cdrc +// Make the method exportable until we remove the ers func ElementText(xmlElement *xmlquery.Node, elmntPath string) (string, error) { elmnt := xmlquery.FindOne(xmlElement, elmntPath) if elmnt == nil { diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index 3fee94f290..877a95e204 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -295,10 +295,11 @@ // "type": "*none", // reader type <*file_csv> // "row_length" : 0, // Number of fields from csv file // "field_separator": ",", // separator used in case of csv files +// "header_define_character": ":", // the starting character for header definition used in case of CSV files // "run_delay": "0", // sleep interval in seconds between consecutive runs, -1 to use automation via inotify or 0 to disable running all together // "concurrent_requests": 1024, // maximum simultaneous requests/files to process, 0 for unlimited -// "source_path": "/var/spool/cgrates/cdrc/in", // read data from this path -// "processed_path": "/var/spool/cgrates/cdrc/out", // move processed data here +// "source_path": "/var/spool/cgrates/ers/in", // read data from this path +// "processed_path": "/var/spool/cgrates/ers/out", // move processed data here // "xml_root_path": "", // path towards one event in case of XML CDRs // "tenant": "", // tenant used by import // "timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB> @@ -357,7 +358,7 @@ // {"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, // {"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, // {"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"}, -// {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost", "rounding_decimals": 4}, +// {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"}, // ], // }, // ], diff --git a/data/tutorial_tests/asterisk_ari/cgrates/etc/init.d/cgrates b/data/tutorial_tests/asterisk_ari/cgrates/etc/init.d/cgrates index ad75161af1..626171a4d3 100755 --- a/data/tutorial_tests/asterisk_ari/cgrates/etc/init.d/cgrates +++ b/data/tutorial_tests/asterisk_ari/cgrates/etc/init.d/cgrates @@ -30,8 +30,8 @@ STACKTRACE=$RUNDIR/$NAME.strace ENABLE=true DAEMON_OPTS="-config_path=$TUTFOLDER/etc/cgrates" CDREDIR=$TMP_DIR/cdre -CDRCINDIR=$TMP_DIR/cdrc/in -CDRCOUTDIR=$TMP_DIR/cdrc/out +ERSINDIR=$TMP_DIR/ers/in +ERSOUTDIR=$TMP_DIR/ers/out # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -55,12 +55,12 @@ if [ ! -d $RUNDIR ]; then touch $STACKTRACE chown -R $USER:$GROUP $RUNDIR fi -# Install the cdrc folder -if [ ! -d $CDRCINDIR ]; then - mkdir -p $CDRCINDIR - chown $USER:$GROUP $CDRCINDIR - mkdir -p $CDRCOUTDIR - chown $USER:$GROUP $CDRCOUTDIR +# Install the ers folder +if [ ! -d $ERSINDIR ]; then + mkdir -p $ERSINDIR + chown $USER:$GROUP $ERSINDIR + mkdir -p $ERSOUTDIR + chown $USER:$GROUP $ERSOUTDIR fi # Install the cdre folder if [ ! -d $CDREDIR ]; then diff --git a/data/tutorial_tests/fs_evsock/cgrates/etc/init.d/cgrates b/data/tutorial_tests/fs_evsock/cgrates/etc/init.d/cgrates index f4715b24fa..5cbf247e45 100755 --- a/data/tutorial_tests/fs_evsock/cgrates/etc/init.d/cgrates +++ b/data/tutorial_tests/fs_evsock/cgrates/etc/init.d/cgrates @@ -30,8 +30,8 @@ STACKTRACE=$RUNDIR/$NAME.strace ENABLE=true DAEMON_OPTS="-config_path=$TUTFOLDER/etc/cgrates" CDREDIR=$TMP_DIR/cdre -CDRCINDIR=$TMP_DIR/cdrc/in -CDRCOUTDIR=$TMP_DIR/cdrc/out +ERSINDIR=$TMP_DIR/ers/in +ERSOUTDIR=$TMP_DIR/ers/out # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -55,12 +55,12 @@ if [ ! -d $RUNDIR ]; then touch $STACKTRACE chown -R $USER:$GROUP $RUNDIR fi -# Install the cdrc folder -if [ ! -d $CDRCINDIR ]; then - mkdir -p $CDRCINDIR - chown $USER:$GROUP $CDRCINDIR - mkdir -p $CDRCOUTDIR - chown $USER:$GROUP $CDRCOUTDIR +# Install the ers folder +if [ ! -d $ERSINDIR ]; then + mkdir -p $ERSINDIR + chown $USER:$GROUP $ERSINDIR + mkdir -p $ERSOUTDIR + chown $USER:$GROUP $ERSOUTDIR fi # Install the cdre folder if [ ! -d $CDREDIR ]; then diff --git a/data/tutorials/asterisk_ari/cgrates/etc/init.d/cgrates b/data/tutorials/asterisk_ari/cgrates/etc/init.d/cgrates index 72a8e1b180..61aec158c1 100755 --- a/data/tutorials/asterisk_ari/cgrates/etc/init.d/cgrates +++ b/data/tutorials/asterisk_ari/cgrates/etc/init.d/cgrates @@ -30,8 +30,8 @@ STACKTRACE=$RUNDIR/$NAME.strace ENABLE=true DAEMON_OPTS="-config_path=$TUTFOLDER/etc/cgrates" CDREDIR=$TMP_DIR/cdre -CDRCINDIR=$TMP_DIR/cdrc/in -CDRCOUTDIR=$TMP_DIR/cdrc/out +ERSINDIR=$TMP_DIR/ers/in +ERSOUTDIR=$TMP_DIR/ers/out # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -55,12 +55,12 @@ if [ ! -d $RUNDIR ]; then touch $STACKTRACE chown -R $USER:$GROUP $RUNDIR fi -# Install the cdrc folder -if [ ! -d $CDRCINDIR ]; then - mkdir -p $CDRCINDIR - chown $USER:$GROUP $CDRCINDIR - mkdir -p $CDRCOUTDIR - chown $USER:$GROUP $CDRCOUTDIR +# Install the ers folder +if [ ! -d $ERSINDIR ]; then + mkdir -p $ERSINDIR + chown $USER:$GROUP $ERSINDIR + mkdir -p $ERSOUTDIR + chown $USER:$GROUP $ERSOUTDIR fi # Install the cdre folder if [ ! -d $CDREDIR ]; then diff --git a/data/tutorials/fs_evsock/cgrates/etc/init.d/cgrates b/data/tutorials/fs_evsock/cgrates/etc/init.d/cgrates index 0c57a02fda..e82820c947 100755 --- a/data/tutorials/fs_evsock/cgrates/etc/init.d/cgrates +++ b/data/tutorials/fs_evsock/cgrates/etc/init.d/cgrates @@ -30,8 +30,8 @@ STACKTRACE=$RUNDIR/$NAME.strace ENABLE=true DAEMON_OPTS="-config_path=$TUTFOLDER/etc/cgrates" CDREDIR=$TMP_DIR/cdre -CDRCINDIR=$TMP_DIR/cdrc/in -CDRCOUTDIR=$TMP_DIR/cdrc/out +ERSINDIR=$TMP_DIR/ers/in +ERSOUTDIR=$TMP_DIR/ers/out # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -55,12 +55,12 @@ if [ ! -d $RUNDIR ]; then touch $STACKTRACE chown -R $USER:$GROUP $RUNDIR fi -# Install the cdrc folder -if [ ! -d $CDRCINDIR ]; then - mkdir -p $CDRCINDIR - chown $USER:$GROUP $CDRCINDIR - mkdir -p $CDRCOUTDIR - chown $USER:$GROUP $CDRCOUTDIR +# Install the ers folder +if [ ! -d $ERSINDIR ]; then + mkdir -p $ERSINDIR + chown $USER:$GROUP $ERSINDIR + mkdir -p $ERSOUTDIR + chown $USER:$GROUP $ERSOUTDIR fi # Install the cdre folder if [ ! -d $CDREDIR ]; then diff --git a/engine/cdr.go b/engine/cdr.go index c91aea8070..79ff284a2e 100644 --- a/engine/cdr.go +++ b/engine/cdr.go @@ -101,7 +101,7 @@ type CDR struct { Usage time.Duration // event usage information (eg: in case of tor=*voice this will represent the total duration of a call) ExtraFields map[string]string // Extra fields to be stored in CDR ExtraInfo string // Container for extra information related to this CDR, eg: populated with error reason in case of error on calculation - Partial bool // Used for partial record processing by CDRC + Partial bool // Used for partial record processing by ERs PreRated bool // Mark the CDR as rated so we do not process it during rating CostSource string // The source of this cost Cost float64 // diff --git a/ers/ers.go b/ers/ers.go index d0397651bc..407db1b506 100644 --- a/ers/ers.go +++ b/ers/ers.go @@ -122,6 +122,9 @@ func (erS *ERService) ListenAndServe(cfgRldChan chan struct{}) (err error) { continue } } + if erS.cfg.ERsCfg().Readers[rdrIdx].Type == utils.META_NONE { // ignore *default reader + continue + } if err := erS.addReader(id, rdrIdx); err != nil { utils.Logger.Crit( fmt.Sprintf("<%s> adding reader <%s> got error: <%s>", diff --git a/ers/filecsv_it_test.go b/ers/filecsv_it_test.go index 8de769ed27..56a2928f6f 100644 --- a/ers/filecsv_it_test.go +++ b/ers/filecsv_it_test.go @@ -146,7 +146,7 @@ func testCsvITLoadTPFromFolder(t *testing.T) { time.Sleep(500 * time.Millisecond) } -// The default scenario, out of cdrc defined in .cfg file +// The default scenario, out of ers defined in .cfg file func testCsvITHandleCdr1File(t *testing.T) { fileName := "file1.csv" tmpFilePath := path.Join("/tmp", fileName) diff --git a/ers/filefwv_it_test.go b/ers/filefwv_it_test.go index 7233836426..9239453b23 100644 --- a/ers/filefwv_it_test.go +++ b/ers/filefwv_it_test.go @@ -167,7 +167,7 @@ CDR0000330 0 20120710070434000123123458 0040123232350 TRL0001DDB ABC Some Connect A.B. DDB-Some-10022-20120711-309.CDR 0003090000003300000030550000000001000000000100Y ` -// The default scenario, out of cdrc defined in .cfg file +// The default scenario, out of ers defined in .cfg file func testFWVITHandleCdr1File(t *testing.T) { fileName := "file1.fwv" tmpFilePath := path.Join("/tmp", fileName) diff --git a/ers/filejson_it_test.go b/ers/filejson_it_test.go index 7e1e157f81..49e388547c 100644 --- a/ers/filejson_it_test.go +++ b/ers/filejson_it_test.go @@ -180,7 +180,7 @@ func testJSONAddData(t *testing.T) { } } -// The default scenario, out of cdrc defined in .cfg file +// The default scenario, out of ers defined in .cfg file func testJSONHandleFile(t *testing.T) { fileName := "file1.json" tmpFilePath := path.Join("/tmp", fileName) diff --git a/ers/filexml_it_test.go b/ers/filexml_it_test.go index a169ea0195..f3fdadfbdd 100644 --- a/ers/filexml_it_test.go +++ b/ers/filexml_it_test.go @@ -253,7 +253,7 @@ var cdrXmlBroadsoft = ` ` -// The default scenario, out of cdrc defined in .cfg file +// The default scenario, out of ers defined in .cfg file func testXMLITHandleCdr1File(t *testing.T) { fileName := "file1.xml" tmpFilePath := path.Join("/tmp", fileName) diff --git a/ers/flatstore_it_test.go b/ers/flatstore_it_test.go index a5c4dc383a..cc9bc410ba 100644 --- a/ers/flatstore_it_test.go +++ b/ers/flatstore_it_test.go @@ -148,7 +148,7 @@ func testFlatstoreITLoadTPFromFolder(t *testing.T) { } } -// The default scenario, out of cdrc defined in .cfg file +// The default scenario, out of ers defined in .cfg file func testFlatstoreITHandleCdr1File(t *testing.T) { if err := ioutil.WriteFile(path.Join("/tmp", "acc_1.log"), []byte(fullSuccessfull), 0644); err != nil { t.Fatal(err.Error()) @@ -172,7 +172,7 @@ func testFlatstoreITHandleCdr1File(t *testing.T) { // check the files to be processed filesInDir, _ := ioutil.ReadDir("/tmp/flatstoreErs/in") if len(filesInDir) != 0 { - t.Errorf("Files in cdrcInDir: %+v", filesInDir) + t.Errorf("Files in ersInDir: %+v", filesInDir) } filesOutDir, _ := ioutil.ReadDir("/tmp/flatstoreErs/out") if len(filesOutDir) != 6 { diff --git a/ers/kafka_it_test.go b/ers/kafka_it_test.go index 67f9b10554..7ed4c16706 100644 --- a/ers/kafka_it_test.go +++ b/ers/kafka_it_test.go @@ -51,7 +51,7 @@ func TestKafkaER(t *testing.T) { "run_delay": "-1", // sleep interval in seconds between consecutive runs, -1 to use automation via inotify or 0 to disable running all together "concurrent_requests": 1024, // maximum simultaneous requests/files to process, 0 for unlimited "source_path": "localhost:9092", // read data from this path - // "processed_path": "/var/spool/cgrates/cdrc/out", // move processed data here + // "processed_path": "/var/spool/cgrates/ers/out", // move processed data here "tenant": "cgrates.org", // tenant used by import "filters": [], // limit parsing based on the filters "flags": [], // flags to influence the event processing diff --git a/ers/partial_csv_it_test.go b/ers/partial_csv_it_test.go index 9094ef6976..f3f0e0ad9e 100644 --- a/ers/partial_csv_it_test.go +++ b/ers/partial_csv_it_test.go @@ -147,7 +147,7 @@ func testPartITLoadTPFromFolder(t *testing.T) { } } -// The default scenario, out of cdrc defined in .cfg file +// The default scenario, out of ers defined in .cfg file func testPartITHandleCdr1File(t *testing.T) { fileName := "file1.csv" tmpFilePath := path.Join("/tmp", fileName) @@ -159,7 +159,7 @@ func testPartITHandleCdr1File(t *testing.T) { } } -// The default scenario, out of cdrc defined in .cfg file +// The default scenario, out of ers defined in .cfg file func testPartITHandleCdr2File(t *testing.T) { fileName := "file2.csv" tmpFilePath := path.Join("/tmp", fileName) @@ -171,7 +171,7 @@ func testPartITHandleCdr2File(t *testing.T) { } } -// The default scenario, out of cdrc defined in .cfg file +// The default scenario, out of ers defined in .cfg file func testPartITHandleCdr3File(t *testing.T) { fileName := "file3.csv" tmpFilePath := path.Join("/tmp", fileName) diff --git a/migrator/cdrs.go b/migrator/cdrs.go index c6ea16c4b3..286b2d3a99 100755 --- a/migrator/cdrs.go +++ b/migrator/cdrs.go @@ -123,7 +123,7 @@ type v1Cdrs struct { Usage time.Duration // event usage information (eg: in case of tor=*voice this will represent the total duration of a call) ExtraFields map[string]string // Extra fields to be stored in CDR ExtraInfo string // Container for extra information related to this CDR, eg: populated with error reason in case of error on calculation - Partial bool // Used for partial record processing by CDRC + Partial bool // Used for partial record processing by ERs Rated bool // Mark the CDR as rated so we do not process it during rating CostSource string // The source of this cost Cost float64 diff --git a/packages/debian/changelog b/packages/debian/changelog index d9736f07b0..fdc7dc7912 100644 --- a/packages/debian/changelog +++ b/packages/debian/changelog @@ -65,6 +65,7 @@ cgrates (0.11.0~dev) UNRELEASED; urgency=medium * [AgentS] Added DynamicDataProvider to AgentRequest * [Server] Corectly log the server listen error * [ERs] Added support to reference CSV fields by the column name + * [ERs] Renamed *default reader folders -- DanB Wed, 19 Feb 2020 13:25:52 +0200 diff --git a/packages/debian/rules b/packages/debian/rules index a1f9aff97a..9c3f600587 100755 --- a/packages/debian/rules +++ b/packages/debian/rules @@ -34,8 +34,8 @@ binary-arch: clean cp -r $(CURDIR)/data/* $(PKGDIR)/usr/share/cgrates/ tar -xzvf $(PKGDIR)/usr/share/cgrates/tutorials/fs_evsock/freeswitch/etc/freeswitch_conf.tar.gz -C $(PKGDIR)/usr/share/cgrates/tutorials/fs_evsock/freeswitch/etc/ rm $(PKGDIR)/usr/share/cgrates/tutorials/fs_evsock/freeswitch/etc/freeswitch_conf.tar.gz - mkdir -p $(PKGDIR)/var/spool/cgrates/cdrc/in - mkdir -p $(PKGDIR)/var/spool/cgrates/cdrc/out + mkdir -p $(PKGDIR)/var/spool/cgrates/ers/in + mkdir -p $(PKGDIR)/var/spool/cgrates/ers/out mkdir -p $(PKGDIR)/var/spool/cgrates/cdre/csv mkdir -p $(PKGDIR)/var/spool/cgrates/cdre/fwv mkdir -p $(PKGDIR)/var/spool/cgrates/tpe diff --git a/utils/errors.go b/utils/errors.go index 83d4b41fd9..d964481c40 100644 --- a/utils/errors.go +++ b/utils/errors.go @@ -61,8 +61,6 @@ var ( ErrReplyTimeout = errors.New("REPLY_TIMEOUT") ErrSessionNotFound = errors.New("SESSION_NOT_FOUND") ErrJsonIncompleteComment = errors.New("JSON_INCOMPLETE_COMMENT") - ErrCDRCNoProfileID = errors.New("CDRC_PROFILE_WITHOUT_ID") - ErrCDRCNoInPath = errors.New("CDRC_PROFILE_WITHOUT_IN_PATH") ErrNotEnoughParameters = errors.New("NotEnoughParameters") ErrNotConnected = errors.New("NOT_CONNECTED") RalsErrorPrfx = "RALS_ERROR" @@ -105,8 +103,6 @@ var ( ErrReplyTimeout.Error(): ErrReplyTimeout, ErrSessionNotFound.Error(): ErrSessionNotFound, ErrJsonIncompleteComment.Error(): ErrJsonIncompleteComment, - ErrCDRCNoProfileID.Error(): ErrCDRCNoProfileID, - ErrCDRCNoInPath.Error(): ErrCDRCNoInPath, ErrNotEnoughParameters.Error(): ErrNotEnoughParameters, ErrUnsupportedFormat.Error(): ErrUnsupportedFormat, ErrNoDatabaseConn.Error(): ErrNoDatabaseConn,