Forum Discussion

allabashashaik's avatar
allabashashaik
Copper Contributor
Oct 17, 2024

Difficulty with Auto-Answering VOIP Calls via Microsoft Graph API

Description: I'm working on a PowerShell script to initiate and auto-answer VOIP calls using the Microsoft Graph API. I have successfully set up my Azure App Registration, including a callback URI. However, I'm encountering issues when trying to auto-answer calls

 

Details:

  1. Call Initiation: The script successfully initiates a call using the New-MgCommunicationCall endpoint.
  2. Call Status: The call transitions from "establishing" to "established" status as expected.
  3. Error on Auto-Answer: Upon attempting to auto-answer the call with the Invoke-RestMethod to the answer endpoint, I receive a 404 Not Found error. The output indicates that the call ID is valid, but it seems the call resource is not found at the time of answering.

Current Script Setup:

  • I'm using a callback URI (https://kyncomdigiwasusdev.onmicrosoft.com/callback) configured for handling call events.
  • I have ensured the necessary permissions are granted in Azure for the app.
  • I have tried various delays (currently set to 5 seconds) between establishing the call and answering it, but I still receive the 404 error.

Questions:

  • Are there any known issues with the auto-answer feature in the Microsoft Graph API for VOIP calls?
  • What additional steps should I take to troubleshoot this error?

2 Replies

  • Ankit's avatar
    Ankit
    Brass Contributor
    Hi,

    I couldn't find any specific problems with the auto-answer feature for VOIP calls. However, it's essential to note that the Microsoft Graph API is constantly evolving, and new issues might arise.

    I'll help you break down the problem and provide potential solutions that might work for you.



    Check the call resource availability before attempting to auto-answer the call. You can do this by sending a GET request to the https://graph.microsoft.com/v1.0/communications/calls/{callId} endpoint.

    If the call resource is not available, you might need to wait for a few seconds and retry the auto-answer request.

    Verify that your callback URI (https://kyncomdigiwasusdev.onmicrosoft.com/callback) is receiving call events correctly.

    Check the callback event payload to ensure that the call ID and other relevant details are being passed correctly.

    Try increasing the delay between establishing the call and answering it to 10-15 seconds to see if the issue persists.

    Thanks 🙂
    • allabashashaik's avatar
      allabashashaik
      Copper Contributor
      I have tried all the Steps suggested above.. gave more delays and also tried to get the call id status.. waited until it turned to established... Once the call is established... have been getting the Call ID not found error.

      We wanted to use Call ID to fetch the call quality metrics and others... also we need to auto answer the call and Hang up ... which is not happening as we are getting this error..

      As per Microsoft Call ID will be active for 30 days.. Once the call is being established why call id is not working ? Any idea any other alternate approach which we can try to auto answer the call and to perform the Call handling actions.

Resources