Refactor and migrate more functions out of api into app package (#5063)

Этот коммит содержится в:
Joram Wilander
2017-01-13 15:17:50 -05:00
коммит произвёл Harrison Healey
родитель 97558f6a6e
Коммит 0e2b321e6f
33 изменённых файлов: 1673 добавлений и 1399 удалений

Просмотреть файл

@@ -115,22 +115,3 @@ func closeBody(r *http.Response) {
r.Body.Close()
}
}
func RevokeWebrtcToken(sessionId string) {
token := base64.StdEncoding.EncodeToString([]byte(sessionId))
data := make(map[string]string)
data["janus"] = "remove_token"
data["token"] = token
data["transaction"] = model.NewId()
data["admin_secret"] = *utils.Cfg.WebrtcSettings.GatewayAdminSecret
rq, _ := http.NewRequest("POST", *utils.Cfg.WebrtcSettings.GatewayAdminUrl, strings.NewReader(model.MapToJson(data)))
rq.Header.Set("Content-Type", "application/json")
// we do not care about the response
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: *utils.Cfg.ServiceSettings.EnableInsecureOutgoingConnections},
}
httpClient := &http.Client{Transport: tr}
httpClient.Do(rq)
}