diff --git a/apier/v1/lcr.go b/apier/v1/lcr.go index a5beb1e9b..1f73fac8b 100644 --- a/apier/v1/lcr.go +++ b/apier/v1/lcr.go @@ -32,7 +32,7 @@ func (self *ApierV1) GetLcr(lcrReq engine.LcrRequest, lcrReply *engine.LcrReply) return err } var lcrQried engine.LCRCost - if err := self.Responder.GetLCR(cd, &lcrQried); err != nil { + if err := self.Responder.GetLCR(&engine.AttrGetLcr{CallDescriptor: cd, Paginator: lcrReq.Paginator}, &lcrQried); err != nil { return utils.NewErrServerError(err) } if lcrQried.Entry == nil { @@ -62,7 +62,7 @@ func (self *ApierV1) GetLcrSuppliers(lcrReq engine.LcrRequest, suppliers *string return err } var lcrQried engine.LCRCost - if err := self.Responder.GetLCR(cd, &lcrQried); err != nil { + if err := self.Responder.GetLCR(&engine.AttrGetLcr{CallDescriptor: cd, Paginator: lcrReq.Paginator}, &lcrQried); err != nil { return utils.NewErrServerError(err) } if lcrQried.HasErrors() { diff --git a/console/command_executer.go b/console/command_executer.go index 97620f3bb..bf836da45 100644 --- a/console/command_executer.go +++ b/console/command_executer.go @@ -67,8 +67,17 @@ func (ce *CommandExecuter) clientArgs(iface interface{}) (args []string) { for i := 0; i < typ.NumField(); i++ { valField := val.Field(i) typeField := typ.Field(i) + //log.Printf("%v (%v)", typeField.Name, valField.Kind()) switch valField.Kind() { - case reflect.Struct: + case reflect.Ptr, reflect.Struct: + if valField.Kind() == reflect.Ptr { + valField = reflect.New(valField.Type().Elem()).Elem() + if valField.Kind() != reflect.Struct { + //log.Printf("Here: %v (%v)", typeField.Name, valField.Kind()) + args = append(args, typeField.Name) + continue + } + } args = append(args, ce.clientArgs(valField.Interface())...) default: args = append(args, typeField.Name) diff --git a/console/lcr.go b/console/lcr.go index 711bcc9ef..cd93043d3 100644 --- a/console/lcr.go +++ b/console/lcr.go @@ -20,13 +20,14 @@ package console import ( "github.com/cgrates/cgrates/engine" + "github.com/cgrates/cgrates/utils" ) func init() { c := &CmdGetLcr{ name: "lcr", rpcMethod: "ApierV1.GetLcr", - rpcParams: &engine.LcrRequest{}, + rpcParams: &engine.LcrRequest{Paginator: &utils.Paginator{}}, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} @@ -50,7 +51,7 @@ func (self *CmdGetLcr) RpcMethod() string { func (self *CmdGetLcr) RpcParams(reset bool) interface{} { if reset || self.rpcParams == nil { - self.rpcParams = &engine.LcrRequest{} + self.rpcParams = &engine.LcrRequest{Paginator: &utils.Paginator{}} } return self.rpcParams } diff --git a/data/tariffplans/tutorial/LcrRules.csv b/data/tariffplans/tutorial/LcrRules.csv index d4a3502ba..9898a0642 100644 --- a/data/tariffplans/tutorial/LcrRules.csv +++ b/data/tariffplans/tutorial/LcrRules.csv @@ -5,5 +5,7 @@ *out,cgrates.org,call,1002,*any,*any,lcr_profile1,*qos,,2014-01-14T00:00:00Z,10 *out,cgrates.org,call,1003,*any,DST_1002,lcr_profile1,*qos_threshold,20;;;;2m;;;;;;;,2014-01-14T00:00:00Z,10 *out,cgrates.org,call,1003,*any,*any,lcr_profile1,*qos_threshold,40;;;;90s;;;;;;;,2014-01-14T00:00:00Z,10 +*out,cgrates.org,call,1004,*any,DST_1002,lcr_profile1,*load_distribution,supplier1:5;supplier2:3;*default:1,2014-01-14T00:00:00Z,10 +*out,cgrates.org,call,1004,*any,*any,lcr_profile1,*load_distribution,,2014-01-14T00:00:00Z,10 *out,cgrates.org,call,*any,*any,DST_1002,lcr_profile2,*lowest_cost,,2014-01-14T00:00:00Z,10 *out,cgrates.org,call,*any,*any,*any,lcr_profile1,*lowest_cost,,2014-01-14T00:00:00Z,10 \ No newline at end of file diff --git a/engine/action.go b/engine/action.go index 8a6355728..0f44c9404 100644 --- a/engine/action.go +++ b/engine/action.go @@ -486,7 +486,7 @@ func mailAsync(ub *Account, sq *StatsQueueTriggered, a *Action, acs Actions) err message = []byte(fmt.Sprintf("To: %s\r\nSubject: [CGR Notification] Threshold hit on Balance: %s\r\n\r\nTime: \r\n\t%s\r\n\r\nBalance:\r\n\t%s\r\n\r\nYours faithfully,\r\nCGR Balance Monitor\r\n", toAddrStr, ub.Id, time.Now(), balJsn)) } else if sq != nil { message = []byte(fmt.Sprintf("To: %s\r\nSubject: [CGR Notification] Threshold hit on StatsQueueId: %s\r\n\r\nTime: \r\n\t%s\r\n\r\nStatsQueueId:\r\n\t%s\r\n\r\nMetrics:\r\n\t%+v\r\n\r\nTrigger:\r\n\t%+v\r\n\r\nYours faithfully,\r\nCGR CDR Stats Monitor\r\n", - toAddrStr, sq.Id, time.Now(), sq.Id, sq.metrics, sq.Trigger)) + toAddrStr, sq.Id, time.Now(), sq.Id, sq.Metrics, sq.Trigger)) } auth := smtp.PlainAuth("", cgrCfg.MailerAuthUser, cgrCfg.MailerAuthPass, strings.Split(cgrCfg.MailerServer, ":")[0]) // We only need host part, so ignore port go func() { diff --git a/engine/calldesc.go b/engine/calldesc.go index b73d46410..a7d788515 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -348,22 +348,6 @@ func (cd *CallDescriptor) splitInTimeSpans() (timespans []*TimeSpan) { } } } - // split on days - /*for i := 0; i < len(timespans); i++ { - if timespans[i].TimeStart.Day() != timespans[i].TimeEnd.Day() { - //log.Print("TS: ", timespans[i].TimeStart, timespans[i].TimeEnd) - start := timespans[i].TimeStart - newTs := timespans[i].SplitByTime(time.Date(start.Year(), start.Month(), start.Day(), 0, 0, 0, 0, start.Location()).Add(24 * time.Hour)) - if newTs != nil { - //log.Print("NEW TS: ", newTs.TimeStart, newTs.TimeEnd) - // insert the new timespan - index := i + 1 - timespans = append(timespans, nil) - copy(timespans[index+1:], timespans[index:]) - timespans[index] = newTs - } - } - }*/ // Logger.Debug(fmt.Sprintf("After SplitByRatingPlan: %+v", timespans)) // split on rate intervals for i := 0; i < len(timespans); i++ { @@ -795,7 +779,7 @@ func (cd *CallDescriptor) GetLCRFromStorage() (*LCR, error) { return nil, utils.ErrNotFound } -func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { +func (cd *CallDescriptor) GetLCR(stats StatsInterface, p *utils.Paginator) (*LCRCost, error) { cd.account = nil // make sure it's not cached lcr, err := cd.GetLCRFromStorage() if err != nil { @@ -831,12 +815,13 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { lcrCD.Account = supplier lcrCD.Subject = supplier lcrCD.Category = lcrCost.Entry.RPCategory + fullSupplier := utils.ConcatenatedKey(lcrCD.Direction, lcrCD.Tenant, lcrCD.Category, lcrCD.Subject) var cc *CallCost var err error if cd.account, err = accountingStorage.GetAccount(lcrCD.GetAccountKey()); err == nil { if cd.account.Disabled { lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, Error: fmt.Sprintf("supplier %s is disabled", supplier), }) continue @@ -846,16 +831,15 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { cc, err = lcrCD.GetCost() } - supplier = utils.ConcatenatedKey(lcrCD.Direction, lcrCD.Tenant, lcrCD.Category, lcrCD.Subject) //log.Printf("CC: %+v", cc.Timespans[0].ratingInfo.RateIntervals[0].Rating.Rates[0]) if err != nil || cc == nil { lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, Error: err.Error(), }) } else { lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, Cost: cc.Cost, Duration: cc.GetDuration(), }) @@ -878,6 +862,7 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { lcrCD.Category = category lcrCD.Account = supplier lcrCD.Subject = supplier + fullSupplier := utils.ConcatenatedKey(lcrCD.Direction, lcrCD.Tenant, lcrCD.Category, lcrCD.Subject) var qosSortParams []string var asrValues sort.Float64Slice var pddValues sort.Float64Slice @@ -897,7 +882,7 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { if utils.IsSliceMember([]string{LCR_STRATEGY_QOS, LCR_STRATEGY_QOS_THRESHOLD, LCR_STRATEGY_LOAD}, lcrCost.Entry.Strategy) { if stats == nil { lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, Error: fmt.Sprintf("Cdr stats service not configured"), }) continue @@ -905,7 +890,7 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { rpfKey := utils.ConcatenatedKey(ratingProfileSearchKey, supplier) if rpf, err := ratingStorage.GetRatingProfile(rpfKey, false); err != nil { lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, Error: fmt.Sprintf("Rating plan error: %s", err.Error()), }) continue @@ -937,7 +922,7 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { statValues := make(map[string]float64) if err := stats.GetValues(qId, &statValues); err != nil { lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, Error: fmt.Sprintf("Get stats values for queue id %s, error %s", qId, err.Error()), }) statsErr = true @@ -991,7 +976,7 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { if lcrCost.Entry.Strategy == LCR_STRATEGY_LOAD { if len(supplierQueues) > 0 { lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, supplierQueues: supplierQueues, }) } @@ -1071,7 +1056,7 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { //log.Print("ACCCOUNT") if cd.account.Disabled { lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, Error: fmt.Sprintf("supplier %s is disabled", supplier), }) continue @@ -1082,16 +1067,15 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { cc, err = lcrCD.GetCost() } //log.Printf("CC: %+v", cc) - supplier = utils.ConcatenatedKey(lcrCD.Direction, lcrCD.Tenant, lcrCD.Category, lcrCD.Subject) if err != nil || cc == nil { lcrCost.SupplierCosts = append(lcrCost.SupplierCosts, &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, Error: err.Error(), }) continue } else { supplCost := &LCRSupplierCost{ - Supplier: supplier, + Supplier: fullSupplier, Cost: cc.Cost, Duration: cc.GetDuration(), } @@ -1127,5 +1111,13 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (*LCRCost, error) { // sort according to strategy lcrCost.Sort() } + if p != nil { + if p.Offset != nil && *p.Offset > 0 && *p.Offset < len(lcrCost.SupplierCosts) { + lcrCost.SupplierCosts = lcrCost.SupplierCosts[*p.Offset:] + } + if p.Limit != nil && *p.Limit > 0 && *p.Limit < len(lcrCost.SupplierCosts) { + lcrCost.SupplierCosts = lcrCost.SupplierCosts[:*p.Limit] + } + } return lcrCost, nil } diff --git a/engine/lcr.go b/engine/lcr.go index 70099aa22..192635584 100644 --- a/engine/lcr.go +++ b/engine/lcr.go @@ -56,6 +56,7 @@ type LcrRequest struct { Destination string StartTime string Duration string + *utils.Paginator } func (self *LcrRequest) AsCallDescriptor() (*CallDescriptor, error) { diff --git a/engine/lcr_test.go b/engine/lcr_test.go index 93fb2c6d4..1bd083d87 100644 --- a/engine/lcr_test.go +++ b/engine/lcr_test.go @@ -204,7 +204,7 @@ func TestLcrGet(t *testing.T) { Account: "rif", Subject: "rif", } - lcr, err := cd.GetLCR(nil) + lcr, err := cd.GetLCR(nil, nil) //jsn, _ := json.Marshal(lcr) //log.Print("LCR: ", string(jsn)) if err != nil || lcr == nil { diff --git a/engine/responder.go b/engine/responder.go index 88a4b1688..839e1c466 100644 --- a/engine/responder.go +++ b/engine/responder.go @@ -40,6 +40,11 @@ type SessionRun struct { CallCosts []*CallCost } +type AttrGetLcr struct { + *CallDescriptor + *utils.Paginator +} + type Responder struct { Bal *balancer2go.Balancer ExitChan chan bool @@ -325,20 +330,25 @@ func (rs *Responder) LogCallCost(ccl *CallCostLog, reply *string) error { return nil } -func (rs *Responder) GetLCR(cd *CallDescriptor, reply *LCRCost) error { - if cd.Subject == "" { - cd.Subject = cd.Account +func (rs *Responder) GetLCR(attrs *AttrGetLcr, reply *LCRCost) error { + if attrs.CallDescriptor.Subject == "" { + attrs.CallDescriptor.Subject = attrs.CallDescriptor.Account } - if upData, err := LoadUserProfile(cd, "ExtraFields"); err != nil { + if upData, err := LoadUserProfile(attrs.CallDescriptor, "ExtraFields"); err != nil { return err } else { udRcv := upData.(*CallDescriptor) - *cd = *udRcv + *attrs.CallDescriptor = *udRcv } - lcrCost, err := cd.GetLCR(rs.Stats) + lcrCost, err := attrs.CallDescriptor.GetLCR(rs.Stats, attrs.Paginator) if err != nil { return err } + if lcrCost.Entry.Strategy == LCR_STRATEGY_LOAD { + for _, suppl := range lcrCost.SupplierCosts { + suppl.Cost = -1 // In case of load distribution we don't calculate costs + } + } *reply = *lcrCost return nil } @@ -505,7 +515,7 @@ type Connector interface { GetSessionRuns(*StoredCdr, *[]*SessionRun) error ProcessCdr(*StoredCdr, *string) error LogCallCost(*CallCostLog, *string) error - GetLCR(*CallDescriptor, *LCRCost) error + GetLCR(*AttrGetLcr, *LCRCost) error } type RPCClientConnector struct { @@ -552,6 +562,6 @@ func (rcc *RPCClientConnector) LogCallCost(ccl *CallCostLog, reply *string) erro return rcc.Client.Call("CDRSV1.LogCallCost", ccl, reply) } -func (rcc *RPCClientConnector) GetLCR(cd *CallDescriptor, reply *LCRCost) error { - return rcc.Client.Call("Responder.GetLCR", cd, reply) +func (rcc *RPCClientConnector) GetLCR(attrs *AttrGetLcr, reply *LCRCost) error { + return rcc.Client.Call("Responder.GetLCR", attrs, reply) } diff --git a/engine/responder_test.go b/engine/responder_test.go index 68d5054a7..9938431bd 100644 --- a/engine/responder_test.go +++ b/engine/responder_test.go @@ -395,7 +395,7 @@ func TestGetLCR(t *testing.T) { }, } var lcr LCRCost - if err := rsponder.GetLCR(cdStatic, &lcr); err != nil { + if err := rsponder.GetLCR(&AttrGetLcr{CallDescriptor: cdStatic}, &lcr); err != nil { t.Error(err) } else if !reflect.DeepEqual(eStLcr.Entry, lcr.Entry) { t.Errorf("Expecting: %+v, received: %+v", eStLcr.Entry, lcr.Entry) @@ -422,7 +422,7 @@ func TestGetLCR(t *testing.T) { }, } var lcrLc LCRCost - if err := rsponder.GetLCR(cdLowestCost, &lcrLc); err != nil { + if err := rsponder.GetLCR(&AttrGetLcr{CallDescriptor: cdLowestCost}, &lcrLc); err != nil { t.Error(err) } else if !reflect.DeepEqual(eLcLcr.Entry, lcrLc.Entry) { t.Errorf("Expecting: %+v, received: %+v", eLcLcr.Entry, lcrLc.Entry) @@ -447,7 +447,7 @@ func TestGetLCR(t *testing.T) { &LCRSupplierCost{Supplier: "*out:tenant12:call:dan12", Cost: 0.6, Duration: 60 * time.Second}, }, } - if err := rsponder.GetLCR(cdLowestCost, &lcrLc); err != nil { + if err := rsponder.GetLCR(&AttrGetLcr{CallDescriptor: cdLowestCost}, &lcrLc); err != nil { t.Error(err) } else if !reflect.DeepEqual(eLcLcr.Entry, lcrLc.Entry) { t.Errorf("Expecting: %+v, received: %+v", eLcLcr.Entry, lcrLc.Entry) @@ -476,7 +476,7 @@ func TestGetLCR(t *testing.T) { }, } var lcrQT LCRCost - if err := rsponder.GetLCR(cdQosThreshold, &lcrQT); err != nil { + if err := rsponder.GetLCR(&AttrGetLcr{CallDescriptor: cdQosThreshold}, &lcrQT); err != nil { t.Error(err) } else if !reflect.DeepEqual(eQTLcr.Entry, lcrQT.Entry) { t.Errorf("Expecting: %+v, received: %+v", eQTLcr.Entry, lcrQT.Entry) @@ -495,7 +495,7 @@ func TestGetLCR(t *testing.T) { &LCRSupplierCost{Supplier: "*out:tenant12:call:dan12", Cost: 0.6, Duration: 60 * time.Second, QOS: map[string]float64{PDD: -1, ACD: 300, TCD: 300, ASR: 100, ACC: 2, TCC: 2, DDC: 2}, qosSortParams: []string{"35", "4m"}}, }, } - if err := rsponder.GetLCR(cdQosThreshold, &lcrQT); err != nil { + if err := rsponder.GetLCR(&AttrGetLcr{CallDescriptor: cdQosThreshold}, &lcrQT); err != nil { t.Error(err) } else if !reflect.DeepEqual(eQTLcr.Entry, lcrQT.Entry) { t.Errorf("Expecting: %+v, received: %+v", eQTLcr.Entry, lcrQT.Entry) @@ -524,7 +524,7 @@ func TestGetLCR(t *testing.T) { }, } var lcrQ LCRCost - if err := rsponder.GetLCR(cdQos, &lcrQ); err != nil { + if err := rsponder.GetLCR(&AttrGetLcr{CallDescriptor: cdQos}, &lcrQ); err != nil { t.Error(err) } else if !reflect.DeepEqual(eQosLcr.Entry, lcrQ.Entry) { t.Errorf("Expecting: %+v, received: %+v", eQosLcr.Entry, lcrQ.Entry) diff --git a/engine/stats_queue.go b/engine/stats_queue.go index f7c189f6b..1f328da2e 100644 --- a/engine/stats_queue.go +++ b/engine/stats_queue.go @@ -215,12 +215,12 @@ func (sq *StatsQueue) GetId() string { // Convert data into a struct which can be used in actions based on triggers hit func (sq *StatsQueue) Triggered(at *ActionTrigger) *StatsQueueTriggered { - return &StatsQueueTriggered{Id: sq.conf.Id, metrics: sq.getStats(), Trigger: at} + return &StatsQueueTriggered{Id: sq.conf.Id, Metrics: sq.getStats(), Trigger: at} } // Struct to be passed to triggered actions type StatsQueueTriggered struct { Id string // StatsQueueId - metrics map[string]float64 + Metrics map[string]float64 Trigger *ActionTrigger } diff --git a/engine/timespans.go b/engine/timespans.go index a4197f9ec..efbb079cc 100644 --- a/engine/timespans.go +++ b/engine/timespans.go @@ -416,22 +416,6 @@ func (ts *TimeSpan) SplitByRateInterval(i *RateInterval, data bool) (nts *TimeSp return } -/*func (ts *TimeSpan) SplitByTime(splitTime time.Time) (nts *TimeSpan) { - if splitTime.Equal(ts.TimeEnd) { - return - } - nts = &TimeSpan{ - TimeStart: splitTime, - TimeEnd: ts.TimeEnd, - } - nts.copyRatingInfo(ts) - ts.TimeEnd = splitTime - nts.SetRateInterval(ts.RateInterval) - nts.DurationIndex = ts.DurationIndex - ts.SetNewDurationIndex(nts) - return -}*/ - // Split the timespan at the given increment start func (ts *TimeSpan) SplitByIncrement(index int) *TimeSpan { if index <= 0 || index >= len(ts.Increments) { diff --git a/sessionmanager/fssessionmanager.go b/sessionmanager/fssessionmanager.go index 913cc0ab7..321cc9574 100644 --- a/sessionmanager/fssessionmanager.go +++ b/sessionmanager/fssessionmanager.go @@ -193,7 +193,7 @@ func (sm *FSSessionManager) setCgrLcr(ev engine.Event, connId string) error { TimeStart: startTime, TimeEnd: startTime.Add(config.CgrConfig().MaxCallDuration), } - if err := sm.rater.GetLCR(cd, &lcrCost); err != nil { + if err := sm.rater.GetLCR(&engine.AttrGetLcr{CallDescriptor: cd}, &lcrCost); err != nil { return err } supps := []string{} @@ -238,7 +238,7 @@ func (sm *FSSessionManager) onChannelPark(ev engine.Event, connId string) { return } var lcr engine.LCRCost - if err = sm.Rater().GetLCR(cd, &lcr); err != nil { + if err = sm.Rater().GetLCR(&engine.AttrGetLcr{CallDescriptor: cd}, &lcr); err != nil { engine.Logger.Info(fmt.Sprintf(" LCR_API_ERROR: %s", err.Error())) sm.unparkCall(ev.GetUUID(), connId, ev.GetCallDestNr(utils.META_DEFAULT), SYSTEM_ERROR) } diff --git a/sessionmanager/kamailiosm.go b/sessionmanager/kamailiosm.go index e511134d6..cc86f9c31 100644 --- a/sessionmanager/kamailiosm.go +++ b/sessionmanager/kamailiosm.go @@ -106,7 +106,7 @@ func (self *KamailioSessionManager) getSuppliers(kev KamEvent) (string, error) { return "", errors.New("LCR_PREPROCESS_ERROR") } var lcr engine.LCRCost - if err = self.Rater().GetLCR(cd, &lcr); err != nil { + if err = self.Rater().GetLCR(&engine.AttrGetLcr{CallDescriptor: cd}, &lcr); err != nil { engine.Logger.Info(fmt.Sprintf(" LCR_API_ERROR error: %s", err.Error())) return "", errors.New("LCR_API_ERROR") } diff --git a/sessionmanager/session_test.go b/sessionmanager/session_test.go index d982f9a13..954f36bb0 100644 --- a/sessionmanager/session_test.go +++ b/sessionmanager/session_test.go @@ -99,7 +99,7 @@ func (mc *MockConnector) GetDerivedMaxSessionTime(*engine.StoredCdr, *float64) e func (mc *MockConnector) GetSessionRuns(*engine.StoredCdr, *[]*engine.SessionRun) error { return nil } func (mc *MockConnector) ProcessCdr(*engine.StoredCdr, *string) error { return nil } func (mc *MockConnector) LogCallCost(*engine.CallCostLog, *string) error { return nil } -func (mc *MockConnector) GetLCR(*engine.CallDescriptor, *engine.LCRCost) error { return nil } +func (mc *MockConnector) GetLCR(*engine.AttrGetLcr, *engine.LCRCost) error { return nil } func TestSessionRefund(t *testing.T) { mc := &MockConnector{}