feat(im): 振铃超时 Job 单人粒度标 NO_ANSWER + 独立 NO_ANSWER 信令推送

 feat(im): 处理 RTC_CALL(NO_ANSWER) 信令;私聊气泡显示「未接听」
im
YunaiV 2026-05-18 08:03:52 +08:00
parent 12a41da241
commit f58d1d88c8
4 changed files with 18 additions and 3 deletions

View File

@ -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
}
})

View File

@ -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)

View File

@ -182,6 +182,7 @@ export const ImRtcCallEndReason = {
HANGUP: 1, // 接通后任一方主动挂断
REJECT: 2, // 被叫接通前点拒接
CANCEL: 3, // 主叫接通前主动取消
NO_ANSWER: 4, // 振铃超时未接通
BUSY: 5, // 私聊呼叫时对方正忙
ERROR: 9 // 网络中断 / 设备失败
} as const

View File

@ -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: