(ctx context.Context, reply string, req *proxy.Request)
| 66 | } |
| 67 | |
| 68 | func (s *Server) applicationSubscribe(ctx context.Context, reply string, req *proxy.Request) { |
| 69 | err := s.ari.Application().Subscribe(req.Key, req.ApplicationSubscribe.EventSource) |
| 70 | if err != nil { |
| 71 | s.sendError(reply, err) |
| 72 | return |
| 73 | } |
| 74 | |
| 75 | if req.Key.Dialog != "" { |
| 76 | eType, eID, err := parseEventSource(req.ApplicationSubscribe.EventSource) |
| 77 | if err != nil { |
| 78 | s.Log.Warn("failed to parse event source", "error", err, "eventsource", req.ApplicationSubscribe.EventSource) |
| 79 | } else { |
| 80 | s.Dialog.Bind(req.Key.Dialog, eType, eID) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | s.sendError(reply, nil) |
| 85 | } |
| 86 | |
| 87 | func (s *Server) applicationUnsubscribe(ctx context.Context, reply string, req *proxy.Request) { |
| 88 | s.sendError(reply, s.ari.Application().Unsubscribe(req.Key, req.ApplicationSubscribe.EventSource)) |
nothing calls this directly
no test coverage detected