0

Hi with the new ACS will it be possible to fire an event when a call is answered and fire an event after the call has finished?

I'm wanting to capture the number of the call that has been answered and then open a program to pop up the details of the caller.

Thanks

Dan
  • 31
  • 1
  • 5

1 Answers1

0

It is possible to hook to EventGrid events:

enter image description here

You can extract the phone number from rawId or use the new createIdentifierFromRawId method to convert it to the correct identifier type for further usage.

See the events reference and the quickstart for Azure Communication Services.

You can also listen to some events with the Call Automation SDK.

rocky
  • 7,506
  • 3
  • 33
  • 48
  • Thank you Rocky this is great! Can I add ACS to a Windows Form and when the form is running I can handle the call started or ended events? thank you – Dan Sep 13 '22 at 08:21
  • Unfortunately, Windows Forms are not supported by the ACS Calling package. At the moment, ACS supports only UWP on Windows as you can find here: https://learn.microsoft.com/en-us/azure/communication-services/concepts/sdk-options#net On the other hand, handling of the EventGrid events is platform-agnostic. – rocky Sep 13 '22 at 20:56
  • Thanks for this, could I make a UWP on Windows with ACS, and when a call is incoming or started, handle the event and then launch my Windows app and pass the phone number as a parameter? Thanks – Dan Sep 14 '22 at 14:02
  • It's a bit tricky but possible. See the answer and blogpost here: https://stackoverflow.com/questions/56062488/can-i-pass-parameters-specific-to-an-exe-while-launching-it-from-a-uwp-app-that – rocky Sep 15 '22 at 14:50
  • Thanks ROcky thats great. I have just realised that UWP cannot be run in server 2016 (we use RDS). Could we create a Windows Service with ACS or something similar which can run in the background? Thank you – Dan Sep 16 '22 at 10:04
  • You can use ACS EventGrid events (https://learn.microsoft.com/en-us/azure/event-grid/communication-services-voice-video-events#microsoftcommunicationcallstarted) to integrate with any platform. Here's a quickstart for SMS events - https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/sms/handle-sms-events If the requirement is to run on a ws2016 machine, azure service bus could be a suitable endpoint type and here's how to integrate it with .net core https://stackoverflow.com/a/68039277/1332034 – rocky Sep 19 '22 at 10:44