mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 16:18:44 +05:00
Add ExtraData in Add/Set/Modify Balance API's fixes #1463
This commit is contained in:
committed by
Dan Christian Bogos
parent
56ccc49527
commit
c5fb456ea9
@@ -166,10 +166,25 @@ func cdrLogAction(acc *Account, a *Action, acs Actions, extraData interface{}) (
|
||||
return
|
||||
}
|
||||
for field, rsr := range template {
|
||||
defaultTemplate[field] = config.NewRSRParsersMustCompile(rsr,
|
||||
true, config.CgrConfig().GeneralCfg().RsrSepatarot)
|
||||
if defaultTemplate[field], err = config.NewRSRParsers(rsr,
|
||||
true, config.CgrConfig().GeneralCfg().RsrSepatarot); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
//In case that we have extra data we populate default templates
|
||||
mapExtraData, _ := extraData.(map[string]interface{})
|
||||
var strVal string
|
||||
for key, val := range mapExtraData {
|
||||
if strVal, err = utils.IfaceAsString(val); err != nil {
|
||||
return
|
||||
}
|
||||
if defaultTemplate[key], err = config.NewRSRParsers(strVal,
|
||||
true, config.CgrConfig().GeneralCfg().RsrSepatarot); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// set stored cdr values
|
||||
var cdrs []*CDR
|
||||
for _, action := range acs {
|
||||
|
||||
Reference in New Issue
Block a user