mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added protection for missing Event in Sessions
This commit is contained in:
committed by
Dan Christian Bogos
parent
d4c35e9905
commit
f33d0b3975
@@ -1885,6 +1885,9 @@ func (sS *SessionS) BiRPCv1AuthorizeEvent(clnt rpcclient.ClientConnector,
|
||||
if args.CGREvent == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.CGREventString)
|
||||
}
|
||||
if args.CGREvent.Event == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.Event)
|
||||
}
|
||||
var withErrors bool
|
||||
if args.CGREvent.ID == utils.EmptyString {
|
||||
args.CGREvent.ID = utils.GenUUID()
|
||||
@@ -2164,6 +2167,9 @@ func (sS *SessionS) BiRPCv1InitiateSession(clnt rpcclient.ClientConnector,
|
||||
if args.CGREvent == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.CGREventString)
|
||||
}
|
||||
if args.CGREvent.Event == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.Event)
|
||||
}
|
||||
var withErrors bool
|
||||
if args.CGREvent.ID == utils.EmptyString {
|
||||
args.CGREvent.ID = utils.GenUUID()
|
||||
@@ -2390,6 +2396,9 @@ func (sS *SessionS) BiRPCv1UpdateSession(clnt rpcclient.ClientConnector,
|
||||
if args.CGREvent == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.CGREventString)
|
||||
}
|
||||
if args.CGREvent.Event == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.Event)
|
||||
}
|
||||
if args.CGREvent.ID == utils.EmptyString {
|
||||
args.CGREvent.ID = utils.GenUUID()
|
||||
}
|
||||
@@ -2525,6 +2534,9 @@ func (sS *SessionS) BiRPCv1TerminateSession(clnt rpcclient.ClientConnector,
|
||||
if args.CGREvent == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.CGREventString)
|
||||
}
|
||||
if args.CGREvent.Event == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.Event)
|
||||
}
|
||||
var withErrors bool
|
||||
if args.CGREvent.ID == utils.EmptyString {
|
||||
args.CGREvent.ID = utils.GenUUID()
|
||||
@@ -2655,6 +2667,9 @@ func (sS *SessionS) BiRPCv1TerminateSession(clnt rpcclient.ClientConnector,
|
||||
// BiRPCv1ProcessCDR sends the CDR to CDRs
|
||||
func (sS *SessionS) BiRPCv1ProcessCDR(clnt rpcclient.ClientConnector,
|
||||
cgrEvWithArgDisp *utils.CGREventWithArgDispatcher, rply *string) (err error) {
|
||||
if cgrEvWithArgDisp.Event == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.Event)
|
||||
}
|
||||
if cgrEvWithArgDisp.ID == utils.EmptyString {
|
||||
cgrEvWithArgDisp.ID = utils.GenUUID()
|
||||
}
|
||||
@@ -2897,6 +2912,9 @@ func (sS *SessionS) BiRPCv1ProcessMessage(clnt rpcclient.ClientConnector,
|
||||
if args.CGREvent == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.CGREventString)
|
||||
}
|
||||
if args.CGREvent.Event == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.Event)
|
||||
}
|
||||
var withErrors bool
|
||||
if args.CGREvent.ID == utils.EmptyString {
|
||||
args.CGREvent.ID = utils.GenUUID()
|
||||
@@ -3078,6 +3096,9 @@ func (sS *SessionS) BiRPCv1ProcessEvent(clnt rpcclient.ClientConnector,
|
||||
if args.CGREvent == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.CGREventString)
|
||||
}
|
||||
if args.CGREvent.Event == nil {
|
||||
return utils.NewErrMandatoryIeMissing(utils.Event)
|
||||
}
|
||||
var withErrors bool
|
||||
if args.CGREvent.ID == utils.EmptyString {
|
||||
args.CGREvent.ID = utils.GenUUID()
|
||||
|
||||
Reference in New Issue
Block a user