mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 23:58:44 +05:00
added mediator and session manager to the mix
This commit is contained in:
@@ -192,5 +192,13 @@ func main() {
|
||||
}()
|
||||
}
|
||||
|
||||
if sm_enabled {
|
||||
go startSessionManager()
|
||||
}
|
||||
|
||||
if mediator_enabled {
|
||||
go startMediator()
|
||||
}
|
||||
|
||||
<-exitChan
|
||||
}
|
||||
|
||||
@@ -32,16 +32,6 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
/*var (
|
||||
cdrFile = flag.String("freeswitchcdr", "Master.csv", "Freeswitch Master CSV CDR file.")
|
||||
resultFile = flag.String("resultfile", "out.csv", "Generated file containing CDR and price info.")
|
||||
host = flag.String("host", "localhost", "The host to connect to. Values that start with / are for UNIX domain sockets.")
|
||||
port = flag.String("port", "5432", "The port to bind to.")
|
||||
dbName = flag.String("dbname", "cgrates", "The name of the database to connect to.")
|
||||
user = flag.String("user", "", "The user to sign in as.")
|
||||
password = flag.String("password", "", "The user's password.")
|
||||
)*/
|
||||
|
||||
func readDbRecord(db *sql.DB, searchedUUID string) (cc *timespans.CallCost, timespansText string, err error) {
|
||||
row := db.QueryRow(fmt.Sprintf("SELECT * FROM callcosts WHERE uuid='%s'", searchedUUID))
|
||||
var uuid string
|
||||
@@ -50,7 +40,7 @@ func readDbRecord(db *sql.DB, searchedUUID string) (cc *timespans.CallCost, time
|
||||
return
|
||||
}
|
||||
|
||||
func maina() {
|
||||
func startMediator() {
|
||||
flag.Parse()
|
||||
useDB := true
|
||||
file, err := os.Open(mediator_cdr_file)
|
||||
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
"net/rpc/jsonrpc"
|
||||
)
|
||||
|
||||
func mainc() {
|
||||
func startSessionManager() {
|
||||
flag.Parse()
|
||||
sm := &sessionmanager.FSSessionManager{}
|
||||
getter, err := timespans.NewRedisStorage(redis_server, redis_db)
|
||||
@@ -49,7 +49,4 @@ func mainc() {
|
||||
}
|
||||
sm.Connect(sessionmanager.NewRPCClientSessionDelegate(client), sm_freeswitch_server, sm_freeswitch_pass)
|
||||
}
|
||||
waitChan := make(<-chan byte)
|
||||
log.Print("CGRateS is listening!")
|
||||
<-waitChan
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user