Handles video call invite (initiation) (in response to msg = {pub head=[mime: application/x-tinode-webrtc]}).
(msg *ClientComMessage, asUid types.Uid)
| 220 | // Handles video call invite (initiation) |
| 221 | // (in response to msg = {pub head=[mime: application/x-tinode-webrtc]}). |
| 222 | func (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}). |
no test coverage detected