mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
fallback on *any destination
This commit is contained in:
@@ -141,6 +141,13 @@ func (rp *RatingProfile) GetRatingPlansForPrefix(cd *CallDescriptor) (err error)
|
||||
break
|
||||
}
|
||||
}
|
||||
if rps == nil { // fallback on *any destination
|
||||
if _, ok := rpl.DestinationRates[utils.ANY]; ok {
|
||||
rps = rpl.RateIntervalList(utils.ANY)
|
||||
prefix = utils.ANY
|
||||
destinationId = utils.ANY
|
||||
}
|
||||
}
|
||||
}
|
||||
// check if it's the first ri and add a blank one for the initial part not covered
|
||||
if index == 0 && cd.TimeStart.Before(rpa.ActivationTime) {
|
||||
|
||||
@@ -27,14 +27,14 @@ import (
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func TestSetStorageSmsChrg1(t *testing.T) {
|
||||
func TestSMSSetStorageSmsChrg1(t *testing.T) {
|
||||
ratingDb, _ = engine.NewMapStorageJson()
|
||||
engine.SetRatingStorage(ratingDb)
|
||||
acntDb, _ = engine.NewMapStorageJson()
|
||||
engine.SetAccountingStorage(acntDb)
|
||||
}
|
||||
|
||||
func TestLoadCsvTpSmsChrg1(t *testing.T) {
|
||||
func TestSMSLoadCsvTpSmsChrg1(t *testing.T) {
|
||||
timings := `ALWAYS,*any,*any,*any,*any,00:00:00`
|
||||
rates := `RT_SMS_5c,0,0.005,1,1,0`
|
||||
destinationRates := `DR_SMS_1,*any,RT_SMS_5c,*up,4`
|
||||
@@ -68,7 +68,7 @@ func TestLoadCsvTpSmsChrg1(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetDataCostSmsChrg1(t *testing.T) {
|
||||
func TestSMSGetDataCostSmsChrg1(t *testing.T) {
|
||||
usageDur := time.Second
|
||||
timeStart := time.Date(2014, 3, 4, 0, 0, 0, 0, time.Local)
|
||||
cd := &engine.CallDescriptor{
|
||||
Reference in New Issue
Block a user