MCPcopy
hub / github.com/tinode/chat / terminateCallInProgress

Method terminateCallInProgress

server/calls.go:433–455  ·  view source on GitHub ↗

Server initiated call termination.

(callDidTimeout bool)

Source from the content-addressed store, hash-verified

431
432// Server initiated call termination.
433func (t *Topic) terminateCallInProgress(callDidTimeout bool) {
434 if t.currentCall == nil {
435 return
436 }
437 uid, sess := t.getCallOriginator()
438 if sess == nil || uid.IsZero() {
439 // Just drop the call.
440 logs.Warn.Printf("topic[%s]: video call seq %d has no originator, terminating.", t.name, t.currentCall.seq)
441 t.currentCall = nil
442 return
443 }
444 // Dummy hangup request.
445 dummy := &ClientComMessage{
446 Original: t.original(uid),
447 RcptTo: uid.UserId(),
448 AsUser: uid.UserId(),
449 Timestamp: types.TimeNow(),
450 sess: sess,
451 }
452
453 logs.Info.Printf("topic[%s]: terminating call seq %d, timeout: %t", t.name, t.currentCall.seq, callDidTimeout)
454 t.maybeEndCallInProgress("", dummy, callDidTimeout)
455}

Callers 3

handleCallEventMethod · 0.95
unregisterSessionMethod · 0.95
runLocalMethod · 0.95

Calls 6

getCallOriginatorMethod · 0.95
originalMethod · 0.95
TimeNowFunction · 0.92
UserIdMethod · 0.80
IsZeroMethod · 0.45

Tested by

no test coverage detected