mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 16:48:45 +05:00
RadAgent sample config updated with *usage_seconds converter, tests in rsrfield
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
],
|
||||
"reply_fields":[
|
||||
{"tag": "MaxUsage", "field_id": "SIP-AVP", "type": "*composed",
|
||||
"value": "^session_max_time#;~*cgrReply>MaxUsage:s/(\\d*)\\d{9}$/$1/", "mandatory": true},
|
||||
"value": "^session_max_time#;*cgrReply>MaxUsage{*usage_seconds}", "mandatory": true},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2253,7 +2253,6 @@ func (ms *MongoStorage) SetThresholdProfileDrv(tp *ThresholdProfile) (err error)
|
||||
func (ms *MongoStorage) RemThresholdProfileDrv(tenant, id string) (err error) {
|
||||
session, col := ms.conn(colTps)
|
||||
defer session.Close()
|
||||
utils.Logger.Debug(fmt.Sprintf("dbKey %+v", session))
|
||||
err = col.Remove(bson.M{"tenant": tenant, "id": id})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -503,4 +503,15 @@ func TestRSRFldParse(t *testing.T) {
|
||||
} else if out != eOut {
|
||||
t.Errorf("expecting: %s, received: %s", eOut, out)
|
||||
}
|
||||
rulesStr = `Usage{*usage_seconds}`
|
||||
rsrField, err = NewRSRField(rulesStr)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
eOut = "10"
|
||||
if out, err := rsrField.Parse("10000000000"); err != nil {
|
||||
t.Error(err)
|
||||
} else if out != eOut {
|
||||
t.Errorf("expecting: %s, received: %s", eOut, out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user