✨ feat(im): 振铃超时 Job 单人粒度标 NO_ANSWER + 独立 NO_ANSWER 信令推送
✨ feat(im): 处理 RTC_CALL(NO_ANSWER) 信令;私聊气泡显示「未接听」
im
parent
12a41da241
commit
f58d1d88c8
|
|
@ -337,6 +337,13 @@ export const useRtcStore = defineStore('imRtc', () => {
|
|||
}
|
||||
}
|
||||
|
||||
/** 群通话单人振铃超时;对 banner 的处理与拒接一致(语义独立、实现共享) */
|
||||
function applyParticipantNoAnswer(
|
||||
payload: Pick<ImRtcCallNotification, 'room' | 'conversationType' | 'groupId' | 'operatorUserId'>
|
||||
) {
|
||||
applyParticipantRejected(payload)
|
||||
}
|
||||
|
||||
/** 从指定群活跃通话的 joined / pending 列表里同步移除某用户;用于 disconnect / reject 让胶囊条不再展示 */
|
||||
function dropFromGroupActiveCall(groupId: number, room: string, userId: number) {
|
||||
const existing = groupActiveCalls.value.get(groupId)
|
||||
|
|
@ -377,6 +384,7 @@ export const useRtcStore = defineStore('imRtc', () => {
|
|||
getGroupCall,
|
||||
applyParticipantConnected,
|
||||
applyParticipantDisconnected,
|
||||
applyParticipantRejected
|
||||
applyParticipantRejected,
|
||||
applyParticipantNoAnswer
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -743,10 +743,13 @@ export const useImWebSocketStore = defineStore('imWebSocketStore', {
|
|||
case ImRtcParticipantStatus.REJECTED:
|
||||
rtcStore.applyParticipantRejected(payload)
|
||||
break
|
||||
case ImRtcParticipantStatus.JOINED:
|
||||
case ImRtcParticipantStatus.NO_ANSWER:
|
||||
// 群通话单人振铃超时;信令独立保留语义,处理与 REJECTED 一致
|
||||
rtcStore.applyParticipantNoAnswer(payload)
|
||||
break
|
||||
case ImRtcParticipantStatus.JOINED:
|
||||
case ImRtcParticipantStatus.LEFT:
|
||||
// ACCEPT / CANCEL / HUNGUP 暂不需要本端额外响应;rtcStore 状态由 1602/1603 + END 维护
|
||||
// ACCEPT / HUNGUP 暂不需要本端额外响应;rtcStore 状态由 1602/1603 + END 维护
|
||||
break
|
||||
default:
|
||||
console.warn('[IM WS] 未识别的 RTC_CALL status', payload)
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ export const ImRtcCallEndReason = {
|
|||
HANGUP: 1, // 接通后任一方主动挂断
|
||||
REJECT: 2, // 被叫接通前点拒接
|
||||
CANCEL: 3, // 主叫接通前主动取消
|
||||
NO_ANSWER: 4, // 振铃超时未接通
|
||||
BUSY: 5, // 私聊呼叫时对方正忙
|
||||
ERROR: 9 // 网络中断 / 设备失败
|
||||
} as const
|
||||
|
|
|
|||
|
|
@ -913,6 +913,7 @@ export function resolveRtcCallLastContent(
|
|||
* CANCEL → 操作者「已取消」/ 另一方「对方已取消」
|
||||
* REJECT → 操作者「已拒绝」/ 另一方「对方已拒绝」
|
||||
* BUSY → 操作者「忙线未接听」/ 另一方「对方忙线中」
|
||||
* NO_ANSWER → 操作者「未接听」/ 另一方「对方未接听」(振铃超时 Job 触发)
|
||||
* ERROR → 「通话中断 [N]」(接通后异常断开;duration > 0 时带时长)
|
||||
*/
|
||||
export function resolveRtcCallPrivateBubbleText(payload: RtcCallEndPayload | null): string {
|
||||
|
|
@ -929,6 +930,8 @@ export function resolveRtcCallPrivateBubbleText(payload: RtcCallEndPayload | nul
|
|||
return isOperator ? '已取消' : '对方已取消'
|
||||
case ImRtcCallEndReason.REJECT:
|
||||
return isOperator ? '已拒绝' : '对方已拒绝'
|
||||
case ImRtcCallEndReason.NO_ANSWER:
|
||||
return isOperator ? '未接听' : '对方未接听'
|
||||
case ImRtcCallEndReason.BUSY:
|
||||
return isOperator ? '忙线未接听' : '对方忙线中'
|
||||
case ImRtcCallEndReason.ERROR:
|
||||
|
|
|
|||
Loading…
Reference in New Issue