Partners Blog Contact Us

Using VidyoGateway Experimental Features

Follow

This article describes how to enable VidyoGateway experimental features. One of these features is the VidyoGateway API suite. In order to use the VidyoGateway API's, you must generate an API key. You can then use the API key to pass API requests to the VidyoGateway. 

Starting with VidyoGateway version 20.2.0, the API requests are sent via https (as well as http).

In addition, RTMP streaming to a CDN is supported through the VidyoGateway APIs. Both standard RTMP and secure RTMP is supported (as of version 20.2.0). RTMPS works on a TSL/SSL connection which encrypts your live streaming video with an extra layer of security to prevent any third-party from intercepting your data. 

 

Enabling Experimental Features

To begin, you must first use the VidyoGateway Admin portal to enable experimental features and obtain an API key. After obtaining the key, you can pass it in an API request to the VidyoGateway. By authenticating via the key in this way, you can then pass other API commands to the VidyoGateway.

Currently, the API call must be sent via http.

 

To enable experimental features:

  1. Log in to the Admin portal using your System Console account.
    The GENERAL > VidyoPortal page displays by default.
  2. Click the Advanced subtab.
  3. Select the API Interface checkbox in the "Experimental Features" section of the Advanced page.

    Zendesk_Exp_features.png

    By selecting this checkbox, you are allowing API requests to go through to the VidyoGateway (but only after you've authenticated using the API key as described below).
    Removing the checkmark prevents any API requests from going through to the VidyoGateway.
  4. Click Generate to obtain an API key.
  5. Click RTMP to enable RTMP streaming.
  6. Click Save or Save and Apply as desired.

 

Using the API Key 

Now that you've obtained the API key, you can continue as described in this section.

Querying the VidyoGateway Status

Use the API key to query the status of the VidyoGateway via http. The following example uses Curl. 

Curl

curl --location --request GET 'http://GATEWAYIP/config/api/v1/status' \
--header 'apikey: APIKEY' \
--header 'Cookie: GATEWAYSID=6768AEC0A722417BAB3687281FE67264' \
--data-raw ''

  • Replace the GATEWAYIP with the local IP of your active VidyoGateway.
  • Replace the APIKEY with the key you have generated.

Sample Output:

{"version":"20.1.0.017","nodes":[{"id":"192.168.1.2:50611","version":"20.1.0.017","lastPing":"2020-04-03T17:46:28.372","status":"maintenance","role":"master"},{"id":"192.168.1.3:50611","version":"20.1.0.017","lastPing":"2020-04-03T17:46:26.723","status":"online","role":"master"}],"response":"getStatus","meminfo":{"ordblks":1364,"fordblks":3912848,"spaceinuse":2399088,"hblkhd":0,"hblks":0,"arena":6311936,"smblks":3811,"fsmblks":192848,"usmblks":0,"uordblks":2399088,"keepcost":101456},"balancers":[{"type":"SIP","name":"main","status":"online"},{"type":"H323","name":"main","status":"online"},{"type":"Portal","name":"main","status":"online"}]}

 

Using Postman 

Adding the API Key Into the Request Authorization

Use Postman to add the API key into the authorization for the request.

Postman.png

Configuring the GET Request

Next, configure the GET request with the local IP of the active VidyoGateway and the API call.

The following example uses "http(s)//ACTIVEGWIP/config/api/v1/status".

GetRequest.png

PrettyCode.png

Querying the Nodes on a Cluster and the Calls on Each Node

Request:

Example: http(s)://ACTIVEGWIP/config/api/v1/nodes

Response:

{"nodes":[{"id":"10.51.35.155:50611","status":"maintenance","calls":[]},{"id":"10.51.35.156:50611","status":"online","calls":["aab63123-7e53-4ff3-ba8a-2651e87f3ae610a33239cc5b3"]}]}

Querying Only the Nodes in Maintenance Mode

Request:

Example http(s)//ACTIVEGWIP/config/api/v1/maintenance

Response:

[{"id":"10.51.35.155:50611"}]

 

Establishing an RTMP Stream via VidyoGateway

Once RTMP is enabled on the VidyoGateway, configuration is enabled so that an RTMP stream can be established via the VidyoGateway to a Vidyo room. You must be in the room you plan to stream from before launching the API call.

When the call is established, you can view the RTMP stream live from the Vidyo room.

Sample Request:

sourceProtocol.png

 

Sending Requests to PIN-Protected Rooms

If you are sending a request to a PIN-protected room, you must first determine what the PIN delimiter is set to on your gateway.

To determine the PIN delimiter:

  1. Log in to the Admin portal using your System Console account.
    The GENERAL > VidyoPortal page displays by default.
  2. Click the Advanced subtab and view the PIN Delimiter field.

    PINDelimiter.png

    The default delimiter on the gateway is Asterisk. 

  3. Append the delimiter and the room PIN after the room extension in the body of the request.

    AsteriskDelimiter.png

 

Terminating an Active Call

To terminate an active call:

  1. Obtain the call ID returned from the RTMP call request.
    For example, 6fdee18d-ea6d-46c4-8785-b31244c7bcfa10a33239bc5b3.
  2. Add the call ID to the end of "config/api/v1/calls".

    TerminatingActiveCall.png

  3. Change the request to an HTTP DELETE.
  4. Send the request.
    This terminates the call. 
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.