Updated terminate Session API

This commit is contained in:
Trial97
2021-09-08 09:40:57 +03:00
committed by Dan Christian Bogos
parent c777ee70b5
commit 9f12db8401

View File

@@ -2001,9 +2001,9 @@ func (sS *SessionS) BiRPCv1TerminateSession(ctx *context.Context,
nil, true, utils.NonTransactional)
}
// end of RPC caching
attrS := utils.OptAsBool(args.APIOpts, utils.OptsSesAttributeS)
resS := utils.OptAsBool(args.APIOpts, utils.OptsSesResourceSRelease)
termS := utils.OptAsBool(args.APIOpts, utils.OptsSesTerminate)
if !(attrS || termS) {
if !(resS || termS) {
return // nothing to do
}
@@ -2059,7 +2059,7 @@ func (sS *SessionS) BiRPCv1TerminateSession(ctx *context.Context,
return err //utils.NewErrRALs(err)
}
}
if utils.OptAsBool(args.APIOpts, utils.OptsSesResourceSRelease) {
if resS {
if len(sS.cgrCfg.SessionSCfg().ResSConns) == 0 {
return utils.NewErrNotConnected(utils.ResourceS)
}