Support : Click to Dial Integration - MS Teams

Abhishek Puri 1 Reputation point

To achieve 1:1 peer calling through Microsoft Teams from our application using Microsoft Graph. 

Steps Done so far:

  1. We have developed a WPF .Net framework application and created a ‘Call’ button to initiate Microsoft Teams calling:
  2. On the click of 'Call' button 'calling' method got called and in this calling method we have used below code to create 'MediaConfig'
    for 'AppHostedMediaConfig': AudioSocketSettings audioSockSettings = new AudioSocketSettings            {
                    CallId = Guid.NewGuid().ToString(),
                    SupportedAudioFormat = AudioFormat.Pcm16K,
                    StreamDirections = StreamDirection.Sendrecv
        AudioSocket audioSock = new AudioSocket(audioSockSettings);
        var mediaConfig = MediaPlatform.CreateMediaConfiguration(audioSock);
        var call = new Call
        {        MediaConfig = new AppHostedMediaConfig
                Blob = mediaConfig.ToString(Newtonsoft.Json.Formatting.None)
  3. When we use 'StreamDirection.Sendrecv' we are getting below error while applying it to 'AudioSocket':


  1. When we use the 'StreamDirection.Sendonly', Then the instance of 'AudioSocket' class is created successfully.    
    But we get below error calling 'MediaPlatform.CreateMediaConfiguration(audioSock)':
  2. The package reference being installed in the application are as follow:


Both these errors are related to 'Microsoft.Skype.Bot.Media' dll.

Please provide us the solution for these two issues as we have explored all the related Microsoft documentations online regarding these errors but could find any solution for them.

Looking forward to your response.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,667 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. DaisyTian-1203 11,616 Reputation points

    I can reproduce your two issue in my project, the two “non-initialized” error should be caused by no register calling bot. Could you try to register calling bot for your project?

    Getting Started:

    1. Register Calling Bot.
    2. Configure your permissions. Go to Settings page and click on the Manage link near Microsoft App ID. In the new page, click Add button after Application Permissions and select Calls.AccessMedia.All, and then save the change. If your bot also need to join meeting, select Calls.JoinGroupCall.All as well.
    3. The permission needs to be consented by tenant admin. Go to "<app_id>&state=<any_number>&redirect_uri=<callback_url>" using tenant admin to sign-in, then consent for the whole tenant.
    4. Please read the Concepts articles for more in depth knowledge on local media bots.

    Registering a calling bot (

    1. Register a bot by creating a Bot Channels Registration through Azure Bot Channel Registration.
    2. Once you complete the registration, take a note of the registered config values (Bot Name, Application Id, and Application Secret). You will need these values later in the code samples.
    3. In the resource blade, click Channels.
    4. Enable the Microsoft Teams channel and enable calling on the Calling tab. Fill in the Webhook (for calling) where you will receive incoming notifications. E.g. https://{your domain}/api/calls. Refer to Connect a bot to channels for more information on how to configure channels.

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.