Changing OUT-> *out everywhere, tests fscdr

This commit is contained in:
DanB
2013-08-04 13:17:55 +02:00
parent 80e5fa7403
commit d1fd3e4e09
12 changed files with 79 additions and 20 deletions

View File

@@ -115,13 +115,14 @@ func (fsCdr FSCdr) GetFallbackSubj() string {
return cfg.DefaultSubject
}
func (fsCdr FSCdr) GetAnswerTime() (t time.Time, err error) {
st, err := strconv.ParseInt(fsCdr[FS_ANSWER_TIME], 0, 64)
t = time.Unix(0, st*1000)
//ToDo: Make sure we work with UTC instead of local time
at, err := strconv.ParseInt(fsCdr[FS_ANSWER_TIME], 0, 64)
t = time.Unix(at, 0)
return
}
func (fsCdr FSCdr) GetHangupTime() (t time.Time, err error) {
st, err := strconv.ParseInt(fsCdr[FS_HANGUP_TIME], 0, 64)
t = time.Unix(0, st*1000)
hupt, err := strconv.ParseInt(fsCdr[FS_HANGUP_TIME], 0, 64)
t = time.Unix(hupt, 0)
return
}

File diff suppressed because one or more lines are too long

View File

@@ -42,7 +42,7 @@ func main() {
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 := engine.CallDescriptor{Direction: "OUT", TOR: "0", Tenant: "vdf", Subject: "rif", Destination: "0256", TimeStart: t1, TimeEnd: t2}
cd := engine.CallDescriptor{Direction: "*out", TOR: "0", Tenant: "vdf", Subject: "rif", Destination: "0256", TimeStart: t1, TimeEnd: t2}
result := engine.CallCost{}
var client *rpc.Client
var err error

View File

@@ -43,7 +43,7 @@ class JSONClient(object):
rpc =JSONClient(("127.0.0.1", 2012))
cd = {"Direction":"OUT", "TOR":"0", "Tenant": "vdf", "Subject": "rif", "DestinationPrefix": "0256", "TimeStart": "2012-02-02T17:30:00Z", "TimeEnd": "2012-02-02T18:30:00Z"}
cd = {"Direction":"*out", "TOR":"0", "Tenant": "vdf", "Subject": "rif", "DestinationPrefix": "0256", "TimeStart": "2012-02-02T17:30:00Z", "TimeEnd": "2012-02-02T18:30:00Z"}
# alternative to the above
s = socket.create_connection(("127.0.0.1", 2012))

View File

@@ -57,7 +57,7 @@ func main() {
}
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 := engine.CallDescriptor{Direction: "OUT", TOR: "0", Tenant: "vdf", Subject: "rif", Destination: "0256", TimeStart: t1, TimeEnd: t2}
cd := engine.CallDescriptor{Direction: "*out", TOR: "0", Tenant: "vdf", Subject: "rif", Destination: "0256", TimeStart: t1, TimeEnd: t2}
getter, err := engine.NewRedisStorage("localhost:6379", 10, "")
//getter, err := engine.NewMongoStorage("localhost", "cgrates")

View File

@@ -26,7 +26,7 @@ func (self *CmdGetBalance) Usage(name string) string {
// set param defaults
func (self *CmdGetBalance) defaults() error {
self.rpcMethod = "Responder.GetMonetary"
self.rpcParams = &engine.CallDescriptor{Direction: "OUT"}
self.rpcParams = &engine.CallDescriptor{Direction: "*out"}
return nil
}

View File

@@ -32,7 +32,7 @@ Creates a new AccountActions profile within a tariff plan.
"AccountActionsId": "AA_SAMPLE_2",
"ActionTimingsId": "SAMPLE_AT_1",
"ActionTriggersId": "SAMPLE_ATRS_1",
"Direction": "OUT",
"Direction": "*out",
"TPid": "SAMPLE_TP_1",
"Tenant": "TENANT1"
}
@@ -124,7 +124,7 @@ Queries specific AccountActions profile on tariff plan.
"AccountActionsId": "AA_SAMPLE_2",
"ActionTimingsId": "SAMPLE_AT_1",
"ActionTriggersId": "SAMPLE_ATRS_1",
"Direction": "OUT",
"Direction": "*out",
"TPid": "SAMPLE_TP_1",
"Tenant": "TENANT1"
}

View File

@@ -38,9 +38,9 @@ Creates a new ActionTriggers profile within a tariff plan.
"ActionTriggers": [
{
"ActionsId": "ACTION_1",
"BalanceType": "MONETARY",
"BalanceType": "*monetary",
"DestinationId": "",
"Direction": "OUT",
"Direction": "*out",
"ThresholdType": "MIN_BALANCE",
"ThresholdValue": 5,
"Weight": 10

View File

@@ -13,7 +13,7 @@ Creates a new RatingProfile within a tariff plan.
RatingProfileId string // RatingProfile id
Tenant string // Tenant's Id
TOR string // TypeOfRecord
Direction string // Traffic direction, OUT is the only one supported for now
Direction string // Traffic direction, *out is the only one supported for now
Subject string // Rating subject, usually the same as account
RatesFallbackSubject string // Fallback on this subject if rates not found for destination
RatingActivations []RatingActivation // Activate rate profiles at specific time
@@ -34,7 +34,7 @@ Creates a new RatingProfile within a tariff plan.
"method": "Apier.SetTPRatingProfile",
"params": [
{
"Direction": "OUT",
"Direction": "*out",
"RatingProfileId": "SAMPLE_RP_2",
"RatingActivations": [
{
@@ -123,7 +123,7 @@ Queries specific RatingProfile on tariff plan.
RatingProfileId string // RatingProfile id
Tenant string // Tenant's Id
TOR string // TypeOfRecord
Direction string // Traffic direction, OUT is the only one supported for now
Direction string // Traffic direction, *out is the only one supported for now
Subject string // Rating subject, usually the same as account
RatesFallbackSubject string // Fallback on this subject if rates not found for destination
RatingActivations []RatingActivation // Activate rate profiles at specific time
@@ -141,7 +141,7 @@ Queries specific RatingProfile on tariff plan.
"error": null,
"id": 0,
"result": {
"Direction": "OUT",
"Direction": "*out",
"RatingProfileId": "SAMPLE_RP_2",
"RatesFallbackSubject": "",
"RatingActivations": [

View File

@@ -60,7 +60,7 @@ func (self *FScsvCDR) GetCdrHost() string {
}
func (self *FScsvCDR) GetDirection() string {
return "OUT"
return "*out"
}
func (self *FScsvCDR) GetOrigId() string {

View File

@@ -183,7 +183,7 @@ func (self *Mediator) getCostsFromRater(cdr utils.CDR) (*engine.CallCost, error)
return nil, err
}
cd := engine.CallDescriptor{
Direction: "OUT", //record[m.directionFields[runIdx]] TODO: fix me
Direction: "*out", //record[m.directionFields[runIdx]] TODO: fix me
Tenant: cdr.GetTenant(),
TOR: cdr.GetTOR(),
Subject: cdr.GetSubject(),

View File

@@ -80,6 +80,7 @@ func (fsev FSEvent) GetName() string {
}
func (fsev FSEvent) GetDirection() string {
//TODO: implement direction
fmt.Println("Returning direction *out")
return "*out"
//return fsev[DIRECTION]
}