diff --git a/cmd/cgr-loader/cgr-loader.go b/cmd/cgr-loader/cgr-loader.go index 2734bbc37..96f117cb0 100644 --- a/cmd/cgr-loader/cgr-loader.go +++ b/cmd/cgr-loader/cgr-loader.go @@ -19,12 +19,12 @@ along with this program. If not, see package main import ( + "encoding/csv" "flag" "github.com/cgrates/cgrates/timespans" "log" - "encoding/csv" - "strings" "os" + "strings" ) var ( diff --git a/cmd/cgr-loader/helpers.go b/cmd/cgr-loader/helpers.go index 6d6bd3287..df7cf270c 100644 --- a/cmd/cgr-loader/helpers.go +++ b/cmd/cgr-loader/helpers.go @@ -22,8 +22,6 @@ import ( "github.com/cgrates/cgrates/timespans" "log" "strconv" - "strings" - "time" ) type Rate struct { diff --git a/data/test.config b/data/test.config index 72c1957ad..508e58c2d 100644 --- a/data/test.config +++ b/data/test.config @@ -15,38 +15,42 @@ # along with this program. If not, see [global] -redis_server = test #redis address host:port -redis_db = 1 # redis database number - -[rater] -enabled = true -standalone = true # start standalone server (no balancer) -balancer_server = test # balancer address host:port -listen_api = test # listening address host:port -json = true # use JSON for RPC encoding +redis_server = 127.0.0.1:6379 #redis address hostort +redis_db = 10 # redis database number [balancer] -enabled = true -standalone = true # run standalone -listen_rater = test # Rater server address -listen_api = test # Json RPC server address -web_status_server = test # Web server address (for status) +enabled = false # Start balancer server +listen = 127.0.0.1:2001 # Balancer listen interface +json = false # use JSON for RPC encoding -[scheduler] -enabled = true - -[session_manager] -enabled = true -api_server = test # balancer address host:port -freeswitch_server = test # freeswitch address host:port -freeswitch_pass = test # freeswitch address host:port +[rater] +enable = true +listen = 127.0.0.1:2001 # listening address hostort, internal for internal communication only +balancer = 127.0.0.1:2000 # if defined it will register to balancer as worker +json = false # use JSON for RPC encoding [mediator] -enabled = true -cdr_file = test # Freeswitch Master CSV CDR file. -result_file = test # Generated file containing CDR and price info. -host = test # The host to connect to. Values that start with / are for UNIX domain sockets. -port = test # The port to bind to. -db = test # The name of the database to connect to. -user = test # The user to sign in as. -password = test # The user's password. +enabled = false +cdr_file = Master.csv # Freeswitch Master CSV CDR file. +result_file = out.csv # Generated file containing CDR and price info. +db_type = postgres # Only one supported for now +db_host = localhost # The host to connect to. Values that start with / are for UNIX domain sockets. +db_port = 5432 # The port to bind to. +db_name = cgrates # The name of the database to connect to. +db_user = # The user to sign in as. +db_paswd = # The user's password.root + +[scheduler] +enabled = false +json = false # use JSON for RPC encoding + +[session_manager] +enabled = false +rater = 127.0.0.1:2000 #address where to access rater. Can be internal, direct rater address or the address of a balancer +freeswitch_server = localhost:8021 # freeswitch address hostort +freeswitch_pass = ClueCon # freeswitch address hostort +json = false # use JSON for RPC encoding + +[stats_server] +enabled = false +listen = 127.0.0.1:8000 # Web server address (for stat reports) \ No newline at end of file diff --git a/timespans/calldesc.go b/timespans/calldesc.go index 284f246a8..a8d9e54b1 100644 --- a/timespans/calldesc.go +++ b/timespans/calldesc.go @@ -21,7 +21,6 @@ package timespans import ( "errors" "fmt" - "log" "log/syslog" "math" "time" @@ -268,7 +267,6 @@ Creates a CallCost structure with the cost information calculated for the receiv func (cd *CallDescriptor) GetCost() (*CallCost, error) { destPrefix, err := cd.SearchStorageForPrefix() timespans := cd.splitInTimeSpans() - log.Print(timespans[0].Interval) cost := 0.0 connectionFee := 0.0 for i, ts := range timespans { diff --git a/timespans/interval_test.go b/timespans/interval_test.go index 88c2d6916..95c335417 100644 --- a/timespans/interval_test.go +++ b/timespans/interval_test.go @@ -38,7 +38,7 @@ func TestIntervalStoreRestore(t *testing.T) { RateIncrements: 1, } r := i.store() - if string(r) != "1,2,3,4,5,6,7,8,9,10,11,12;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;1,2,3,4,5;18:00:00;00:00:00;10;0;1;60;1" { + if string(r) != ";1,2,3,4,5,6,7,8,9,10,11,12;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;1,2,3,4,5;18:00:00;00:00:00;10;0;1;60;1" { t.Errorf("Error serializing interval: %v", string(r)) } o := &Interval{}