Propagate SIP_TRUNK_FAILURE (#4890)
This commit is contained in:
@@ -94,6 +94,8 @@ func (s *signalhandler) HandleMessage(msg proto.Message) error {
|
|||||||
reason = types.ParticipantCloseReasonUserRejected
|
reason = types.ParticipantCloseReasonUserRejected
|
||||||
case livekit.DisconnectReason_AGENT_ERROR:
|
case livekit.DisconnectReason_AGENT_ERROR:
|
||||||
reason = types.ParticipantCloseReasonAgentError
|
reason = types.ParticipantCloseReasonAgentError
|
||||||
|
case livekit.DisconnectReason_SIP_TRUNK_FAILURE:
|
||||||
|
reason = types.ParticipantCloseReasonSIPTrunkFailure
|
||||||
}
|
}
|
||||||
s.params.Logger.Debugw("client leaving room", "reason", reason)
|
s.params.Logger.Debugw("client leaving room", "reason", reason)
|
||||||
s.params.Participant.HandleLeaveRequest(reason)
|
s.params.Participant.HandleLeaveRequest(reason)
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ const (
|
|||||||
ParticipantCloseReasonUserRejected
|
ParticipantCloseReasonUserRejected
|
||||||
ParticipantCloseReasonMoveFailed
|
ParticipantCloseReasonMoveFailed
|
||||||
ParticipantCloseReasonAgentError
|
ParticipantCloseReasonAgentError
|
||||||
|
ParticipantCloseReasonSIPTrunkFailure
|
||||||
)
|
)
|
||||||
|
|
||||||
func (p ParticipantCloseReason) String() string {
|
func (p ParticipantCloseReason) String() string {
|
||||||
@@ -182,6 +183,8 @@ func (p ParticipantCloseReason) String() string {
|
|||||||
return "MOVE_FAILED"
|
return "MOVE_FAILED"
|
||||||
case ParticipantCloseReasonAgentError:
|
case ParticipantCloseReasonAgentError:
|
||||||
return "AGENT_ERROR"
|
return "AGENT_ERROR"
|
||||||
|
case ParticipantCloseReasonSIPTrunkFailure:
|
||||||
|
return "SIP_TRUNK_FAILURE"
|
||||||
default:
|
default:
|
||||||
return fmt.Sprintf("%d", int(p))
|
return fmt.Sprintf("%d", int(p))
|
||||||
}
|
}
|
||||||
@@ -221,6 +224,8 @@ func (p ParticipantCloseReason) ToDisconnectReason() livekit.DisconnectReason {
|
|||||||
return livekit.DisconnectReason_USER_REJECTED
|
return livekit.DisconnectReason_USER_REJECTED
|
||||||
case ParticipantCloseReasonAgentError:
|
case ParticipantCloseReasonAgentError:
|
||||||
return livekit.DisconnectReason_AGENT_ERROR
|
return livekit.DisconnectReason_AGENT_ERROR
|
||||||
|
case ParticipantCloseReasonSIPTrunkFailure:
|
||||||
|
return livekit.DisconnectReason_SIP_TRUNK_FAILURE
|
||||||
default:
|
default:
|
||||||
// the other types will map to unknown reason
|
// the other types will map to unknown reason
|
||||||
return livekit.DisconnectReason_UNKNOWN_REASON
|
return livekit.DisconnectReason_UNKNOWN_REASON
|
||||||
@@ -240,7 +245,8 @@ func IsIntentionalDisconnect(reason livekit.DisconnectReason) bool {
|
|||||||
livekit.DisconnectReason_MIGRATION,
|
livekit.DisconnectReason_MIGRATION,
|
||||||
livekit.DisconnectReason_PARTICIPANT_REMOVED,
|
livekit.DisconnectReason_PARTICIPANT_REMOVED,
|
||||||
livekit.DisconnectReason_ROOM_DELETED,
|
livekit.DisconnectReason_ROOM_DELETED,
|
||||||
livekit.DisconnectReason_ROOM_CLOSED:
|
livekit.DisconnectReason_ROOM_CLOSED,
|
||||||
|
livekit.DisconnectReason_SIP_TRUNK_FAILURE:
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user