Move populating source after RPC caching

This commit is contained in:
TeoV
2019-07-11 10:05:18 +03:00
committed by Dan Christian Bogos
parent 7e77f1fa35
commit 65b0e0f608

View File

@@ -2550,9 +2550,6 @@ func (sS *SessionS) BiRPCv1ProcessCDR(clnt rpcclient.RpcClientConnection,
if cgrEvWithArgDisp.ID == "" {
cgrEvWithArgDisp.ID = utils.GenUUID()
}
if _, has := cgrEvWithArgDisp.Event[utils.Source]; !has {
cgrEvWithArgDisp.Event[utils.Source] = utils.MetaSessionS
}
// RPC caching
if sS.cgrCfg.CacheCfg()[utils.CacheRPCResponses].Limit != 0 {
@@ -2573,6 +2570,10 @@ func (sS *SessionS) BiRPCv1ProcessCDR(clnt rpcclient.RpcClientConnection,
nil, true, utils.NonTransactional)
}
// end of RPC caching
// in case that source don't exist add it
if _, has := cgrEvWithArgDisp.Event[utils.Source]; !has {
cgrEvWithArgDisp.Event[utils.Source] = utils.MetaSessionS
}
ev := engine.NewSafEvent(cgrEvWithArgDisp.Event)
cgrID := GetSetCGRID(ev)