I have a origin-edge setup. I am doing some recording the stream at my edge server. The VOD recording goes off.. when the origin stream goes down.. But later as the stream becomes available.. the recording does not start automatically.

So, I have two requirement for this:

1. I want to start the recording automatically as the stream becomes available. How that can be done?
2. I want to sent alert email as a stream or recording goes down. Where can I put this logic?