How to Send your URL to a friend to start a video call using flask-socketio - flask-socketio

I am using this tutorial for video call using flask-socketio in flask mysql to make application. In it
room_id = generate random (templates/home.html)
display_name = session[username] (templates/chatroom_checkpoint.html)
After that I have to send invitation with room_id & display_name to the other user.
I want to do as below
user_1 want to video call with user_2
After generate room_id and display_name
a window open on user_2 screen:
user_1 want to video call with you...
link of room_id to join and link to disconnect
There is also one page using https://www.scaledrone.com
https://pjpygit.github.io/webrtc/simple_webrtc_video.html
Now my question: How to Send your URL to a friend to start a video call using flask-socketio

Sent url for video call as message to friend using this tutorial https://github.com/pjpygit/flask-socketio-example. Its working.

Related

SSR_SetUserTmpStr in zkemkeeper.dll returns Error Code: -100

I'm using VB.NET to copy fingerprint template from one device to another. I've successfully pulled fingerprint template from the origin device using SSR_GetUserTmpStr. However, when set the fingerprint template to destination device using SSR_SetUserTmpStr returns -100.
SSR_SetUserInfo was successfull and the new user was registered at the destination device.
Please advice.

How to set hostname used in JavaMail or Apache James Message-Id header?

I am having issues with mail bouncing when sending from my own server to my own active yahoo account using JavaMail. The mails are passing SPF, DKIM and DMARC according to google mail that receives the same messages being bounced by yahoo. I can send messages from other accounts to my yahoo account without issue.
The messages send fine from my server to ZMail, GMail, Microsoft mail. Looking at the emails, the only thing that I have noticed is the message header for the Message-Id. My messages have the following header:
Message-ID: <923936395.17.1634776639078#[internally visible hostname]>
I am wondering if this header could be the problem and whether there is a way in JavaMail or in the Apache James to set the hostname or IP address that gets used in this message so that rather than using the "internally visible hostname", I can get the hostname that is externally visible. I have been searching the available documentation for Apache James and JavaMail but have not found any parameters to try in order to resolve this.
According to the Decompiled SRC of sun mail it should be possible by setting some properties for your session.
props.setProperty("mail.from", user);
props.setProperty("mail.host", host);
//props.setProperty("mail.user", user);
The Id will be updated by the save method (saveChanges()) and will trigger an new ID generation (updateHeaders() -> updateMessageID()). (Looked up in the decompiled MimeMessage.class)
Leading to the HostPart called in javax.mail.internet.InternetAddress.
The relevant method is _getLocalAddress.
Here you can see that the values get extracted from the Properties or will fallback to your local machine.
Used Fields:
user.name
mail.from
mail.user
mail.host
The user.name property can also be looked up from the system props.

cosmos db, generate authentication key on client for Azure Table endpoint

Cosmos DB, API Azure Tables, gives you 2 endpoints in the Overview blade
Document Endpoint
Azure Table Endpoint
An example of (1) is
https://myname.documents.azure.com/dbs/tempdb/colls
An example of (2) is
https://myname.table.cosmosdb.azure.com/FirstTestTable?$filter=PartitionKey%20eq%20'car'%20and%20RowKey%20eq%20'124'
You can create the authorization code for (1) on the client using the prerequest code from this Postman script: https://github.com/MicrosoftCSA/documentdb-postman-collection/blob/master/DocumentDB.postman_collection.json
Which will give you a code like this:
Authorization: type%3Dmaster%26ver%3D1.0%26sig%3DavFQkBscU...
This is useful for playing with the rest urls
For (2) the only code I could find to generate a code that works was on the server side and gives you a code like this:
Authorization: SharedKey myname:JXkSGZlcB1gX8Mjuu...
I had to get this out of Fiddler
My questions
(i) Can you generate a code for case (2) above on the client like you can for case (1)
(ii) Can you securely use Cosmos DB from the client?
If you go to the Azure Portal for a GA Table API account you won't see the document endpoint anymore. Instead only the Azure Table Endpoint is advertised (e.g. X.table.cosmosdb.azure.com). So we'll focus on that.
When using anything but direct mode with the .NET SDK, our existing SDKs when talking to X.table.cosmosdb.azure.com endpoint are using the SharedKey authentication scheme. There is also a SharedKeyLight scheme which should also work. Both are documented in https://learn.microsoft.com/en-us/rest/api/storageservices/authentication-for-the-azure-storage-services. Make sure you read the sections specifically on the Table Service. The thing to notice is that a SharedKey header is directly tied to the request it is associated with. So basically every request needs a unique header. This is useful for security because it means that a leaked header can only be used for a limited time to replay a specific request. It can't be used to authorize other requests. But of course that is exactly what you are trying to do.
An alternative is the SharedKeyLight header which is a bit easier to implement as it just requires a date and the a URL.
But we don't have externalized code libraries to really help with either.
But there is another solution that is much friendly to things like Fiddler or Postman, which is to use a SAS URL as defined in https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/12/introducing-table-sas-shared-access-signature-queue-sas-and-update-to-blob-sas/.
There are at least two ways to get a SAS token. One way is to generate one yourself. Here is some sample code to do that:
var connectionString = "DefaultEndpointsProtocol=https;AccountName=tableaccount;AccountKey=X;TableEndpoint=https://tableaccount.table.cosmosdb.azure.com:443/;";
var tableName = "ATable";
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
CloudTable table = tableClient.GetTableReference(tableName);
await table.CreateIfNotExistsAsync();
SharedAccessTablePolicy policy = new SharedAccessTablePolicy()
{
SharedAccessExpiryTime = DateTime.UtcNow.AddMinutes(1000),
Permissions = SharedAccessTablePermissions.Add
| SharedAccessTablePermissions.Query
| SharedAccessTablePermissions.Update
| SharedAccessTablePermissions.Delete
};
string sasToken = table.GetSharedAccessSignature(
policy, null, null, null, null, null);
This returns the query portion of the URL you will need to create a SAS URL.
Another, code free way, to get a SAS URL is to go to https://azure.microsoft.com/en-us/features/storage-explorer/ and download the Azure Storage Explorer. When you start it up it will show you the "Connect to Azure Storage" dialog. In that case:
Select "Use a connection string or a shared access signature URI" and click next
Select "Use a connection string" and paste in your connection string from the Azure Portal for your Azure Cosmos DB Table API account and click Next and then click Connect in the next dialog
In the Explorer pane on the left look for your account under "Storage Accounts" (NOT Cosmos DB Accounts (Preview)) and then click on Tables and then right click on the specific table you want to explore. In the right click dialog you will see an entry for "Get Shared Access Signature", click on that.
A new dialog titled "Generate Shared Access Signature" will show up. Unfortunately so will an error dialog complaining about "NotImplemented", you can ignore that. Just click OK on the error dialog.
Now you can choose how to configure your SAS, I usually just take the defaults since that gives the widest access permission. Now click Create.
The result will be a dialog with both a complete URL and a query string.
So now we can take that URL (or create it ourselves using the query output from the code) and create a fiddler request:
GET https://tableaccount.table.cosmosdb.azure.com/ATable?se=2018-01-12T05%3A22%3A00Z&sp=raud&sv=2017-04-17&tn=atable&sig=X&$filter=PartitionKey%20eq%20'Foo'%20and%20RowKey%20eq%20'bar' HTTP/1.1
User-Agent: Fiddler
Host: tableaccount.table.cosmosdb.azure.com
Accept: application/json;odata=nometadata
DataServiceVersion: 3.0
To make the request more interesting I added a $filter operation. This is an OData filter that lets us explore the content. Note, btw, to make filter work both the Accept and DataServiceVersion headers are needed. But you can use the base URL (e.g. without the filter parameter) to make any of the REST API calls on a specific table.
Do be aware that the SAS token is scoped to an individual table. So higher level operations won't work with this SAS token.

Ionic push - send to external ids

In the alpha Version of the IonicPush, it was possibe to send pushNotifications to external_ids. In the beta however, i only managed to send pushNotifications to internal ids.
An external_id is connected to a user in my Database, generated with my backend and looks like this: 55f743ed0664427a638c150c295741f8826994707148da4767
So sending a pushNotification to external_ids in the alpha like this was no problem
user_ids: array("55f743ed0664427a638c150c295741f8826994707148da4767","55f743ed0664427a638c150c295741f8826994707148da4767","55f743ed0664427a638c150c295741f8826994707148da4767");
Now in the beta, the ionicPush Service generates internal_ids for every user, and i can only send pushNotifications to internal_ids. Those internal_ids are not saved in my Database.
user_ids: array("5303434a-5f48-4743-9584-15ccb8bf7528","5303434a-5f48-4743-9584-15ccb8bf7528");
My problem now is that i have to send pushes via the external id but i am not able to do this anymore.
A ionic user, which is necessary to send targeted pushes, has an internal id, external id and a name in my case.
UPDATE: IonicUser
A ionicUser has a Name, ID and External ID. It is possible to send pushes to the ID but not to the external ID.
The ionic User saves the Android/iOs Device token
I don't know what you mean by Internal and External Id's, but when you use the code:
var push = new Ionic.Push({
"debug": true
});
push.register(function(token) {
console.log("Device token:",token.token);
});
It returns a token. This is the token you can save to the database and then use it to send notifications as described here: http://docs.ionic.io/docs/push-sending-push.

What is the URL to make a Google Voice call using the direct access number?

I am trying to write a Google Voice app and was wondering if anyone knew the url and post parameters to make a call using the direct access number instead of the ring-back.
For example, to call 1-800-555-0111, enter
https://voice.google.com/u/0/calls?a=nc,%2B18005550111
I did not test it, but check this api: http://code.google.com/p/google-voice-java/
Specially, the voice.java at line 711, which is the method:
public String call(String originNumber, String destinationNumber,
String phoneType) throws IOException {
In line 737 they use:
URL callURL = new URL("https://www.google.com/voice/call/connect/");
and the full comments for the methods say:
// POST /voice/call/connect/
// outgoingNumber=[number to call]
// &forwardingNumber=[forwarding number]
// &subscriberNumber=undefined
// &phoneType=[phone type from google]
// &remember=0
// &_rnr_se=[pull from page]
I hope this helps.
I don't think there is an official API, but this site seems to have made some progress with the URLs you are after: http://posttopic.com/topic/google-voice-add-on-development , and there is an unofficial API here: http://sourceforge.net/projects/gvoicedotnet/
Google Voice does not expose an API to the service however, there are many 3rd party libraries that mock an API by screen scraping via Google Voice's HTML website. I better solution though is to use the google voice service via SIP. Search for "google voice sip asterisk" and you will find out about this. Basically if you install this software called asterisk it can make calls via google voice.
See this article for a start:
http://eggie5.com/10-installing-asterisk-on-osx

Resources