From 5dd9798ff88295904eef22fa10c72201f6ff3c19 Mon Sep 17 00:00:00 2001 From: rinor Date: Tue, 10 Nov 2015 21:09:09 +0100 Subject: [PATCH 1/3] cgr-engine.go - Fix some log messages --- cmd/cgr-engine/cgr-engine.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/cgr-engine/cgr-engine.go b/cmd/cgr-engine/cgr-engine.go index 9811bc6ce..013d53782 100644 --- a/cmd/cgr-engine/cgr-engine.go +++ b/cmd/cgr-engine/cgr-engine.go @@ -238,7 +238,7 @@ func startSmFreeSWITCH(internalRaterChan chan *engine.Responder, cdrDb engine.Cd sm := sessionmanager.NewFSSessionManager(cfg.SmFsConfig, raterConn, cdrsConn, cfg.DefaultTimezone) smRpc.SMs = append(smRpc.SMs, sm) if err = sm.Connect(); err != nil { - utils.Logger.Err(fmt.Sprintf(" error: %s!", err)) + utils.Logger.Err(fmt.Sprintf(" error: %s!", err)) } exitChan <- true } @@ -257,7 +257,7 @@ func startSmKamailio(internalRaterChan chan *engine.Responder, cdrDb engine.CdrS } else { client, err = rpcclient.NewRpcClient("tcp", raterCfg.Server, cfg.ConnectAttempts, cfg.Reconnects, utils.GOB) if err != nil { //Connected so no need to reiterate - utils.Logger.Crit(fmt.Sprintf(" Could not connect to rater via RPC: %v", err)) + utils.Logger.Crit(fmt.Sprintf(" Could not connect to rater via RPC: %v", err)) exitChan <- true return } @@ -276,7 +276,7 @@ func startSmKamailio(internalRaterChan chan *engine.Responder, cdrDb engine.CdrS } else { client, err = rpcclient.NewRpcClient("tcp", cdrsCfg.Server, cfg.ConnectAttempts, cfg.Reconnects, utils.GOB) if err != nil { - utils.Logger.Crit(fmt.Sprintf(" Could not connect to CDRS via RPC: %v", err)) + utils.Logger.Crit(fmt.Sprintf(" Could not connect to CDRS via RPC: %v", err)) exitChan <- true return } @@ -287,7 +287,7 @@ func startSmKamailio(internalRaterChan chan *engine.Responder, cdrDb engine.CdrS sm, _ := sessionmanager.NewKamailioSessionManager(cfg.SmKamConfig, raterConn, cdrsConn, cfg.DefaultTimezone) smRpc.SMs = append(smRpc.SMs, sm) if err = sm.Connect(); err != nil { - utils.Logger.Err(fmt.Sprintf(" error: %s!", err)) + utils.Logger.Err(fmt.Sprintf(" error: %s!", err)) } exitChan <- true } @@ -306,7 +306,7 @@ func startSmOpenSIPS(internalRaterChan chan *engine.Responder, cdrDb engine.CdrS } else { client, err = rpcclient.NewRpcClient("tcp", raterCfg.Server, cfg.ConnectAttempts, cfg.Reconnects, utils.GOB) if err != nil { //Connected so no need to reiterate - utils.Logger.Crit(fmt.Sprintf(" Could not connect to rater via RPC: %v", err)) + utils.Logger.Crit(fmt.Sprintf(" Could not connect to rater via RPC: %v", err)) exitChan <- true return } @@ -325,7 +325,7 @@ func startSmOpenSIPS(internalRaterChan chan *engine.Responder, cdrDb engine.CdrS } else { client, err = rpcclient.NewRpcClient("tcp", cdrsCfg.Server, cfg.ConnectAttempts, cfg.Reconnects, utils.GOB) if err != nil { - utils.Logger.Crit(fmt.Sprintf(" Could not connect to CDRS via RPC: %v", err)) + utils.Logger.Crit(fmt.Sprintf(" Could not connect to CDRS via RPC: %v", err)) exitChan <- true return } From f1693348a71eca1b1ff39f54a84f40f8d7f11651 Mon Sep 17 00:00:00 2001 From: rinor Date: Tue, 10 Nov 2015 22:23:46 +0100 Subject: [PATCH 2/3] doc fix --- docs/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 7012fc964..ecf9b9620 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1,4 +1,4 @@ -Configuration +4.Configuration ============= The behaviour of **CGRateS** can be externally influenced by following means: From e08b90dab5aee17575e7131e18827a113d203b83 Mon Sep 17 00:00:00 2001 From: rinor Date: Tue, 10 Nov 2015 23:38:54 +0100 Subject: [PATCH 3/3] docs/architecture.rst - change cmd output - WIP --- docs/architecture.rst | 122 +++++++++++++++++++++++++++++++++++------- 1 file changed, 104 insertions(+), 18 deletions(-) diff --git a/docs/architecture.rst b/docs/architecture.rst index 4ad584b4c..15d4078d8 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -13,10 +13,24 @@ Customisable through the use of a configuration file, it will start on demand on rif@grace:~$ cgr-engine -help Usage of cgr-engine: - -config="/etc/cgrates/cgrates.cfg": Configuration file location. - -version=false: Prints the application version. + -cdrs + Enforce starting of the cdrs daemon overwriting config + -config_dir string + Configuration directory path. (default "/etc/cgrates/") + -cpuprofile string + write cpu profile to file + -pid string + Write pid file + -rater + Enforce starting of the rater daemon overwriting config + -scheduler + Enforce starting of the scheduler daemon .overwriting config + -singlecpu + Run on single CPU core + -version + Prints the application version. -:Example: cgr-engine -config=cgr-customconfig.cfg +:Example: cgr-engine -config_dir=/etc/cgrates 2.1.1. Rater service ~~~~~~~~~~~~~~~~~~~~ @@ -75,30 +89,102 @@ Used for importing the rating information into the CGRateS database system. rif@grace:~$ cgr-loader -help Usage of cgr-loader: - -dbhost="localhost": The database host to connect to. - -dbname="10": he name/number of the database to connect to. - -dbpass="": The database user's password. - -dbport="6379": The database port to bind to. - -dbtype="redis": The type of the database (redis|mongo|postgres) - -dbuser="": The database user to sign in as. - -flush=false: Flush the database before importing - -path=".": The path containing the data files - -version=false: Prints the application version. + -cdrstats_address string + CDRStats service to contact for data reloads, empty to disable automatic data reloads (default "127.0.0.1:2013") + -datadb_host string + The DataDb host to connect to. (default "127.0.0.1") + -datadb_name string + The name/number of the DataDb to connect to. (default "11") + -datadb_passwd string + The DataDb user's password. + -datadb_port string + The DataDb port to bind to. (default "6379") + -datadb_type string + The type of the DataDb database (default "redis") + -datadb_user string + The DataDb user to sign in as. + -dbdata_encoding string + The encoding used to store object data in strings (default "msgpack") + -dry_run + When true will not save loaded data to dataDb but just parse it for consistency and errors. + -flushdb + Flush the database before importing + -from_stordb + Load the tariff plan from storDb to dataDb + -history_server string + The history server address:port, empty to disable automaticautomatic history archiving (default "127.0.0.1:2013") + -load_history_size int + Limit the number of records in the load history (default 10) + -migrate_rc8 + Migrate Accounts, Actions and ActionTriggers to RC8 structures + -path string + The path to folder containing the data files (default "./") + -rater_address string + Rater service to contact for cache reloads, empty to disable automatic cache reloads (default "127.0.0.1:2013") + -runid string + Uniquely identify an import/load, postpended to some automatic fields + -stats + Generates statsistics about given data. + -stordb_host string + The storDb host to connect to. (default "127.0.0.1") + -stordb_name string + The name/number of the storDb to connect to. (default "cgrates") + -stordb_passwd string + The storDb user's password. (default "CGRateS.org") + -stordb_port string + The storDb port to bind to. (default "3306") + -stordb_type string + The type of the storDb database (default "mysql") + -stordb_user string + The storDb user to sign in as. (default "cgrates") + -timezone string + Timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB> (default "Local") + -to_stordb + Import the tariff plan from files to storDb + -tpdb_host string + The TariffPlan host to connect to. (default "127.0.0.1") + -tpdb_name string + The name/number of the TariffPlan to connect to. (default "10") + -tpdb_passwd string + The TariffPlan user's password. + -tpdb_port string + The TariffPlan port to bind to. (default "6379") + -tpdb_type string + The type of the TariffPlan database (default "redis") + -tpdb_user string + The TariffPlan user to sign in as. + -tpid string + The tariff plan id from the database + -users_address string + Users service to contact for data reloads, empty to disable automatic data reloads (default "127.0.0.1:2013") + -validate + When true will run various check on the loaded data to check for structural errors + -verbose + Enable detailed verbose logging output + -version + Prints the application version. -:Example: cgr-loader -flush +:Example: cgr-loader -flushdb 2.3. cgr-console ---------------- Command line tool used to interface with the Rater (or Balancer). Able to execute sub-commands + :: - cgrrif@grace:~$ cgr-console -help + rif@grace:~$ cgr-console -help Usage of cgr-console: - -rpc_encoding="gob": RPC encoding used - -server="127.0.0.1:2012": server address host:port - -version=false: Prints the application version. - cgrrif@grace:~$ cgr-console help_more + -rpc_encoding string + RPC encoding used (default "json") + -server string + server address host:port (default "127.0.0.1:2012") + -verbose + Show extra info about command execution. + -version + Prints the application version. + + rif@grace:~$ cgr-console help_more 2013/04/13 17:23:51 Usage: cgr-console [cfg_opts...{-h}]