Server initiated call termination.
(callDidTimeout bool)
| 431 | |
| 432 | // Server initiated call termination. |
| 433 | func (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 | } |
no test coverage detected