IVR Project for Agent, Tenant, and Admin - Flow and .NET Code Request

Parthasarathi Kannan 0 Reputation points
2024-06-05T05:04:33.9733333+00:00

Our upcoming IVR project, which will involve agents, tenants, and administrators. We are in the planning phase and would appreciate your assistance with the following:

Flow Design: We need a comprehensive flowchart outlining the interaction processes for agents, tenants, and administrators within the IVR system.

Code Implementation: If possible, please provide us with sample code for the IVR system, specifically in .NET. A demo illustrating the functionality would be extremely helpful.

For reference, our Azure Communication Services number is +12186100039. Currently, we are focusing on handling inbound calls.

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
895 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. brtrach-MSFT 16,586 Reputation points Microsoft Employee
    2024-06-11T02:54:15.42+00:00

    @Parthasarathi SBNA Here’s a high-level overview of how the flow might look like and a simple code snippet to get you started.

    Flow Design:

    1. Inbound Call: When a call comes in, the IVR system answers it.
    2. Menu Options: The IVR system presents the caller with a set of menu options. These options could be different for agents, tenants, and administrators.
    3. Input: The caller selects an option by pressing the corresponding number on their phone.
    4. Action: Based on the caller’s input, the IVR system performs the appropriate action. This could be routing the call to an agent, accessing tenant information, or performing an administrative task.

    Code Implementation:

    Here’s a simple .NET code snippet that uses the Azure Communication Services SDK to handle an inbound call:

    using Azure.Communication;
    using Azure.Communication.CallingServer;
    
    public class Program
    {
        private const string connectionString = "<Your ACS Connection String>";
        private const string phoneNumber = "+12186100039";
    
        public static void Main()
        {
            var callClient = new CallingServerClient(connectionString);
            var callConnection = callClient.CreateCallConnection();
    
            callConnection.OnStateChanged += CallConnection_OnStateChanged;
            callConnection.OnCallConnectionStateChanged += CallConnection_OnCallConnectionStateChanged;
    
            callConnection.Answer(phoneNumber);
        }
    
        private static void CallConnection_OnStateChanged(object sender, EventArgs e)
        {
            // Handle state changes
        }
    
        private static void CallConnection_OnCallConnectionStateChanged(CallConnectionStateChangedEventArgs e)
        {
            // Handle call connection state changes
        }
    }
    

    Replace <Your ACS Connection String> with your actual Azure Communication Services connection string. This code creates a new call connection and sets up event handlers for state changes. When a call comes in, it answers the call.

    Remember, this is a very basic example. A real-world IVR system would be much more complex, involving additional features like text-to-speech, speech recognition, and database integration. You might also need to handle different types of calls (e.g., voice, video) and events (e.g., call hold, call transfer).


  2. brtrach-MSFT 16,586 Reputation points Microsoft Employee
    2024-06-19T20:14:27.8666667+00:00

    @Parthasarathi Kannan Based on the error message you provided; it seems like there is an issue with the authentication of your webhook. The error message indicates that the HMAC-SHA256 validation failed, which means that the signature of the webhook message did not match the expected signature. This could be due to an incorrect secret key or an issue with the way the signature is being generated.

    To fix this issue, you should check the following:

    1. Make sure that the secret key used to generate the signature is correct and matches the one configured in your webhook.

    Verify that the signature is being generated correctly. You can use an online tool to generate the signature and compare it with the one received in the webhook message.

    Regarding the "Call not found" error, it could be due to a number of reasons, such as an incorrect call ID or a delay in the call being established. To troubleshoot this issue, you can try the following:

    1. Check that the call ID being used is correct and matches the one received in the webhook message.
    2. Verify that the call has been established and is active before attempting to perform any actions on it.

    If you are still encountering issues after the above troubleshooting, please reply to this message so we can consider working with you on next steps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.