From b180bb46e3034d0ce75c9961a8ccea3eefbc855c Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 15 Sep 2016 09:35:44 -0300 Subject: PLT-3412 WebRTC Server side & System Console (#3706) * WebRTC Server side * WebRTC System Console * Consistency on variable names * Add turn and stun uri validation --- model/client.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'model/client.go') diff --git a/model/client.go b/model/client.go index e54f61347..affdb54aa 100644 --- a/model/client.go +++ b/model/client.go @@ -1898,3 +1898,14 @@ func (c *Client) SamlCertificateStatus(filename string) (map[string]interface{}, return StringInterfaceFromJson(r.Body), nil } } + +// GetWebrtcToken if Successful returns a map with a valid token, stun server and turn server with credentials to use with +// the Mattermost WebRTC service, otherwise returns an AppError. Must be authenticated user. +func (c *Client) GetWebrtcToken() (map[string]string, *AppError) { + if r, err := c.DoApiPost("/webrtc/token", ""); err != nil { + return nil, err + } else { + defer closeBody(r) + return MapFromJson(r.Body), nil + } +} -- cgit v1.2.3-1-g7c22