From 4fbe9f1eefdf37598e4d210bc0747a375134cbce Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Sat, 21 Jul 2012 17:02:19 +0300 Subject: [PATCH] created multiple configuration files --- cmd/cgr-rater/cgr-rater.go | 40 ++++++++++++------ cmd/cgr-rater/rater_test.go | 1 + cmd/cgr-rater/registration.go | 30 +++++++------- cmd/cgr-rater/responder_rpc.go | 4 +- conf/balancer.config | 33 +++++++++++++++ conf/balancer_standalone.config | 27 ++++++++++++ conf/mediator.config | 57 ++++++++++++++++++++++++++ conf/mediator_standalone.config | 57 ++++++++++++++++++++++++++ conf/rater.config | 33 +-------------- conf/rater_standalone.config | 24 +++++++++++ conf/scheduler.config | 57 ++++++++++++++++++++++++++ conf/scheduler_standalone.config | 57 ++++++++++++++++++++++++++ conf/session_manager.config | 57 ++++++++++++++++++++++++++ conf/session_manager_standalone.config | 57 ++++++++++++++++++++++++++ data/test.config | 1 + 15 files changed, 473 insertions(+), 62 deletions(-) create mode 100644 conf/balancer.config create mode 100644 conf/balancer_standalone.config create mode 100644 conf/mediator.config create mode 100644 conf/mediator_standalone.config create mode 100644 conf/rater_standalone.config create mode 100644 conf/scheduler.config create mode 100644 conf/scheduler_standalone.config create mode 100644 conf/session_manager.config create mode 100644 conf/session_manager_standalone.config diff --git a/cmd/cgr-rater/cgr-rater.go b/cmd/cgr-rater/cgr-rater.go index 568e6dc35..61aa54709 100644 --- a/cmd/cgr-rater/cgr-rater.go +++ b/cmd/cgr-rater/cgr-rater.go @@ -25,12 +25,14 @@ import ( "github.com/cgrates/cgrates/balancer" "github.com/cgrates/cgrates/timespans" "net" + "net/http" "net/rpc" "net/rpc/jsonrpc" + "runtime" ) var ( - config = flag.String("config", "/home/rif/Documents/prog/go/src/github.com/cgrates/cgrates/conf/rater.config", "Configuration file location.") + config = flag.String("config", "/home/rif/Documents/prog/go/src/github.com/cgrates/cgrates/conf/rater_standalone.config", "Configuration file location.") redis_server = "127.0.0.1:6379" // redis address host:port redis_db = 10 // redis database number @@ -39,11 +41,12 @@ var ( rater_listen = "127.0.0.1:1234" // listening address host:port rater_json = false // use JSON for RPC encoding - balancer_enabled = false - balancer_standalone = false // run standalone - balancer_listen_rater = "127.0.0.1:2000" // Rater server address - balancer_listen_api = "127.0.0.1:2001" // Json RPC server address - balancer_json = false // use JSON for RPC encoding + balancer_enabled = false + balancer_standalone = false // run standalone + balancer_listen_rater = "127.0.0.1:2000" // Rater server address + balancer_listen_api = "127.0.0.1:2001" // Json RPC server address + balancer_web_status_server = "127.0.0.1:8000" // Web server address + balancer_json = false // use JSON for RPC encoding scheduler_enabled = false scheduler_standalone = false // run standalone (no other service) @@ -72,7 +75,6 @@ var ( ) func readConfig(configFn string) { - flag.Parse() c, err := conf.ReadConfigFile(configFn) if err != nil { timespans.Logger.Err(fmt.Sprintf("Could not open the configuration file: %v", err)) @@ -90,6 +92,7 @@ func readConfig(configFn string) { balancer_standalone, _ = c.GetBool("balancer", "standalone") balancer_listen_rater, _ = c.GetString("balancer", "listen_rater") balancer_listen_api, _ = c.GetString("balancer", "listen_api") + balancer_web_status_server, _ = c.GetString("balancer", "web_status_server") balancer_json, _ = c.GetBool("balancer", "json") scheduler_enabled, _ = c.GetBool("scheduler", "enabled") @@ -164,15 +167,17 @@ func listenToRPCRequests(responder interface{}, rpcAddress string, json bool) { } } -/*func listenToHttpRequests() { +func listenToHttpRequests() { http.HandleFunc("/", statusHandler) http.HandleFunc("/getmem", memoryHandler) http.HandleFunc("/raters", ratersHandler) - log.Print("The server is listening on ", *httpApiAddress) - http.ListenAndServe(*httpApiAddress, nil) + timespans.Logger.Info(fmt.Sprintf("The server is listening on %s", balancer_web_status_server)) + http.ListenAndServe(balancer_web_status_server, nil) } -*/ + func main() { + flag.Parse() + runtime.GOMAXPROCS(runtime.NumCPU()) readConfig(*config) resolveStandaloneConfilcts() getter, err := timespans.NewRedisStorage(redis_server, redis_db) @@ -183,10 +188,19 @@ func main() { defer getter.Close() timespans.SetStorageGetter(getter) - if !rater_standalone { + if !rater_standalone && !balancer_enabled { go registerToBalancer(rater_balancer_server, rater_listen) go stopRaterSingnalHandler(rater_balancer_server, rater_listen, getter) } - go listenToRPCRequests(&Responder{new(DirectResponder)}, rater_listen, false) + if !balancer_enabled { + go listenToRPCRequests(&Responder{new(DirectResponder)}, rater_listen, rater_json) + } + if balancer_enabled { + go stopBalancerSingnalHandler() + go listenToRPCRequests(new(RaterServer), balancer_listen_rater, false) + go listenToRPCRequests(&Responder{new(RpcResponder)}, balancer_listen_api, balancer_json) + go listenToHttpRequests() + } + <-exitChan } diff --git a/cmd/cgr-rater/rater_test.go b/cmd/cgr-rater/rater_test.go index b513d2312..3cf74814d 100644 --- a/cmd/cgr-rater/rater_test.go +++ b/cmd/cgr-rater/rater_test.go @@ -37,6 +37,7 @@ func TestConfig(t *testing.T) { balancer_standalone != true || balancer_listen_rater != "test" || balancer_listen_api != "test" || + balancer_web_status_server != "test" || balancer_json != true || scheduler_enabled != true || diff --git a/cmd/cgr-rater/registration.go b/cmd/cgr-rater/registration.go index 3d2e071dc..be34a8105 100644 --- a/cmd/cgr-rater/registration.go +++ b/cmd/cgr-rater/registration.go @@ -32,20 +32,6 @@ import ( type RaterServer struct{} -/* -Listens for SIGTERM, SIGINT, SIGQUIT system signals and shuts down all the registered raters. -*/ -func stopSingnalHandler() { - log.Print("Handling stop signals...") - c := make(chan os.Signal) - signal.Notify(c, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT) - - sig := <-c - log.Printf("Caught signal %v, sending shutdownto raters\n", sig) - bal.Shutdown() - exitChan <- true -} - /* RPC method that receives a rater address, connects to it and ads the pair to the rater list for balancing */ @@ -77,6 +63,20 @@ func (rs *RaterServer) UnRegisterRater(clientAddress string, replay *int) error return nil } +/* +Listens for SIGTERM, SIGINT, SIGQUIT system signals and shuts down all the registered raters. +*/ +func stopBalancerSingnalHandler() { + log.Print("Handling stop signals...") + c := make(chan os.Signal) + signal.Notify(c, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT) + + sig := <-c + log.Printf("Caught signal %v, sending shutdownto raters\n", sig) + bal.Shutdown() + exitChan <- true +} + /* Listens for the SIGTERM, SIGINT, SIGQUIT system signals and gracefuly unregister from balancer and closes the storage before exiting. */ @@ -99,7 +99,7 @@ func unregisterFromBalancer(server, listen string) { client, err := rpc.DialHTTP("tcp", server) if err != nil { log.Print("Cannot contact the balancer!") - os.Exit(1) + exitChan <- true } var reply int log.Print("Unregistering from balancer ", server) diff --git a/cmd/cgr-rater/responder_rpc.go b/cmd/cgr-rater/responder_rpc.go index 5370a6680..2c281b7b9 100644 --- a/cmd/cgr-rater/responder_rpc.go +++ b/cmd/cgr-rater/responder_rpc.go @@ -64,8 +64,8 @@ func (r *RpcResponder) GetMaxSessionTime(arg timespans.CallDescriptor, replay *f return } -func (r *RpcResponder) AddVolumeDiscountSeconds(arg timespans.CallDescriptor, replay *float64) (err error) { - *replay, err = CallMethod(&arg, "Responder.AddVolumeDiscountSeconds") +func (r *RpcResponder) AddRecievedCallSeconds(arg timespans.CallDescriptor, replay *float64) (err error) { + *replay, err = CallMethod(&arg, "Responder.AddRecievedCallSeconds") return } diff --git a/conf/balancer.config b/conf/balancer.config new file mode 100644 index 000000000..b70189010 --- /dev/null +++ b/conf/balancer.config @@ -0,0 +1,33 @@ +# Rating system designed to be used in VoIP Carriers World +# Copyright (C) 2012 Radu Ioan Fericean +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +[global] +redis_server = 127.0.0.1:6379 #redis address host:port +redis_db = 10 # redis database number + +[rater] +standalone = true # start standalone server (no balancer) +balancer_server = 127.0.0.1:2000 # balancer address host:port +listen_api = 127.0.0.1:1234 # listening address host:port +json = false # use JSON for RPC encoding + +[balancer] +enabled = false +standalone = false # run standalone +listen_rater = 127.0.0.1:2000 # Rater server address +listen_api = 127.0.0.1:2001 # Json RPC server address +web_status_server = 127.0.0.1:8000 # Web server address (for status) +json = false # use JSON for RPC encoding diff --git a/conf/balancer_standalone.config b/conf/balancer_standalone.config new file mode 100644 index 000000000..8800b899e --- /dev/null +++ b/conf/balancer_standalone.config @@ -0,0 +1,27 @@ +# Rating system designed to be used in VoIP Carriers World +# Copyright (C) 2012 Radu Ioan Fericean +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +[global] +redis_server = 127.0.0.1:6379 #redis address host:port +redis_db = 10 # redis database number + +[balancer] +enabled = true +standalone = true # run standalone +listen_rater = 127.0.0.1:2000 # Rater server address +listen_api = 127.0.0.1:2001 # Json RPC server address +web_status_server = 127.0.0.1:8000 # Web server address (for status) +json = false # use JSON for RPC encoding diff --git a/conf/mediator.config b/conf/mediator.config new file mode 100644 index 000000000..bb1f63c30 --- /dev/null +++ b/conf/mediator.config @@ -0,0 +1,57 @@ +# Rating system designed to be used in VoIP Carriers World +# Copyright (C) 2012 Radu Ioan Fericean +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +[global] +redis_server = 127.0.0.1:6379 #redis address host:port +redis_db = 10 # redis database number + +[rater] +standalone = true # start standalone server (no balancer) +balancer_server = 127.0.0.1:2000 # balancer address host:port +listen_api = 127.0.0.1:1234 # listening address host:port +json = false # use JSON for RPC encoding + +[balancer] +enabled = false +standalone = false # run standalone +listen_rater = 127.0.0.1:2000 # Rater server address +listen_api = 127.0.0.1:2001 # Json RPC server address +web_status_server = 127.0.0.1:8000 # Web server address (for status) +json = false # use JSON for RPC encoding + +[scheduler] +enabled = false +standalone = false # run standalone (no other service) +json = false # use JSON for RPC encoding + +[session_manager] +enabled = false +standalone = false # run standalone +api_server = 127.0.0.1:2000 # balancer address host:port +freeswitch_server = localhost:8021 # freeswitch address host:port +freeswitch_pass = ClueCon # freeswitch address host:port +json = false # use JSON for RPC encoding + +[mediator] +enabled = false +standalone = false # run standalone +cdr_file = Master.csv # Freeswitch Master CSV CDR file. +result_file = out.csv # Generated file containing CDR and price info. +host = localhost # The host to connect to. Values that start with / are for UNIX domain sockets. +port = 5432 # The port to bind to. +db = cgrates # The name of the database to connect to. +user = # The user to sign in as. +password = # The user's password. \ No newline at end of file diff --git a/conf/mediator_standalone.config b/conf/mediator_standalone.config new file mode 100644 index 000000000..bb1f63c30 --- /dev/null +++ b/conf/mediator_standalone.config @@ -0,0 +1,57 @@ +# Rating system designed to be used in VoIP Carriers World +# Copyright (C) 2012 Radu Ioan Fericean +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +[global] +redis_server = 127.0.0.1:6379 #redis address host:port +redis_db = 10 # redis database number + +[rater] +standalone = true # start standalone server (no balancer) +balancer_server = 127.0.0.1:2000 # balancer address host:port +listen_api = 127.0.0.1:1234 # listening address host:port +json = false # use JSON for RPC encoding + +[balancer] +enabled = false +standalone = false # run standalone +listen_rater = 127.0.0.1:2000 # Rater server address +listen_api = 127.0.0.1:2001 # Json RPC server address +web_status_server = 127.0.0.1:8000 # Web server address (for status) +json = false # use JSON for RPC encoding + +[scheduler] +enabled = false +standalone = false # run standalone (no other service) +json = false # use JSON for RPC encoding + +[session_manager] +enabled = false +standalone = false # run standalone +api_server = 127.0.0.1:2000 # balancer address host:port +freeswitch_server = localhost:8021 # freeswitch address host:port +freeswitch_pass = ClueCon # freeswitch address host:port +json = false # use JSON for RPC encoding + +[mediator] +enabled = false +standalone = false # run standalone +cdr_file = Master.csv # Freeswitch Master CSV CDR file. +result_file = out.csv # Generated file containing CDR and price info. +host = localhost # The host to connect to. Values that start with / are for UNIX domain sockets. +port = 5432 # The port to bind to. +db = cgrates # The name of the database to connect to. +user = # The user to sign in as. +password = # The user's password. \ No newline at end of file diff --git a/conf/rater.config b/conf/rater.config index 6928c30ee..1c72f5af1 100644 --- a/conf/rater.config +++ b/conf/rater.config @@ -19,38 +19,7 @@ redis_server = 127.0.0.1:6379 #redis address host:port redis_db = 10 # redis database number [rater] -standalone = true # start standalone server (no balancer) +standalone = false # start standalone server (no balancer) balancer_server = 127.0.0.1:2000 # balancer address host:port listen_api = 127.0.0.1:1234 # listening address host:port json = false # use JSON for RPC encoding - -[balancer] -enabled = false -standalone = false # run standalone -listen_rater = 127.0.0.1:2000 # Rater server address -listen_api = 127.0.0.1:2001 # Json RPC server address -json = false # use JSON for RPC encoding - -[scheduler] -enabled = false -standalone = false # run standalone (no other service) -json = false # use JSON for RPC encoding - -[session_manager] -enabled = false -standalone = false # run standalone -api_server = 127.0.0.1:2000 # balancer address host:port -freeswitch_server = localhost:8021 # freeswitch address host:port -freeswitch_pass = ClueCon # freeswitch address host:port -json = false # use JSON for RPC encoding - -[mediator] -enabled = false -standalone = false # run standalone -cdr_file = Master.csv # Freeswitch Master CSV CDR file. -result_file = out.csv # Generated file containing CDR and price info. -host = localhost # The host to connect to. Values that start with / are for UNIX domain sockets. -port = 5432 # The port to bind to. -db = cgrates # The name of the database to connect to. -user = # The user to sign in as. -password = # The user's password. \ No newline at end of file diff --git a/conf/rater_standalone.config b/conf/rater_standalone.config new file mode 100644 index 000000000..a112c6e6a --- /dev/null +++ b/conf/rater_standalone.config @@ -0,0 +1,24 @@ +# Rating system designed to be used in VoIP Carriers World +# Copyright (C) 2012 Radu Ioan Fericean +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +[global] +redis_server = 127.0.0.1:6379 #redis address host:port +redis_db = 10 # redis database number + +[rater] +standalone = true # start standalone server (no balancer) +listen_api = 127.0.0.1:1234 # listening address host:port +json = false # use JSON for RPC encoding diff --git a/conf/scheduler.config b/conf/scheduler.config new file mode 100644 index 000000000..bb1f63c30 --- /dev/null +++ b/conf/scheduler.config @@ -0,0 +1,57 @@ +# Rating system designed to be used in VoIP Carriers World +# Copyright (C) 2012 Radu Ioan Fericean +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +[global] +redis_server = 127.0.0.1:6379 #redis address host:port +redis_db = 10 # redis database number + +[rater] +standalone = true # start standalone server (no balancer) +balancer_server = 127.0.0.1:2000 # balancer address host:port +listen_api = 127.0.0.1:1234 # listening address host:port +json = false # use JSON for RPC encoding + +[balancer] +enabled = false +standalone = false # run standalone +listen_rater = 127.0.0.1:2000 # Rater server address +listen_api = 127.0.0.1:2001 # Json RPC server address +web_status_server = 127.0.0.1:8000 # Web server address (for status) +json = false # use JSON for RPC encoding + +[scheduler] +enabled = false +standalone = false # run standalone (no other service) +json = false # use JSON for RPC encoding + +[session_manager] +enabled = false +standalone = false # run standalone +api_server = 127.0.0.1:2000 # balancer address host:port +freeswitch_server = localhost:8021 # freeswitch address host:port +freeswitch_pass = ClueCon # freeswitch address host:port +json = false # use JSON for RPC encoding + +[mediator] +enabled = false +standalone = false # run standalone +cdr_file = Master.csv # Freeswitch Master CSV CDR file. +result_file = out.csv # Generated file containing CDR and price info. +host = localhost # The host to connect to. Values that start with / are for UNIX domain sockets. +port = 5432 # The port to bind to. +db = cgrates # The name of the database to connect to. +user = # The user to sign in as. +password = # The user's password. \ No newline at end of file diff --git a/conf/scheduler_standalone.config b/conf/scheduler_standalone.config new file mode 100644 index 000000000..bb1f63c30 --- /dev/null +++ b/conf/scheduler_standalone.config @@ -0,0 +1,57 @@ +# Rating system designed to be used in VoIP Carriers World +# Copyright (C) 2012 Radu Ioan Fericean +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +[global] +redis_server = 127.0.0.1:6379 #redis address host:port +redis_db = 10 # redis database number + +[rater] +standalone = true # start standalone server (no balancer) +balancer_server = 127.0.0.1:2000 # balancer address host:port +listen_api = 127.0.0.1:1234 # listening address host:port +json = false # use JSON for RPC encoding + +[balancer] +enabled = false +standalone = false # run standalone +listen_rater = 127.0.0.1:2000 # Rater server address +listen_api = 127.0.0.1:2001 # Json RPC server address +web_status_server = 127.0.0.1:8000 # Web server address (for status) +json = false # use JSON for RPC encoding + +[scheduler] +enabled = false +standalone = false # run standalone (no other service) +json = false # use JSON for RPC encoding + +[session_manager] +enabled = false +standalone = false # run standalone +api_server = 127.0.0.1:2000 # balancer address host:port +freeswitch_server = localhost:8021 # freeswitch address host:port +freeswitch_pass = ClueCon # freeswitch address host:port +json = false # use JSON for RPC encoding + +[mediator] +enabled = false +standalone = false # run standalone +cdr_file = Master.csv # Freeswitch Master CSV CDR file. +result_file = out.csv # Generated file containing CDR and price info. +host = localhost # The host to connect to. Values that start with / are for UNIX domain sockets. +port = 5432 # The port to bind to. +db = cgrates # The name of the database to connect to. +user = # The user to sign in as. +password = # The user's password. \ No newline at end of file diff --git a/conf/session_manager.config b/conf/session_manager.config new file mode 100644 index 000000000..bb1f63c30 --- /dev/null +++ b/conf/session_manager.config @@ -0,0 +1,57 @@ +# Rating system designed to be used in VoIP Carriers World +# Copyright (C) 2012 Radu Ioan Fericean +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +[global] +redis_server = 127.0.0.1:6379 #redis address host:port +redis_db = 10 # redis database number + +[rater] +standalone = true # start standalone server (no balancer) +balancer_server = 127.0.0.1:2000 # balancer address host:port +listen_api = 127.0.0.1:1234 # listening address host:port +json = false # use JSON for RPC encoding + +[balancer] +enabled = false +standalone = false # run standalone +listen_rater = 127.0.0.1:2000 # Rater server address +listen_api = 127.0.0.1:2001 # Json RPC server address +web_status_server = 127.0.0.1:8000 # Web server address (for status) +json = false # use JSON for RPC encoding + +[scheduler] +enabled = false +standalone = false # run standalone (no other service) +json = false # use JSON for RPC encoding + +[session_manager] +enabled = false +standalone = false # run standalone +api_server = 127.0.0.1:2000 # balancer address host:port +freeswitch_server = localhost:8021 # freeswitch address host:port +freeswitch_pass = ClueCon # freeswitch address host:port +json = false # use JSON for RPC encoding + +[mediator] +enabled = false +standalone = false # run standalone +cdr_file = Master.csv # Freeswitch Master CSV CDR file. +result_file = out.csv # Generated file containing CDR and price info. +host = localhost # The host to connect to. Values that start with / are for UNIX domain sockets. +port = 5432 # The port to bind to. +db = cgrates # The name of the database to connect to. +user = # The user to sign in as. +password = # The user's password. \ No newline at end of file diff --git a/conf/session_manager_standalone.config b/conf/session_manager_standalone.config new file mode 100644 index 000000000..bb1f63c30 --- /dev/null +++ b/conf/session_manager_standalone.config @@ -0,0 +1,57 @@ +# Rating system designed to be used in VoIP Carriers World +# Copyright (C) 2012 Radu Ioan Fericean +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +[global] +redis_server = 127.0.0.1:6379 #redis address host:port +redis_db = 10 # redis database number + +[rater] +standalone = true # start standalone server (no balancer) +balancer_server = 127.0.0.1:2000 # balancer address host:port +listen_api = 127.0.0.1:1234 # listening address host:port +json = false # use JSON for RPC encoding + +[balancer] +enabled = false +standalone = false # run standalone +listen_rater = 127.0.0.1:2000 # Rater server address +listen_api = 127.0.0.1:2001 # Json RPC server address +web_status_server = 127.0.0.1:8000 # Web server address (for status) +json = false # use JSON for RPC encoding + +[scheduler] +enabled = false +standalone = false # run standalone (no other service) +json = false # use JSON for RPC encoding + +[session_manager] +enabled = false +standalone = false # run standalone +api_server = 127.0.0.1:2000 # balancer address host:port +freeswitch_server = localhost:8021 # freeswitch address host:port +freeswitch_pass = ClueCon # freeswitch address host:port +json = false # use JSON for RPC encoding + +[mediator] +enabled = false +standalone = false # run standalone +cdr_file = Master.csv # Freeswitch Master CSV CDR file. +result_file = out.csv # Generated file containing CDR and price info. +host = localhost # The host to connect to. Values that start with / are for UNIX domain sockets. +port = 5432 # The port to bind to. +db = cgrates # The name of the database to connect to. +user = # The user to sign in as. +password = # The user's password. \ No newline at end of file diff --git a/data/test.config b/data/test.config index 1ab25b476..f4e1cc29a 100644 --- a/data/test.config +++ b/data/test.config @@ -29,6 +29,7 @@ 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) json = true # use JSON for RPC encoding [scheduler]