| 137 | } |
| 138 | |
| 139 | func (s *Server) bridgePlay(ctx context.Context, reply string, req *proxy.Request) { |
| 140 | // bind dialog |
| 141 | if req.Key.Dialog != "" { |
| 142 | s.Dialog.Bind(req.Key.Dialog, "bridge", req.Key.ID) |
| 143 | s.Dialog.Bind(req.Key.Dialog, "playback", req.BridgePlay.PlaybackID) |
| 144 | } |
| 145 | |
| 146 | ph, err := s.ari.Bridge().Play(req.Key, req.BridgePlay.PlaybackID, req.BridgePlay.MediaURI) |
| 147 | if err != nil { |
| 148 | s.sendError(reply, err) |
| 149 | return |
| 150 | } |
| 151 | |
| 152 | s.publish(reply, &proxy.Response{ |
| 153 | Key: ph.Key(), |
| 154 | }) |
| 155 | } |
| 156 | |
| 157 | func (s *Server) bridgeStagePlay(ctx context.Context, reply string, req *proxy.Request) { |
| 158 | data, err := s.ari.Bridge().Data(req.Key) |