mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fixed error when there are not sessionIds in case of ActiveSessions
This commit is contained in:
committed by
Dan Christian Bogos
parent
344aec93e8
commit
6e75c2f9fd
@@ -349,6 +349,9 @@ func (sma *AsteriskAgent) V1GetActiveSessionIDs(ignParam string,
|
||||
return err
|
||||
}
|
||||
var sIDs []*sessions.SessionID
|
||||
if len(slMpIface) == 0 {
|
||||
return utils.ErrNoActiveSession
|
||||
}
|
||||
for _, mpIface := range slMpIface {
|
||||
sIDs = append(sIDs, &sessions.SessionID{
|
||||
OriginHost: strings.Split(sma.cgrCfg.AsteriskAgentCfg().AsteriskConns[sma.astConnIdx].Address, ":")[0],
|
||||
|
||||
@@ -432,6 +432,9 @@ func (fsa *FSsessions) V1GetActiveSessionIDs(_ string,
|
||||
})
|
||||
}
|
||||
}
|
||||
if len(sIDs) == 0 {
|
||||
return utils.ErrNoActiveSession
|
||||
}
|
||||
*sessionIDs = sIDs
|
||||
return
|
||||
}
|
||||
|
||||
@@ -421,6 +421,9 @@ func (ka *KamailioAgent) V1GetActiveSessionIDs(ignParam string, sessionIDs *[]*s
|
||||
return errors.New("timeout executing dialog list")
|
||||
}
|
||||
}
|
||||
if len(*sessionIDs) == 0 {
|
||||
return utils.ErrNoActiveSession
|
||||
}
|
||||
tm.Stop()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1356,7 +1356,7 @@ func (sS *SessionS) syncSessions() {
|
||||
}()
|
||||
select {
|
||||
case err = <-errChan:
|
||||
if err != nil {
|
||||
if err != nil && err.Error() != utils.ErrNoActiveSession.Error() {
|
||||
utils.Logger.Warning(
|
||||
fmt.Sprintf("<%s> error <%s> quering session ids", utils.SessionS, err.Error()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user