Get sip address, or username from identity in Teams Calling API - microsoft-teams

We have a calling enabled teams bot, that receives calls. From the data it receives, we want to retrieve who is actually calling. For PSTN calls, this is ok. However, for Teams-to-Teams-calls (or SfB-Teams calls) we get the calling identity as (underneath example is SfB->Teams):
"identity":{
"#odata.type":"#microsoft.graph.identitySet",
"onPremises":{
"#odata.type":"#microsoft.graph.identity",
"id":"<guid>",
"tenantId":"<guid>",
"identityProvider":"None"
}
When all participants live in the tenant of the calling bot, we can retrieve all info (by using the graph API and just query the user with that objectID). But in the case the caller is from another tenant, how can we retrieve the displayname/sipadres for the identity?
For example, if I am being called, my teams client shows a display name. Now if the bot is called, how can it know the displayname (or sip address)?
I've tried to read out more properties using https://graph.microsoft.com/beta/communications/calls/..., however, that returns a 'call not found' consistently.

Specifically we don't support calls from sfb with details of caller. From Teams client should be able to get caller object ID though

Related

In Google DialogFlow CX, is it possible to call on an external API, then get the callback response after 15min?

I am using an exteranl API that do some work for 15min, when it finish it will call any URL you define in your initial request to send the results to.
Is it possible for dialogFlow to accept this result in 15min? Is there like a built-in async response handler in DialogFlow?
If you are calling external APIs via webhook, it would be subject to the maximum webhook timeout limit of 30 seconds. After the response timeout is exceeded, Dialogflow invokes a webhook error or timeout built-in event and continues processing as usual. Therefore, Dialogflow would no longer accept webhook responses more than the set timeout limit.
Note that conversational interfaces are meant to be designed as a continuous message exchange between the end user and the app/bot. If your web service requires more time for executing operations in the background and this cannot be optimized, consider redesigning the conversation flow in such a way that end users don't wait for the app/bot to reply for more than the set webhook timeout limit.
If you have your own custom application (integrated using APIs or Client Libraries), you can instead call/invoke the function that needs 15 minutes of work (let’s call this function_1) from your custom application.
Here’s a basic setup:
User enters a query from the interface of your custom application.
Your custom application sends the user query with the Detect Intent
request to the Dialogflow agent (using APIs or Client Libraries).
After your custom application receives a Detect Intent response from
the agent, you can create code to get the intent name or event name
from the detectIntentResponse.queryResult.match.intent.displayName
or match.event response json respectively and then call/invoke
function_1 based on the intent or event matched.
Once function_1 is finished processing, you can either send a direct response to the
user in your custom application’s interface or send a Detect Intent
request to your agent so it matches an Intent and sends the intent
response back to your custom application.
No, it won't be possible as you describe it. The only way to call external services is through webhooks, but these are thought as calls that return a very specific object which Dialogflow then returns as an answer to the user directly, so they are inherently synchronous.
What you could do instead is think of a workaround. I don't know the specific of what service you're calling, but you could set up a small server to handle the webhook response from dialogflow which doesn't do anything except trigger the call to the external api, and when you get the answer you could process it (put the relevant content inside a "fulfilment" object as per Dialogflow specification) and trigger an event in your agent through the dialogflow API.
so the final process could look something like this.
user asks for e.g. "pizza": the right intent is triggered and the route for that intent calls a webhook server
your webhook server receives the call from dialogflow and calls the external api asking for the list of all pizzas ever created. it returns an empty fulfilment to the server
when the webhook server receives the response after 15 mins it triggers an event in the agent (look into the dialogflow api for your programming language of choice: python, node, java) and injects some parameters in the request, which you can then use to form a sentence in the agent
when I was just starting out I found this very useful to get a grasp of what the platform expects you to do in terms of interacting with external services, take a look at the graph especially which I think makes it clearer

Retrieve caller-ID in Microsoft Teams in realtime

I'm trying to integrate Teams with an external service by using a Teams Bot/App. The app should call an external API with the caller-ID of the incoming PSTN call.
My success went so far, that I could get a list of the last calls but they were far away from being realtime and the caller-ID was masked.
Is it possible at all to "listen" to call metadata in realtime?
You can Retrieve the Call id by Subscribe for Microsoft Graph change notifications to be notified when your user's data changes, so you don't have to poll for changes. check Use the Microsoft Graph API to get change notifications also check this sample. when you subscribe to call

Microsoft Teams messaging extension can't call TeamsInfo methods

I am developing a Microsoft Teams messaging extension with action command and wanted to get the info on the person logged in and try to get his email address to verify on our server if he is authorized to access this or not. The context object only returns the AADObjectID which is not very useful but the email can be used to authorize them. In order to get the email I got to know that I have to make a call to TeamsInfo object and use member info API on it. Although using the api gives me "The bot is not part of the conversation roster" error. Looking into it i realized that i might only be able to call it because you can't really install a messaging extension alone. Is there a way my messaging extension can get the email of the logged in person without asking them to login again because they already are logged in into Teams?
So apparently if you want to call methods in TeamsInfo class you need to have a bot and messaging extension both configured together. If you only have messaging extension it won't work.

How to get message events published on a Web API endpoint and feed it to bot framework v4 (C#, .Net Core Bot)?

I am using a third party API to provide Agent Handover (human chat) capabilities to my v4 based bot. The API requires a call back hook/ endpoint where it can send the messages/events back from the agent, and I have to get messages from it and display to users. When ever a new chat session is established a new session id is generated. And thus Session Id is passed back in all messages and events. Essentially they are sending events as Fire&Forget with a retry on failure.
For now I had implemented an eventstore (in Cosmos dB) to store events/messages and then poll Cosmos periodically display message back to user and mark them processed.
Is there any way to make it more real time or pub-sub kind of analogy?
I would like to know if some one have already implemented scenario like this. What should be the way to respond the incoming messages from agent to bot user.
Please suggest.
I would recommend creating a client using the Direct Line API to handle routing messages between the third party agent handover and the bot. Then in the bot you can pair the third party Direct Line conversation references with the user's conversation reference to forward the messages accordingly with proactive messages. For more details take a look at this Stack Overflow question.
Hope this helps!

EWS Calendar Attendees

I am working with the Exchange Web Service and am able to retrieve calendar events using the FindItem function. I have the function returning the IDOnly and making an additional call to GetItem to get all the properties. I am able to get everything I need with the exception of Attendees who are outside of the firm.
For example, if my company has john#abc.com and joe#abc.com email accounts and I have a calendar item with both, the EWS API is correctly returning both those are attendees.
However, if I create an event with john#abc.com and johnsmithxxxxx#gmail.com, the gmail address does not get returned in the API response even though it shows up within Outlook. Is this by design or do I need to specify some additional parameter to have the EWS API return ALL attendees regardless if they have a mailbox on the exchange server or not?

Resources