-
Notifications
You must be signed in to change notification settings - Fork 0
/
server_call_answer.go
43 lines (34 loc) · 1.05 KB
/
server_call_answer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package tdproto
func NewServerCallAnswer(jid JID, sdp string, onliners []CallOnliner, uid string) (r ServerCallAnswer) {
r.Name = r.GetName()
r.Params.Jid = jid
r.Params.JSEP.Type = "answer"
r.Params.JSEP.SDP = sdp
r.Params.Onliners = onliners
r.Params.Uid = uid
return r
}
// Call parameters (deprecated: use `ServerCallSdp`)
type ServerCallAnswer struct {
BaseEvent
Params serverCallAnswerParams `json:"params"`
}
func (p ServerCallAnswer) GetName() string { return "server.call.answer" }
// Params of the server.call.answer event
type serverCallAnswerParams struct {
// Chat or contact id
Jid JID `json:"jid"`
// List of ICE candidates (when trickle = false)
Candidates []serverCallAnswerCandidate `json:"candidates,omitempty"`
// Current call participants
Onliners []CallOnliner `json:"onliners,omitempty"`
// SDP data
JSEP JSEP `json:"jsep"`
// Call id
Uid string `json:"uid"`
}
// ICE candidate for call answer
type serverCallAnswerCandidate = struct {
Candidate string `json:"candidate"`
SdpMLineIndex int `json:"sdpMLineIndex"`
}