| 216 | } |
| 217 | |
| 218 | func (conf *GlobalConfig) API_stop_subscribe(w http.ResponseWriter, r *http.Request) { |
| 219 | q := r.URL.Query() |
| 220 | streamPath := q.Get("streamPath") |
| 221 | id := q.Get("id") |
| 222 | s := Streams.Get(streamPath) |
| 223 | if s == nil { |
| 224 | util.ReturnError(util.APIErrorNoStream, NO_SUCH_STREAM, w, r) |
| 225 | return |
| 226 | } |
| 227 | suber := s.Subscribers.Find(id) |
| 228 | if suber == nil { |
| 229 | util.ReturnError(util.APIErrorNoSubscriber, "no such subscriber", w, r) |
| 230 | return |
| 231 | } |
| 232 | suber.Stop(zap.String("reason", "stop by api")) |
| 233 | util.ReturnOK(w, r) |
| 234 | } |
| 235 | |
| 236 | func (conf *GlobalConfig) API_replay_rtpdump(w http.ResponseWriter, r *http.Request) { |
| 237 | q := r.URL.Query() |