Independentsoft
Professional software libraries for developers
Home
Purchase
Support
Company
Contact
Graph .NET
>
Tutorial
> Mute call
The following example shows you how to mute and unmute a call.
C# example
using System; using System.Threading.Tasks; using Independentsoft.Graph; using Independentsoft.Graph.Calls; namespace Sample { class Program { static async Task Main(string[] args) { try { GraphClient client = new GraphClient(); client.ClientId = "63333333-209e-454e-b7bd-55a4d201270f"; client.Tenant = "independentsoft.onmicrosoft.com"; client.ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; CommsOperation operation = await client.MuteCall("call-id-123", "mute-context-1"); Console.WriteLine("Call muted. Status: " + operation.Status); // To unmute the call: // CommsOperation unmuteOp = await client.UnmuteCall("call-id-123", "unmute-context-1"); Console.Read(); } catch (GraphException ex) { Console.WriteLine("Error: " + ex.Code); Console.WriteLine("Message: " + ex.Message); Console.Read(); } } } }
VB example
Imports Independentsoft.Graph Imports Independentsoft.Graph.Calls Namespace Sample Class Module1 Shared Sub Main(ByVal args As String()) Dim task = New Task(AddressOf Run) task.Start() Console.Read() End Sub Shared Async Sub Run() Try Dim client As GraphClient = New GraphClient() client.ClientId = "63333333-209e-454e-b7bd-55a4d201270f" client.Tenant = "independentsoft.onmicrosoft.com" client.ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" Dim operation As CommsOperation = Await client.MuteCall("call-id-123", "mute-context-1") Console.WriteLine("Call muted. Status: " & operation.Status) ' To unmute the call: ' Dim unmuteOp As CommsOperation = Await client.UnmuteCall("call-id-123", "unmute-context-1") Catch ex As GraphException Console.WriteLine("Error: " + ex.Code) Console.WriteLine("Error: " + ex.Message) Console.Read() End Try End Sub End Class End Namespace
Need help? Ask our developers:
Name*
Email*
Message*