DelTmpAuthInfo implements: POST /voip/turnAuthTmpDel
(req *http.Request, device *api.Device, cfg *config.ClientAPI)
| 204 | |
| 205 | // POST /voip/turnAuthTmpDel |
| 206 | func DelTmpAuthInfo(req *http.Request, device *api.Device, cfg *config.ClientAPI) util.JSONResponse { |
| 207 | apiClient := getHttpClient(time.Second * 5) |
| 208 | defer apiClient.CloseIdleConnections() |
| 209 | reqHttp := turnReq{} |
| 210 | reqHttp.Username = device.UserID |
| 211 | |
| 212 | respHttp := turnReq{} |
| 213 | |
| 214 | if err := PostJSON(req.Context(), &apiClient, fmt.Sprintf("http://%s:23478/turn/delTmpAuth", turnHost), reqHttp, &respHttp); err != nil { |
| 215 | return jsonerror.InternalServerError() |
| 216 | } |
| 217 | //if err := turn_server.DelTmpAuth(device.UserID); err != nil { |
| 218 | // return jsonerror.InternalServerError() |
| 219 | //} |
| 220 | return util.JSONResponse{ |
| 221 | Code: http.StatusOK, |
| 222 | JSON: struct { |
| 223 | }{}, |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | func getHttpClient(options ...interface{}) http.Client { |
| 228 | timeout0 := time.Minute * 1 |
no test coverage detected