Retrieve caller-ID in Microsoft Teams in realtime - microsoft-teams

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

Related

MS Teams call event

we have a windows form made using VB.net
Is there an API we can use, so that when a call is received in Teams an event is triggered?
And in the event it can determine the caller number?
And is there an event for when the call is finished, which can determine how long the call lasted?
Thanks
There is no direct way that you can handle the call triggered event at your custom application but you can get the call related details using Graph API: Reference doc https://learn.microsoft.com/en-us/graph/api/callrecords-callrecord-get?view=graph-rest-1.0&tabs=http
In order to get the Id which getting use to fetch callRecords you need to Create subscription to get call notifications.
Create subscription- Subscribes a listener application to receive change notifications when the requested type of changes occur to the specified resource in Microsoft Graph.

Get call notification when a MS Teams user gets/make call from/to PSTN (configured through Direct Routing)

As per the document it seems like we have to use MS Calling bot endpoint to get the call notifications(i.e. the case when bot is involved in the call ). But in case, when we have used Direct Routing with own SIP Trunks in MS Teams for incoming/outgoing call to PSTN, How can we get notifications like call is being establishing, established, terminated, etc.?
Any suggestion or workaround will be appreciated.
#Bijay, This is currently not supported but it is in pipeline and should be available in future.

Is possible to send an activity to a bot from a conversation from an other direcline client?

I have a bot, a client start a conversation with it using directline 3.0.
The bot follow a waterfall flow and at one step start an external process that do something. The process, finished the task use directline to start a new connection. i would like to send a message to the bot using a specific connection as the bot receive the message and can continue the flow. Is it possible?
Yes, this is possible using proactive messages. There is no need to use direct line, specifically, to create a new connection to send an activity. In short, in your bot's you will create a new API that external services can ping. As part of the process, when the API is hit, a conversation reference is created that, in short, allows you to pass any received data as an activity to the bot. When the bot receives the activity, you can setup logic to determine what the bot does next.
There is a SO post here that addresses this issue that you can reference. Additionally, you can refer to the BotBuilder-Samples GitHub sample for additional clarification.
Hope of help!

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!

Get notified about changes in a google calendar

I was wondering, is it possible to set up a Mac OS X app, to get notified when a user makes changes to a Google Calendar. Like what you can do with EKEventStore?
There’s a query method + (id)queryForCalendarListWatchWithObject:(GTLCalendarChannel *) object, but I’m not really sure how you should set up the GTLCalendarChannel object.
Or is the only way, other than polling, to use push notifications?
Thanks in advance.
You can use Google Calendar API which provides push notifications that let you watch for changes to resources. This makes periodic polling unnecessary.
You can use this feature to improve the performance of your application. It allows you to eliminate the extra network and compute costs involved with polling resources to determine if they have changed. Whenever a watched resource changes, the Google Calendar API notifies your application.
To use this API, you need to:
Register the domain of your receiving URL. Before you can set up a push notification channel, you must register the domain for any URLs you plan to use to receive push notification messages.
Set up your receiving URL, or "Webhook" callback receiver. Whenever a watched resource changes, your application will receive a notification message describing the change. The Google Calendar API sends these messages as HTTPS POST requests to the URL you specified as the "address" for this notification channel.
Set up a notification channel for each resource endpoint you want to watch. To request push notifications, you need to set up a notification channel for each resource you want to watch. After your notification channels are set up, the Google Calendar API will inform your application when any watched resource changes.
When a calendar changes, it will notify your app and the app does an API call to get the update. You can use one of the Google API client libraries to utilize push notifications.
Check these documentation and blog about Google Calendar API Push notifications.
Hope this helps!

Resources