mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 16:18:44 +05:00
Add posibility to change Tenant from CGREvent with AttributeS for CDRs and ChargerS
This commit is contained in:
committed by
Dan Christian Bogos
parent
e5ed5aea4e
commit
bf10cc1fc5
@@ -334,6 +334,11 @@ func (cdrS *CDRServer) attrSProcessEvent(cgrEv *utils.CGREventWithArgDispatcher)
|
||||
if err = cdrS.attrS.Call(utils.AttributeSv1ProcessEvent,
|
||||
attrArgs, &rplyEv); err == nil && len(rplyEv.AlteredFields) != 0 {
|
||||
*cgrEv.CGREvent = *rplyEv.CGREvent
|
||||
if tntIface, has := cgrEv.CGREvent.Event[utils.MetaTenant]; has {
|
||||
// special case when we want to overwrite the tenant
|
||||
cgrEv.CGREvent.Tenant = tntIface.(string)
|
||||
delete(cgrEv.CGREvent.Event, utils.MetaTenant)
|
||||
}
|
||||
} else if err.Error() == utils.ErrNotFound.Error() {
|
||||
err = nil // cancel ErrNotFound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user