How to retrieve the current listeners from a wowza cloud live stream via api? - wowza

We are using the wowza cloud to run a weekly live streaming event. Is there a way to get the current listeners as live data from the api?
We found two endpoints, but they appear to be equally dysfunctional:
https://api.cloud.wowza.com/api/v1.4/usage/stream_targets/y7tm2dfl/live leads to
​{
"meta": {
"status": 403,
"code": "ERR-403-RecordUnaccessible",
"title": "Record Unaccessible Error",
"message": "The requested resource isn't accessible.",
"description": ""
},
"request_id": "def6744dc2d7a609c61f488560b80019",
"request_timestamp": "2020-03-27T19:54:14.443Z"
}​
https://api.cloud.wowza.com/api/v1.4/usage/viewer_data/stream_targets/y7tm2dfl leads to
​{
"meta": {
"status": 404,
"code": "ERR-404-RouteNotFound",
"title": "Route Not Found Error",
"message": "The requested endpoint couldn't be found.",
"description": ""
},
"request_id": "11dce4349e0b97011820a39032d9664a",
"request_timestamp": "2020-03-27T19:56:01.637Z"
}​
y7tm2dfl is one of the two stream target ids, we get from calling https://api.cloud.wowza.com/api/v1.4/live_streams/nfpvspdh/stats
Is this the right way? According to this question the data might be only available with an delay of 2 hours...
Anybody knows of something, that can actually count as live data?
Thx a lot!

From Wowza Support:
The below endpoint is the correct one to use for near realtime view counts:
curl -H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
-H "Content-Type: application/json" \
-X "GET" \
"https://api.cloud.wowza.com/api/v1.4/usage/stream_targets/y7tm2dfl/live"
It appears this stream target "y7tm2dfl" is an Akamai push and will have 2 or more hours timeframe to get results. You'll need to create a new stream target that uses Fastly to take advantage of the near realtime stats.
https://www.wowza.com/docs/add-and-manage-stream-targets-in-wowza-streaming-cloud#add-a-wowza-cdn-on-fastly-target-for-hls-playback
This will retrieve the "Current Unique Viewers", which is defined as "the number of unique viewers for the stream in the last 90 seconds". This is only available with Fastly Stream Targets in api 1.4.

Related

Agora cloud recording with Google cloud storage

I want to record my voice call with agora cloud recording. I'm using a Postman collection provided by Agora, and I don't change anything except StorageConfig. I'm successful in getting resourceID and sid, but when I stop recording, I receive the error "Failed to find worker." Based on an agora document, they said for Google Clound the region parameter has no effect, whether it is set or not, so I'm setting it to 0. There's a list of solutions I've tried but have had no success with:
Change region
Both users have different UIDs, and the recording UID is different from them.
Access key and secret key is correct
I don't know what I did wrong. Please help me. Thanks all.
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfwi6-n9kITolzw3vvIFHMfm2VZsOrLd9fk9kMzos8Y_D-2Z2fFtUu_1BD2_pKJEZ-jTgXPe--K6Ua7TpSNY0pLd4zzyZV6iXCndqZvHmfsZloox0y-UZgs-r2_zBR2Gor05YCP0HuusWF8Kv1StAYabr1HJykw7RorDYnUIzzry6p6LRfvlq2zJVyVxvzVRVmoeMPYX-cVKyhNDuI2ct9a9aPdi8jCwDUzRbYimVVAnJBRYppTH012Xt6DnnMBkskJsbK0-CK3IaipQA9Gu2RmIJxSowuZbHspwA2lpwpzre-aNG6NlXk95hZgthOfNUVE",
"sid": "edd35b65ec496e43aa502cad99bbdb27",
"code": 404,
"serverResponse": {
"command": "StopCloudRecorder",
"payload": {
"message": "Failed to find worker."
},
"subscribeModeBitmask": 1,
"vid": "1020399"
}
}

Debugging "read time out" for AWS lambda function in Alexa Skill

I am using an AWS lambda function to serve my NodeJS codebase for an Alexa Skill.
The skill makes external API calls to a custom API as well as the Amazon GameOn API, it also uses URL's which serve audio files and images from an S3 Bucket.
The issue I am having is intermittent, and is affecting about 20% of users. At random points of the skill, the user request will produce an invalid response from the skill, with the following error:
{
"Request": {
"type": "System.ExceptionEncountered",
"requestId": "amzn1.echo-api.request.ab35c3f1-b8e6-4478-945c-16f644359556",
"timestamp": "2020-05-16T19:54:24Z",
"locale": "en-US",
"error": {
"type": "INVALID_RESPONSE",
"message": "Read timed out for requestId amzn1.echo-api.request.323b1fbb-b4e8-4cdf-8f31-30c9b67e4a5d"
},
"cause": {
"requestId": "amzn1.echo-api.request.323b1fbb-b4e8-4cdf-8f31-30c9b67e4a5d"
}
},
I have looked up this issue, I believe it's something wrong with the lambda function configuration but can't figure out where!
I've tried increasing the Memory the function uses (now 256MB).
It should be noted that the function timeout is 8000ms, since this is the max time you are allowed for an Alexa response.
What causes this Read timeout issue, and what measures can I take to debug and resolve it?
Take a look at AWS XRay. By using this with your Lambda you should be able to identify the source of these timeouts.
This link should help you understand how to apply it.
We found that this was occurring when the skill was trying to access a resource which was stored on our Azure website.
The CPU and Memory allocation for the azure site was too low, and it would fail when facing a large amount of requests.
To fix, we improved the plan the app service was running on.

Where to find stored results from a Cloud Speech-to-Text API call?

I am performing a batch of asynchronous long_running_recognize transcriptions using Google's Cloud Speech-to-Text, and it appears that some of my requests are timing out, and/or not returning anything. How may I access the stored results of my API calls? I'm using Python 3.7.
I realize that the API call returns results to the function that made the call. What I'm asking is, does Google store the results of my API calls somewhere? And how do I access them?
You should probably call the asynchronous method when submitting larger audio files. Specifically this calls the LongRunningRecognize method. This should submit a Long Running Operation and should return an immediate response, for example:
{
"name": "operation_name",
"metadata": {
"#type": "type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeMetadata"
"progressPercent": 34,
"startTime": "2016-08-30T23:26:29.579144Z",
"lastUpdateTime": "2016-08-30T23:26:29.826903Z"
}
}
With this response you can poll for the result given the operation_name:
curl -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
-H "Content-Type: application/json; charset=utf-8" \
"https://speech.googleapis.com/v1/operations/your-operation-name"
Note: when you are not receiving any return values using this method, I would suggest increasing the timeout and retry of the client. This can be done with something like:
long_running_recognize(retry=10, timeout=300)
Source

GCP stackdriver fo OnPrem

Based on Stackdriver, I want to send notifications to my Centreon monitoring (behind Nagios) for workflow reasons, do you have any idea on how to do so?
Thank you
Stackdriver alerting allows webhook notifications, so you can run a server to forward the notifications anywhere you need to (including Centreon), and point the Stackdriver alerting notification channel to that server.
There are two ways to send external information in the Centreon queue without a traditional passive agent mode.
First, you can use the Centreon DSM (Dynamic Services Management) addon.
It is interesting because you don't have to register a dedicated and already known service in your configuration to match the notification.
With Centreon DSM, Centreon can receive events such as SNMP traps resulting from the detection of a problem and assign the event dynamically to a slot defined in Centreon, like a tray event.
A resource has a set number of “slots” on which alerts will be assigned (stored). While this event has not been taken into account by human action, it will remain visible in the Centreon web frontend. When the event is acknowledged, the slot becomes available for new events.
The event must be transmitted to the server via an SNMP Trap.
All the configuration is made through Centreon web interface after the module installation.
Complete explanations, screenshots, and tips are described on the online documentation: https://documentation.centreon.com/docs/centreon-dsm/en/latest/user.html
Secondly, Centreon developers added a Centreon REST API you can use to submit information to the monitoring engine.
This feature is easier to use than the SNMP Trap way.
In that case, you have to create both host/service objects before any API utilization.
To send status, please use the following URL using POST method:
api.domain.tld/centreon/api/index.php?action=submit&object=centreon_submit_results
Header
key value
Content-Type application/json
centreon-auth-token the value of authToken you got on the authentication response
Example of service body submit: The body is a JSON with the parameters provided above formatted as below:
{
"results": [
{
"updatetime": "1528884076",
"host": "Centreon-Central"
"service": "Memory",
"status": "2"
"output": "The service is in CRITICAL state"
"perfdata": "perf=20"
},
{
"updatetime": "1528884076",
"host": "Centreon-Central"
"service": "fake-service",
"status": "1"
"output": "The service is in WARNING state"
"perfdata": "perf=10"
}
]
}
Example of body response: :: The response body is a JSON with the HTTP return code, and a message for each submit:
{
"results": [
{
"code": 202,
"message": "The status send to the engine"
},
{
"code": 404,
"message": "The service is not present."
}
]
}
More information is available in the online documentation: https://documentation.centreon.com/docs/centreon/en/19.04/api/api_rest/index.html
Centreon REST API also allows to get real-time status for hosts, services and do the object configuration.

How long is a RingOut ID supposed to live for?

Firstly, ringout is working correctly, it dials two numbers and connects them together successfully.
When I send a POST request to the Ringout REST API endpoint, I get a ringout ID back. I then use this ringout ID and issue a GET request every few seconds to track when both parties have answered there calls. ( I am aware of webhooks, but webhooks don't give me the callee's status)
{
"uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/XXXX/extension/XXXXXX/ringout/XXx";,
"id": xxx,
"status": {
"callStatus": "Success",
"callerStatus": "Success",
"calleeStatus": "Success"
}
}
I use this same polling technique to work out when either party has disconnected from the call.
{
"uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/xxxx/extension/xxxx/ringout/xxxx";,
"id": xxx,
"status": {
"callStatus": "CannotReach",
"callerStatus": "Finished",
"calleeStatus": "Finished"
}
}
I noticed that the ringout ID only lives for about 30 seconds, after this time when I send a GET request I get this response even though the phone call is still taking place.
{
"errorCode": "CMN-102",
"message": "Resource for parameter [ringoutId] is not found",
"errors": [
{
"errorCode": "CMN-102",
"message": "Resource for parameter [ringoutId] is not found",
"parameterName": "ringoutId"
}
],
"parameterName": "ringoutId"
}
Is this the expected behaviour for a ringout call, does the ID disappear after 30 seconds, even though the call is still active?
This question was also asked in the RingCentral Developer Community, and answered by the Principal Architect for the Platform: https://devcommunity.ringcentral.com/ringcentraldev/topics/how-long-does-a-ringout-id-live-for
Adding a copy of Anton's answer here to save people a click...
Ringout ID lives until both call legs are established (or canceled).
You cannot use this ID to check the status of a call which is already
connected to both parties or to cancel already connected call.
In order to monitor status of an established call you should use our
presence notifications.