started command line tool

This commit is contained in:
Radu Ioan Fericean
2012-03-28 13:08:57 +03:00
parent 595a631310
commit 5546ae2521

29
cmd/cgrates/cgrates.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"flag"
"github.com/rif/cgrates/timespans"
"log"
"net/rpc/jsonrpc"
"time"
)
var (
balancer = flag.String("balancer", "127.0.0.1:2001", "balancer address host:port")
)
func main(){
flag.Parse()
t1 := time.Date(2012, time.February, 02, 17, 30, 0, 0, time.UTC)
t2 := time.Date(2012, time.February, 02, 18, 30, 0, 0, time.UTC)
cd := timespans.CallDescriptor{CstmId: "vdf", Subject: "rif", DestinationPrefix: "0256", TimeStart: t1, TimeEnd: t2}
result := timespans.CallCost{}
client, _ := jsonrpc.Dial("tcp", "localhost:2001")
client.Call("Responder.GetCost", cd, &result)
log.Println(result)
client.Close()
log.Print("done!")
}