Skip to content

Commit

Permalink
new event *.call.sdp (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
palage4a authored Jun 12, 2021
1 parent 0b5f8c5 commit 0734a14
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
20 changes: 20 additions & 0 deletions client_call_sdp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package tdproto

// Call parameters
type ClientCallSdp struct {
BaseEvent
Params clientCallSdpParams `json:"params"`
}

func (p ClientCallSdp) GetName() string { return "client.call.sdp" }

type clientCallSdpParams struct {
// Chat or contact id
Jid JID `json:"jid"`

// Call id
Uid string `json:"uid"`

// SDP data
JSEP JSEP `json:"jsep"`
}
29 changes: 29 additions & 0 deletions server_call_sdp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package tdproto

func NewServerCallSdp(jid JID, uid, sdpType, sdp string) (r ServerCallSdp) {
r.Name = r.GetName()
r.Params.Jid = jid
r.Params.JSEP.Type = sdpType
r.Params.JSEP.SDP = sdp
r.Params.Uid = uid
return r
}

// Call parameters
type ServerCallSdp struct {
BaseEvent
Params serverCallSdpParams `json:"params"`
}

func (p ServerCallSdp) GetName() string { return "server.call.sdp" }

type serverCallSdpParams struct {
// Chat or contact id
Jid JID `json:"jid"`

// Call id
Uid string `json:"uid"`

// SDP data
JSEP JSEP `json:"jsep"`
}

0 comments on commit 0734a14

Please sign in to comment.