mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 10:36:24 +05:00
first draft for lcr docs
This commit is contained in:
@@ -676,7 +676,11 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (LCRCost, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// sort by activation time
|
||||
lcr.Sort()
|
||||
|
||||
// find if one ore more entries apply to this cd (create lcr timespans)
|
||||
// create timespans and attach lcr entries to them
|
||||
lcrCost := LCRCost{&LCRTimeSpan{StartTime: cd.TimeStart}}
|
||||
for _, lcrActivation := range lcr.Activations {
|
||||
//log.Printf("Activation: %+v", lcrActivation)
|
||||
|
||||
@@ -183,6 +183,8 @@ func TestLcrGet(t *testing.T) {
|
||||
Subject: "rif",
|
||||
}
|
||||
lcrs, err := cd.GetLCR(nil)
|
||||
//lcr, _ := json.Marshal(lcrs[0])
|
||||
//log.Print("LCR: ", string(lcr))
|
||||
if err != nil || len(lcrs) != 1 {
|
||||
t.Errorf("Bad lcr: %+v, %v", lcrs, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user