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

Method handleCallInvite

server/calls.go:222–237  ·  view source on GitHub ↗

Handles video call invite (initiation) (in response to msg = {pub head=[mime: application/x-tinode-webrtc]}).

(msg *ClientComMessage, asUid types.Uid)

Source from the content-addressed store, hash-verified

220// Handles video call invite (initiation)
221// (in response to msg = {pub head=[mime: application/x-tinode-webrtc]}).
222func (t *Topic) handleCallInvite(msg *ClientComMessage, asUid types.Uid) {
223 // Call being establshed.
224 t.currentCall = &videoCall{
225 parties: make(map[string]callPartyData),
226 seq: t.lastID,
227 content: msg.Pub.Content,
228 contentMime: msg.Pub.Head["mime"],
229 }
230 t.currentCall.parties[msg.sess.sid] = callPartyData{
231 uid: asUid,
232 isOriginator: true,
233 sess: callPartySession(msg.sess),
234 }
235 // Wait for constCallEstablishmentTimeout for the other side to accept the call.
236 t.callEstablishmentTimer.Reset(time.Duration(globals.callEstablishmentTimeout) * time.Second)
237}
238
239// Handles events on existing video call (acceptance, termination, metadata exchange).
240// (in response to msg = {note what=call}).

Callers 1

handlePubBroadcastMethod · 0.95

Calls 2

callPartySessionFunction · 0.85
ResetMethod · 0.45

Tested by

no test coverage detected