MSC4075 Use expirationTS to define the call ringing window (#4652)

* Listen to call decline to stop ringing when declined from other device

* MSC4075 Use expirationTS to define the call ringing window

* Implement ElementCallService tests.

* Update acknowledgements.
This commit is contained in:
Valere Fedronic
2025-11-12 13:59:09 +01:00
committed by GitHub
parent 91dabf96eb
commit cd411b57e0
15 changed files with 485 additions and 19 deletions
+6 -2
View File
@@ -125,10 +125,11 @@ class NotificationHandler {
}
return .processedShouldDiscard
case .rtcNotification(let notificationType, _):
case .rtcNotification(let notificationType, let expirationTimestamp):
return await handleCallNotification(notificationType: notificationType,
rtcNotifyEventID: event.eventId(),
timestamp: event.timestamp(),
expirationTimestamp: expirationTimestamp,
roomID: itemProxy.roomID,
roomDisplayName: itemProxy.roomDisplayName)
case .callAnswer,
@@ -157,6 +158,7 @@ class NotificationHandler {
private func handleCallNotification(notificationType: RtcNotificationType,
rtcNotifyEventID: String,
timestamp: Timestamp,
expirationTimestamp: Timestamp,
roomID: String,
roomDisplayName: String) async -> NotificationProcessingResult {
// Handle incoming VoIP calls, show the native OS call screen
@@ -208,9 +210,11 @@ class NotificationHandler {
}
}
let expirationDate = Date(timeIntervalSince1970: TimeInterval(expirationTimestamp / 1000))
let payload = [ElementCallServiceNotificationKey.roomID.rawValue: roomID,
ElementCallServiceNotificationKey.roomDisplayName.rawValue: roomDisplayName,
ElementCallServiceNotificationKey.rtcNotifyEventID.rawValue: rtcNotifyEventID]
ElementCallServiceNotificationKey.expirationDate.rawValue: expirationDate,
ElementCallServiceNotificationKey.rtcNotifyEventID.rawValue: rtcNotifyEventID] as [String: Any]
do {
try await CXProvider.reportNewIncomingVoIPPushPayload(payload)