MIP VMS RESTful WebRTC signaling API (1.0.0)

Introduction

WebRTC, Web RealTime Communication, is an open standard for real-time peer-to-peer communication on IP networks. WebRTC allows audio and video communication and streaming to work inside web pages by allowing direct peer-to-peer communication, eliminating the need to install plugins or download native apps.

A connection through WebRTC is established through a process called signaling. The WebRTC standard doesn't recommend any specific way to implement signaling. In XProtect, signaling is implemented through a RESTful API and a WebSocket API, both hosted by the API Gateway.

For more information, see Introduction to WebRTC support in XProtect.

Download OpenAPI specification

Download the OpenAPI specification for the WebRTC signaling API from https://doc.developer.milestonesys.com/mipvmsapi/api/webrtc-rest/v1/openapi.yaml.

WebRTC

WebRTC session negotiation

Returns the ICE candidates from the server.

This can only be called on a valid session id. To support trickle ICE, call this method continuously during the session to check for new candidates.

Authorizations:
bearerAuth
path Parameters
sessionId
required
string <uuid>

Responses

Response samples

Content type
No sample

Adds the ICE candidates found for the client.

To support trickle ICE, call this method whenever a new ICE candidate is found

Authorizations:
bearerAuth
path Parameters
sessionId
required
string <uuid>
Request Body schema:
sessionId
string <uuid>

Session id of the session where the ICE candidates are used

candidates
Array of strings or null

List of ICE candidates

Responses

Request samples

Content type
{
  • "sessionId": "f6567dd8-e069-418e-8893-7d22fcf12459",
  • "candidates": [
    ]
}

Initiates a session for the camera sent in the body.

The user has to have access to the camera in order for the session to be created. Note: Cameras with masking enabled cannot be used, the reason being a H.264 camera with masking enabled will output a JPEG stream which WebRTC does not support

Authorizations:
bearerAuth
Request Body schema:
sessionId
string or null

Unique id of the session

cameraId
string or null

Id of the camera that is used in the session

token
string or null

OAuth token, avaible only for patching. It cannot be retrieved

resolution
string or null

Added for future use

offerSDP
string or null

WebRTC SDP offer

answerSDP
string or null

WebRTC SDP answer

streamId
string or null

Selects a specific stream from a camera with multiple streams

object (PlaybackTimeNode)
Array of objects or null (IceServer)

List of STUN and TURN servers to use

Responses

Request samples

Content type
{
  • "sessionId": "string",
  • "cameraId": "string",
  • "token": "string",
  • "resolution": "string",
  • "offerSDP": "string",
  • "answerSDP": "string",
  • "streamId": "string",
  • "playbackTimeNode": {
    },
  • "iceServers": [
    ]
}

Response samples

Content type
No sample

Update parts of the WebRTC session once it has been initiated

Currently it's possible to update the AnswerSDP and the Token. AnswerSDP should be updated after the session has been initiated if the OfferSDP is acceptable. Token should be called before it times out. Default timeout for a Token is 1 hour.

Authorizations:
bearerAuth
path Parameters
sessionId
required
string <uuid>
Request Body schema:
sessionId
string or null

Unique id of the session

cameraId
string or null

Id of the camera that is used in the session

token
string or null

OAuth token, avaible only for patching. It cannot be retrieved

resolution
string or null

Added for future use

offerSDP
string or null

WebRTC SDP offer

answerSDP
string or null

WebRTC SDP answer

streamId
string or null

Selects a specific stream from a camera with multiple streams

object (PlaybackTimeNode)
Array of objects or null (IceServer)

List of STUN and TURN servers to use

Responses

Request samples

Content type
{
  • "sessionId": "string",
  • "cameraId": "string",
  • "token": "string",
  • "resolution": "string",
  • "offerSDP": "string",
  • "answerSDP": "string",
  • "streamId": "string",
  • "playbackTimeNode": {
    },
  • "iceServers": [
    ]
}

Response samples

Content type
No sample