fix: expire stale call pushes

This commit is contained in:
richjohnrambo
2026-09-14 12:11:43 +08:00
parent 4854e090ef
commit 789e662bdb
8 changed files with 164 additions and 14 deletions
+3 -1
View File
@@ -37,6 +37,8 @@ const (
constCallEventHangUp = "hang-up"
// Message headers representing call states.
// Call is ringing.
constCallMsgStarted = "started"
// Call is established.
constCallMsgAccepted = "accepted"
// Previously establied call has successfully finished.
@@ -149,7 +151,7 @@ func normalizeCallInvite(head map[string]any, content any) (map[string]any, any,
for key, value := range head {
normalizedHead[key] = value
}
normalizedHead["webrtc"] = "started"
normalizedHead["webrtc"] = constCallMsgStarted
normalizedHead["x-im-type"] = "call"
if _, ok := normalizedHead["mime"]; !ok {
normalizedHead["mime"] = "application/json"