small cosmetic changes

This commit is contained in:
Radu Ioan Fericean
2016-03-17 09:32:16 +01:00
parent 377b0d5749
commit c39d114bd7
2 changed files with 4 additions and 3 deletions

View File

@@ -554,6 +554,7 @@ func (origCD *CallDescriptor) getMaxSessionDuration(origAcc *Account) (time.Dura
if account.AllowNegative {
return -1, nil
}
// for zero duration index
if origCD.DurationIndex < origCD.TimeEnd.Sub(origCD.TimeStart) {
origCD.DurationIndex = origCD.TimeEnd.Sub(origCD.TimeStart)
}

View File

@@ -145,9 +145,9 @@ func (ris RatingInfos) String() string {
return string(b)
}
func (rp *RatingProfile) GetRatingPlansForPrefix(cd *CallDescriptor) (err error) {
func (rpf *RatingProfile) GetRatingPlansForPrefix(cd *CallDescriptor) (err error) {
var ris RatingInfos
for index, rpa := range rp.RatingPlanActivations.GetActiveForCall(cd) {
for index, rpa := range rpf.RatingPlanActivations.GetActiveForCall(cd) {
rpl, err := ratingStorage.GetRatingPlan(rpa.RatingPlanId, false)
if err != nil || rpl == nil {
utils.Logger.Err(fmt.Sprintf("Error checking destination: %v", err))
@@ -202,7 +202,7 @@ func (rp *RatingProfile) GetRatingPlansForPrefix(cd *CallDescriptor) (err error)
}
if len(prefix) > 0 {
ris = append(ris, &RatingInfo{
MatchedSubject: rp.Id,
MatchedSubject: rpf.Id,
RatingPlanId: rpl.Id,
MatchedPrefix: prefix,
MatchedDestId: destinationId,