mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fixed panic on internal cdrs conection to attribute
This commit is contained in:
committed by
Dan Christian Bogos
parent
44e2effbf0
commit
2c081cc372
@@ -99,7 +99,9 @@ func (dS *DispatcherService) authorizeEvent(ev *utils.CGREvent,
|
||||
if dS.attrS == nil {
|
||||
return utils.NewErrNotConnected(utils.AttributeS)
|
||||
}
|
||||
if err = dS.attrS.Call(utils.AttributeSv1ProcessEvent, ev, reply); err != nil {
|
||||
if err = dS.attrS.Call(utils.AttributeSv1ProcessEvent,
|
||||
&engine.AttrArgsProcessEvent{
|
||||
CGREvent: *ev}, reply); err != nil {
|
||||
if err.Error() == utils.ErrNotFound.Error() {
|
||||
err = utils.ErrUnknownApiKey
|
||||
}
|
||||
|
||||
@@ -230,7 +230,9 @@ func (self *CdrServer) deriveRateStoreStatsReplicate(cdr *CDR, store, cdrstats,
|
||||
cgrEv := cdrRun.AsCGREvent()
|
||||
cgrEv.Context = utils.StringPointer(utils.MetaCDRs)
|
||||
if err = self.attrS.Call(utils.AttributeSv1ProcessEvent,
|
||||
cgrEv, &rplyEv); err == nil {
|
||||
&AttrArgsProcessEvent{
|
||||
CGREvent: *cgrEv},
|
||||
&rplyEv); err == nil {
|
||||
if err = cdrRun.UpdateFromCGREvent(rplyEv.CGREvent,
|
||||
rplyEv.AlteredFields); err != nil {
|
||||
return
|
||||
@@ -305,7 +307,8 @@ func (self *CdrServer) deriveCdrs(cdr *CDR) (drvdCDRs []*CDR, err error) {
|
||||
if self.attrS != nil {
|
||||
var rplyEv AttrSProcessEventReply
|
||||
if err = self.attrS.Call(utils.AttributeSv1ProcessEvent,
|
||||
cdr.AsCGREvent(), &rplyEv); err != nil {
|
||||
&AttrArgsProcessEvent{
|
||||
CGREvent: *(cdr.AsCGREvent())}, &rplyEv); err != nil {
|
||||
return
|
||||
}
|
||||
if err = cdr.UpdateFromCGREvent(rplyEv.CGREvent,
|
||||
|
||||
Reference in New Issue
Block a user