Webhooks for libshout status updates
We'll need the webhook called for any errors/events that libshout initiates.
See Webhook page for schema: https://labs.creek.fm/open/audio-server/wikis/Config/Webhooks
Possible Events
Minimally, I think we need these below. However, I'm not sure if they are already handled by libshout.
And if there are any others that I forgot, please include them?
- Stream connecting:
http-stream-connecting
- Stream connecting failed (network):
http-stream-connecting-failed
- Stream authentication failed (user/pass wrong):
http-stream-auth-failed
- Stream connected:
http-stream-connected
- Stream connection failed (network error):
http-connection-failed
- Stream disconnected (on purpose):
http-stream-disconnected
Keep current status available in JSON API
These events above could be stored in the JSON for the output
that's doing the libshout streaming. Then we can query the JSON for the current status of this libshout-enabled output.
Example Webhook POST
// POST http://localhost:3300/audio-player-webhook
{
"instance": "station-one",
"name": "http-stream-connected",
// Send the full JSON data for the Output.
"data": {
"type": "output",
// Use "function" as another word for "type"?
// Maybe there is a better word?
"function": "http-stream",
"name": "stream-1",
"level": 0.51371... // The current volume
...
}
}
Edited by Travis