From 27f7e6d9ca8575a84b0980dee9b9f2da0a1e97cf Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Tue, 7 Apr 2015 13:59:21 +0300 Subject: [PATCH] fixed lcr csv order and started lcr docs --- docs/index.rst | 1 + docs/lcr.rst | 6 ++++++ engine/loader_csv.go | 2 +- engine/loader_csv_test.go | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 docs/lcr.rst diff --git a/docs/index.rst b/docs/index.rst index 2c6c11836..9cf7018eb 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,6 +16,7 @@ Contents: installation configuration administration + lcr advanced tutorials miscellaneous diff --git a/docs/lcr.rst b/docs/lcr.rst new file mode 100644 index 000000000..2814cbc27 --- /dev/null +++ b/docs/lcr.rst @@ -0,0 +1,6 @@ +LCR System +========== + +In voice telecommunications, least-cost routing (LCR) is the process of selecting the path of outbound communications traffic based on cost. Within a telecoms carrier, an LCR team might periodically (monthly, weekly or even daily) choose between routes from several or even hundreds of carriers for destinations across the world. This function might also be automated by a device or software program known as a "Least Cost Router." [WIKI2015]_ + +.. [WIKI2015] http://en.wikipedia.org/wiki/Least-cost_routing diff --git a/engine/loader_csv.go b/engine/loader_csv.go index 7d1934380..fdbf94ee2 100644 --- a/engine/loader_csv.go +++ b/engine/loader_csv.go @@ -609,7 +609,7 @@ func (csvr *CSVReader) LoadLCRs() (err error) { defer fp.Close() } for record, err := csvReader.Read(); err == nil; record, err = csvReader.Read() { - tenant, category, direction, account, subject := record[0], record[1], record[2], record[3], record[4] + direction, tenant, category, account, subject := record[0], record[1], record[2], record[3], record[4] id := utils.LCRKey(direction, tenant, category, account, subject) lcr, found := csvr.lcrs[id] activationTime, err := utils.ParseTimeDetectLayout(record[9]) diff --git a/engine/loader_csv_test.go b/engine/loader_csv_test.go index c4de6a124..c9de2d5d9 100644 --- a/engine/loader_csv_test.go +++ b/engine/loader_csv_test.go @@ -141,8 +141,8 @@ SG3,*any,*lowest, ` lcrs = ` -cgrates.org,call,*in,*any,*any,EU_LANDLINE,LCR_STANDARD,*static,ivo;dan;rif,2012-01-01T00:00:00Z,10 -cgrates.org,call,*in,*any,*any,*any,LCR_STANDARD,*lowest_cost,,2012-01-01T00:00:00Z,20 +*in,cgrates.org,call,*any,*any,EU_LANDLINE,LCR_STANDARD,*static,ivo;dan;rif,2012-01-01T00:00:00Z,10 +*in,cgrates.org,call,*any,*any,*any,LCR_STANDARD,*lowest_cost,,2012-01-01T00:00:00Z,20 ` actions = ` MINI,*topup_reset,,,*monetary,*out,,,,,*unlimited,,10,10,10