Clear stale unanswered calls before new invite
This commit is contained in:
+9
-2
@@ -1227,8 +1227,15 @@ func (t *Topic) handlePubBroadcast(msg *ClientComMessage) {
|
||||
return
|
||||
}
|
||||
if t.currentCall != nil {
|
||||
msg.sess.queueOut(ErrCallBusyReply(msg, types.TimeNow()))
|
||||
return
|
||||
now := types.TimeNow()
|
||||
if t.currentCall.isStaleUnanswered(now, imCallTimeoutSeconds()) {
|
||||
logs.Warn.Printf("topic[%s]: clearing stale unanswered call seq=%d call_id=%s before new invite", t.name, t.currentCall.seq, t.currentCall.callID)
|
||||
t.terminateCallInProgress(true)
|
||||
}
|
||||
if t.currentCall != nil {
|
||||
msg.sess.queueOut(ErrCallBusyWithCallReply(msg, now, t.currentCall))
|
||||
return
|
||||
}
|
||||
}
|
||||
head, content, err := normalizeCallInvite(msg.Pub.Head, msg.Pub.Content)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user