| 239 | } |
| 240 | |
| 241 | func (s *Server) channelRecord(ctx context.Context, reply string, req *proxy.Request) { |
| 242 | if req.ChannelRecord.Name == "" { |
| 243 | req.ChannelRecord.Name = rid.New(rid.Recording) |
| 244 | } |
| 245 | |
| 246 | if req.Key.Dialog != "" { |
| 247 | s.Dialog.Bind(req.Key.Dialog, "channel", req.Key.ID) |
| 248 | s.Dialog.Bind(req.Key.Dialog, "recording", req.ChannelRecord.Name) |
| 249 | } |
| 250 | |
| 251 | h, err := s.ari.Channel().Record(req.Key, req.ChannelRecord.Name, req.ChannelRecord.Options) |
| 252 | if err != nil { |
| 253 | s.sendError(reply, err) |
| 254 | return |
| 255 | } |
| 256 | |
| 257 | s.publish(reply, &proxy.Response{ |
| 258 | Key: h.Key(), |
| 259 | }) |
| 260 | } |
| 261 | |
| 262 | func (s *Server) channelStageRecord(ctx context.Context, reply string, req *proxy.Request) { |
| 263 | data, err := s.ari.Channel().Data(req.Key) |