Server Webhooks
What are Webhooks?
Webhooks are powerful tools that allow real-time communication between LiveSwitch and your external systems. They act as customizable event listeners, automatically sending notifications to your specified web server whenever key actions occur within LiveSwitch. This enables you to seamlessly integrate LiveSwitch events into your own applications and workflows.
Here's how it works:
- You define a webhook by specifying a URL for your server endpoint.
- LiveSwitch monitors for specific events you're interested in.
- When an event occurs, LiveSwitch sends an HTTP POST request to your URL.
- The request body contains detailed event information in JSON format.
- Your server can then process this data and respond accordingly.
With webhooks, you can build responsive, event-driven applications that leverage LiveSwitch's capabilities while seamlessly integrating with your existing infrastructure.
Webhooks are most commonly used to notify customers when a session's recording is ready for download. After a session ends, the system processes the recording by mixing audio and video from all participants into a single file. Once the mixed recording is ready, the system sends a notification via the registered webhook, allowing customers to download the complete recording without manually checking for updates.
Server Webhooks allow you to hook into server-level events.
Server Started
This event triggers when any server starts running.
Server Started sample JSON object
{
"timestamp": 1562614545646,
"origin": "gateway", // or "mediaserver" or "sipconnector" or "recordingmonitor" or "recordingmover" or "recordingmuxer"
"type": "gateway.started", // or "mediaserver.started" or "sipconnector.started" or "recordingmonitor.started" or "recordingmover.started" or "recordingmuxer.started"
"gateway": {
"id": "dc5e5677-5b0d-4b3e-b2a5-42761849ae19",
"version": 0.0.0.0,
"machineName": "MY-SERVER",
"coreCount": 12,
"operatingSystem": "windows",
"operatingSystemVersion": "6.2.9200.0",
"architecture": "x64",
"networkinterfaces": [...],
"deploymentId": "<string>",
"publicIPAddresses": [...]
}
}
Server Stopped
This event triggers when any server stops running.
Server Stopped sample JSON object
{
"timestamp": 1562614545646,
"origin": "gateway", // or "mediaserver" or "sipconnector" or "recordingmonitor" or "recordingmover" or "recordingmuxer"
"type": "gateway.stopped", // or "mediaserver.stopped" or "sipconnector.stopped" or "recordingmonitor.stopped" or "recordingmover.stopped" or "recordingmuxer.stopped"
"gateway": {
"id": "dc5e5677-5b0d-4b3e-b2a5-42761849ae19",
"version": 0.0.0.0,
"machineName": "MY-SERVER",
"coreCount": 12,
"operatingSystem": "windows",
"operatingSystemVersion": "6.2.9200.0",
"architecture": "x64",
"networkinterfaces": [...],
"deploymentId": "<string>",
"publicIPAddresses": [...]
}
}
Server Registered
This event triggers when either the Media Server or SIP Connector registers to the Gateway.
Server Registered sample JSON object
{
"timestamp": 1562614545646,
"origin": "mediaserver", // or "sipconnector" or "recordingmonitor" or "recordingmover" or "recordingmuxer"
"type": "mediaserver.registered", // or "sipconnector.registered" or "recordingmonitor.registered" or "recordingmover.registered" or "recordingmuxer.registered"
"mediaserver": {
"iceServerUris": [...],
"region": "en-us",
"id": "dc5e5677-5b0d-4b3e-b2a5-42761849ae19",
"version": 0.0.0.0,
"machineName": "MY-SERVER",
"coreCount": 12,
"operatingSystem": "windows",
"operatingSystemVersion": "6.2.9200.0",
"architecture": "x64",
"networkinterfaces": [...],
"deploymentId": "<string>",
}
}
Server Unregistered
This event triggers when either the Media Server or SIP Connector unregisters from the Gateway.
Server Unregistered sample JSON object
{
"timestamp": 1562614545646,
"origin": "mediaserver", // or "sipconnector" or "recordingmonitor" or "recordingmover" or "recordingmuxer"
"type": "mediaserver.unregistered", // or "sipconnector.unregistered" or "recordingmonitor.unregistered" or "recordingmover.unregistered" or "recordingmuxer.unregistered"
"mediaserver": {
"iceServerUris": [...],
"region": "en-us",
"id": "dc5e5677-5b0d-4b3e-b2a5-42761849ae19",
"version": 0.0.0.0,
"machineName": "MY-SERVER",
"coreCount": 12,
"operatingSystem": "windows",
"operatingSystemVersion": "6.2.9200.0",
"architecture": "x64",
"networkinterfaces": [...],
"deploymentId": "<string>",
}
}