MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / channelPlay

Method channelPlay

server/channel.go:192–217  ·  view source on GitHub ↗
(ctx context.Context, reply string, req *proxy.Request)

Source from the content-addressed store, hash-verified

190}
191
192func (s *Server) channelPlay(ctx context.Context, reply string, req *proxy.Request) {
193 data, err := s.ari.Channel().Data(req.Key)
194 if err != nil || data == nil {
195 s.sendError(reply, err)
196 return
197 }
198
199 if req.ChannelPlay.PlaybackID == "" {
200 req.ChannelPlay.PlaybackID = rid.New(rid.Playback)
201 }
202
203 if req.Key.Dialog != "" {
204 s.Dialog.Bind(req.Key.Dialog, "channel", req.Key.ID)
205 s.Dialog.Bind(req.Key.Dialog, "playback", req.ChannelPlay.PlaybackID)
206 }
207
208 ph, err := s.ari.Channel().Play(req.Key, req.ChannelPlay.PlaybackID, req.ChannelPlay.MediaURI)
209 if err != nil {
210 s.sendError(reply, err)
211 return
212 }
213
214 s.publish(reply, &proxy.Response{
215 Key: ph.Key(),
216 })
217}
218
219func (s *Server) channelStagePlay(ctx context.Context, reply string, req *proxy.Request) {
220 data, err := s.ari.Channel().Data(req.Key)

Callers

nothing calls this directly

Calls 7

sendErrorMethod · 0.95
publishMethod · 0.95
ChannelMethod · 0.80
NewMethod · 0.80
BindMethod · 0.65
DataMethod · 0.45
PlayMethod · 0.45

Tested by

no test coverage detected