mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Update AgentV1DisconnectSession api signature
Will accept utils.CGREvent instead of utils.AttrDisconnectSession as a parameter. SessionSv1.ForceDisconnect will take utils.SessionFilterWithEvent as a parameter instead of *utils.SessionFilter. Added possibility to pass DisconnectCause as an Event parameter. The forceSTerminate that's called when the session timer expires will have DisconnectCause 'SESSION_TIMEOUT' instead of 'FORCED_DISCONNECT'. Added Dispatcher methods for AlterSessions. Event will be merged with EventStart of the session before being sent to AgentV1DisconnectSession.
This commit is contained in:
committed by
Dan Christian Bogos
parent
41b9b719d5
commit
ee98dbe0ca
@@ -26,7 +26,7 @@ func init() {
|
||||
c := &CmdSessionsForceDisconnect{
|
||||
name: "session_force_disconnect",
|
||||
rpcMethod: utils.SessionSv1ForceDisconnect,
|
||||
rpcParams: &utils.SessionFilter{},
|
||||
rpcParams: utils.SessionFilterWithEvent{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
@@ -35,7 +35,7 @@ func init() {
|
||||
type CmdSessionsForceDisconnect struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.SessionFilter
|
||||
rpcParams utils.SessionFilterWithEvent
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
@@ -48,8 +48,10 @@ func (cmd *CmdSessionsForceDisconnect) RpcMethod() string {
|
||||
}
|
||||
|
||||
func (cmd *CmdSessionsForceDisconnect) RpcParams(reset bool) any {
|
||||
if reset || cmd.rpcParams == nil {
|
||||
cmd.rpcParams = &utils.SessionFilter{APIOpts: make(map[string]any)}
|
||||
if reset || cmd.rpcParams.SessionFilter == nil {
|
||||
cmd.rpcParams.SessionFilter = &utils.SessionFilter{
|
||||
APIOpts: make(map[string]any),
|
||||
}
|
||||
}
|
||||
return cmd.rpcParams
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user