Agora Cloud Recording not working when single user Joins - agora.io

I have implemented agora cloud recording and i am able to save recording files in Amazon S3. I am having issues in recorded video, where I am able to see one person only in my recording. Person who did not start recording.
Below are the steps.
Start Video Call
Other Person Joins call
Acquire - Start Recording - Query (Status 5) - Recording is working
Finish recording - recording uploaded success
Check recording in Amazon S3 (I am able to see another person in recoding but not myself)
I have subscribed to both UID, also tried subscribing using select all
"subscribeVideoUids": [ "#allstream#" ], "subscribeAudioUids": [ "#allstream#" ],
Need to understand what is incorrect. Please find the full request below.
{"cname":"1000","uid":"3924255811","clientRequest":{"token":"006d144dfdf7042dcc742acaca3c34af3afe220IAD6qWGaJzXtNJerzqvOQv1tItIa4sVXAb82LOj2vRAygRejJGdfUjEAAubpgRidf8lgXwEA","recordingConfig":{"maxIdleTime":30,"streamTypes":2,"channelType":0,"videoStreamType":1,"transcodingConfig":{"height":640,"width":360,"bitrate":500,"fps":15,"mixedVideoLayout":1,"maxResolutionUid":"3924255811","backgroundColor":"#000000"},"subscribeVideoUids":["#allstream#"],"subscribeAudioUids":["#allstream#"],"subscribeUidGroup":0},"recordingFileConfig":{"avFileType":["hls"]},"storageConfig":{"accessKey":"xxxxxxxx","region":14,"bucket":"dummybucket","secretKey":"xxxxxxxx","vendor":1}}}

In my experience, when only 1 user is recorded sometimes this is due to the recorder using the same UID as one of the users in the channel.
When calling the Agora Cloud Recording (acquire, start, stop) the UID should be unique from the users already in the channel.

Yes, This will not work if only a single user is present on the channel, below is the solution I applied to make it work.
Create a new or local client that will join the channel but do not create this client's audio and video track.
Now before proceeding to record, open a new window and on this window's load, create one more client (by doing the same as above) and this time allow to create it's audio and video track.
This newly created client will behave like a local client in this window and a remote client in the original window.
What happening here is-
The first time when we create a client, it joins the channel but not publishing any stream in the channel, but we have a UID of this client which we will use to send recording requests.
On the second time when we open a new window and create a new or local client, this client is a remote client for the original window (In which recording is taking place or is being requested) and this is the client who is being recorded.
Ideally, there are two users in the channel in which one is publishing the stream (newly window client) and another one is not publishing but requesting the recording (original window client). Logically, the user who is being recorded is the same in both windows with different uids.
To record a single user, there should be at least two unique uid in the channel from which one uid person can request to record and another uid person can be recorded.
Hope this will help.

Related

Two registration IDs active on one device

I have my app running on a Nexus 5 (Marshmallow) which has 2 active registration ids. Just want to know if that is normal by GCM behavior?
Here's how it's causing me trouble:
Android M has come up with Group permissions - which means the user chooses whether or not he wants the app to have access to his device identifiers (Android ID). Let's assume he denies it and I can't identify the device. The way my app functions is that a user can log in from multiple devices, all of which remain in sync. Because a user can be on mulitple devices, I must handle multiple registration IDs to send push messages (and I cant be sure of the number of devices the user is on, as they can deny providing the device identifiers). This means that I cant delete/update any registration ids on the server side, but only send every push message to all recorded IDs against a user, in the hope that all the devices on which that particular user is signed in will receive the messages.
Because I have a device which has two active registration IDs, I am getting 2 notifications for everything.
On the client end, we were noticing frequent changes in the Registration IDs, we have a class that keeps generating registration ids and updating the server.
Having multiple registration Ids can be a bug in the client app (which you have to deal with).
And the only way to ensure that there will only be one notification being sent per device is to implement canonical IDs on the server side. It is included in the webservice response as "canonical_ids".
Canonical IDs
If a bug in the client app triggers multiple registrations for the same device, it can be hard to reconcile state and the client app might end up with duplicate messages.
Implementing canonical IDs can help you more easily recover from these situations. A canonical registration ID is the registration token of the last registration requested by the client app . This is the ID that the server should use when sending messages to the device.
If you try to send a message using an old registration token, GCM will process the request as usual, but it will include the canonical ID in the registration_id field of the response. Make sure to replace the registration token stored in your server with this canonical ID, as eventually the old registration token will stop working.
Here is a related issue
android GCM get original id of canonical id which tackles how canonical ids work in the actual code

Mixpanel user tracking- track registred user from different device

I am using mixpanel user profile tracking.
1 : If a new user, say A , visit my site and go through some pages without sign-up. That time mixpanel is tracking events to a unknown profile.
2 : Then the user A, sign up in my site and placed an order.
That time mixpanel is tracking previous events and the events after sign up also to a the same profile. (mentioned in above point).
3 : Then the user comes to my site using his mobile, then he go through the pages without login
That time mixpanel track the events to different a profile.
4 : The user then logged in in his mobile and continue to place order.
Then the mixpanel track events after the login into the previous profile mentioned in the 1st and 2 nd step.
My problem is I would like to re-map the tracking done in the 3rd step also to the profile which is used to track in 1st and 2nd step
There are 2 routes
1-) Queue anonymous events: the idea would be that instead of sending Mixpanel the events when the user is still anonymous, you save them either on the device (if it's a mobile app) or on your server. Then, when the user logs in, or creates the account, you can flush the stored events since now you know who the user is. As you might realize, the downside is that if the user never logs in or signs up, then the events are never sent (unless you build a mechanism in your server to flush them in that case).
2-) You could so as you currently do, but when the person goes to step 4, and logs in, before changing the ID to the correct one, you could create a People profile with the anonymous ID, mark it with a flag that it's an orphaned profile, and save the correct ID for it. That way, you can schedule a task to look at those profiles every so often, export their events, and import them back with the correct ID. That would essentially duplicate the data for those events, but you would have the full history with the correct ID. You could also try to filter events based on the "orphaned" flag later on, but it does mean you will always have to have it mind.

Synchronize chat over multiple windows/tabs using AppEngine Channel API

I am developing a chat application on top of the Google AppEngine Channel API, and one challenge is in co-ordinating/synchronizing chat when running in multiple windows/tabs (in a single browser).
In particular, if a user has a conversation open in one window/tab, and then opens a new window/tab that connects to my website, I would like for that same conversation to appear in the new window/tab (this is the functionality that Facebook chat and other websites have). I believe that this could be achieved by opening a new channel for each window that the user has open, and letting the server ensure that each channel has the most up-to-date conversation data, but I am concerned about hitting a limit (if there is one) on the number of channels allowed by the Channel API - and am also concerned about the efficiency of this approach.
So, my question is: 1) From an efficiency/effectiveness standpoint, does it makes sense to open a new channel for each window/tab for a single user? 2) Is there any kind of limit on the number of channels that I can open to a single user? 3) is there an overall limit on the number of channels that I can open? 4) is there some other more intelligent way of accomplishing my goals (perhaps using cookies or by somehow splitting data from a single channel between multiple windows/tabs)?
Thank you and kind regards
Alex
Not really.
No.
http://code.google.com/intl/ro/appengine/docs/quotas.html
Read the Channel section.
Yes, you could use cookies.
perhaps you should use sessionStorage, it has event listen for writing, all tabs with same origin gets the event!

Building a GPS Tracking Web System

I'd like to develop a tracking system using an API of course (like the famous Orange API).
the idea is simple:
I send a SMS (from my Web interface) to the person i want to track
The person's mobile terminal (GPS like this) send me back automatically
the coordinates by SMS.
The sent information are displayed on the user's web interface.
The questions are simple:
How the terminal can send automatically the response?
How to indicate in the message that the information is for "user4655"?
How to make connection between the information and the database?
Thanks,
Regards.
* How the terminal can send automatically the response?
Ans: You set the gateway and the time intervals you want the device to send the sms to on the device itself.
* How to indicate in the message that the information is for "user4655"?
Ans: The gateway you use will have the API to determine that the number it is sent from. The device will use a registered phone number from either a sim or enabled by one of those cell providers.
* How to make connection between the information and the database?
Ans: I dont understand this. But I'm guessing you will have a database to keep track of the user data. You'll just probably need another table that is a child of the user, which has a list of the data and the time they came in.

how to handle multiple devices when using Push Notification?

I am developing an application in which I want to use push notification service. I have a server, now I want to know that
How do I handle multiple devices?
Is there a unique device id/name for every iphone?
Suppose I want to delete request for a specific device token, so how do I handle multiple users?
Is there a way I can generate unique name for every device through application?
You should really read the APNS documentation, this is all explained in depth there.
The short answer is that when you launch an app on the phone it requests a push notification key from the OS. You then take that key and send it back to your server. Your server uses that key when it sends a push via Apple's servers to indicate the devices to send the push out to.
The service just gives you a token. If you want accounts or device names you need to come up with them and store them with the credentials on your server.
You handle multiple users by same way you handle single users, you send message with the appropriate key to the service.
As for deleting a request, you can't. It is like a text message, there may be some latency before hits the device, but the moment you commit the push it could be delivered instantly.