diff --git a/engine/ratingprofile.go b/engine/ratingprofile.go index 95468c1f9..3af5202ec 100644 --- a/engine/ratingprofile.go +++ b/engine/ratingprofile.go @@ -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) { diff --git a/general_tests/smschrg1_test_tmp.go b/general_tests/smschrg1_test.go similarity index 95% rename from general_tests/smschrg1_test_tmp.go rename to general_tests/smschrg1_test.go index bcd447173..08f573e09 100644 --- a/general_tests/smschrg1_test_tmp.go +++ b/general_tests/smschrg1_test.go @@ -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{