Soenneker.Telnyx.Blazor.WebRtc 3.0.21

Prefix Reserved
dotnet add package Soenneker.Telnyx.Blazor.WebRtc --version 3.0.21
                    
NuGet\Install-Package Soenneker.Telnyx.Blazor.WebRtc -Version 3.0.21
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Telnyx.Blazor.WebRtc" Version="3.0.21" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Telnyx.Blazor.WebRtc" Version="3.0.21" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Telnyx.Blazor.WebRtc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Telnyx.Blazor.WebRtc --version 3.0.21
                    
#r "nuget: Soenneker.Telnyx.Blazor.WebRtc, 3.0.21"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Soenneker.Telnyx.Blazor.WebRtc&version=3.0.21
                    
Install Soenneker.Telnyx.Blazor.WebRtc as a Cake Addin
#tool nuget:?package=Soenneker.Telnyx.Blazor.WebRtc&version=3.0.21
                    
Install Soenneker.Telnyx.Blazor.WebRtc as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Telnyx.Blazor.WebRtc

A Blazor WebRTC component library for Telnyx, enabling real-time communication capabilities in your Blazor applications.

Key Features

  • Real-time WebRTC Communication Seamless voice and video calling powered by Telnyx’s browser-based WebRTC SDK.

  • ⚙️ Automatic JS Module Bootstrapping Built-in JavaScript interop initialization with lazy loading and Blazor lifecycle integration.

  • 🎥 High-Quality Audio & Video Calls Support for two-way audio and video with full control over microphone and webcam devices.

  • 📞 Advanced Call Management Programmatic control over call lifecycle: initiate, answer, hangup, hold, resume, mute/unmute, deaf/undeaf, DTMF tones, and more.

  • 🎛 Device Enumeration & Dynamic Selection Enumerate and switch between available microphones, speakers, and cameras at runtime.

  • 📡 Custom Headers & Signaling Options Pass custom SIP headers during call setup for advanced routing or metadata requirements.

  • 🌐 ICE Server & TURN/STUN Configuration Fully configurable ICE server settings for NAT traversal and improved connectivity in restricted networks.

  • 📢 Comprehensive Event Notifications Capture and handle all Telnyx WebRTC events: connection, media stream, call state, device changes, stats reports, and more.

Installation

dotnet add package Soenneker.Telnyx.Blazor.WebRtc

Setup

1. Register Services

In your Program.cs or startup file:

public static async Task Main(string[] args)
{
    var builder = WebApplication.CreateBuilder(args);

    // Register Telnyx WebRTC services
    builder.Services.AddTelnyxWebRtcInteropAsScoped();
}

2. Component Usage

Add the TelnyxWebRtc component to your Blazor page:

@using Soenneker.Telnyx.Blazor.WebRtc

<TelnyxWebRtc @ref="_telnyxWebRtc" Options="@_options" />

@code {
    private ITelnyxWebRtc? _telnyxWebRtc;
    private TelnyxClientOptions _options;

    protected override void OnInitialized()
    {
        _options = new TelnyxClientOptions
        {
           InitOptions = new TelnyxClientInitOptions
           {
              Login = "YOUR_TELNYX_LOGIN",
              Password = "YOUR_TELNYX_PASSWORD"
              // Set other properties as needed
           }
        };
    }
}

Events

The component provides various events you can subscribe to:

_telnyxWebRtc.OnInitialize += HandleInitialize;
_telnyxWebRtc.OnReady += HandleReady;
_telnyxWebRtc.OnError += HandleError;
_telnyxWebRtc.OnMessage += HandleMessage;
_telnyxWebRtc.OnNotification += HandleNotification;
_telnyxWebRtc.OnCallInitiated += HandleCallInitiated;
_telnyxWebRtc.OnCallAnswered += HandleCallAnswered;
_telnyxWebRtc.OnCallHeld += HandleCallHeld;
_telnyxWebRtc.OnCallResumed += HandleCallResumed;
_telnyxWebRtc.OnCallHangup += HandleCallHangup;
...

Example Usage

Making a Call

var callOptions = new TelnyxCallOptions
{
    DestinationNumber = "+1234567890",
    CallerName = "John Doe",
    CallerNumber = "+1987654321"
};

await _telnyxWebRtc.Call(callOptions);

Answering a Call

var answerOptions = new TelnyxAnswerOptions
{
    AutoPlayAudio = true
};

await _telnyxWebRtc.Answer(answerOptions);

Hanging Up

await _telnyxWebRtc.Hangup();
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.21 19 5/25/2025
3.0.20 21 5/25/2025
3.0.19 44 5/23/2025
3.0.18 58 5/23/2025
3.0.17 58 5/23/2025
3.0.16 76 5/23/2025
3.0.15 86 5/23/2025
3.0.14 88 5/23/2025
3.0.13 96 5/23/2025
3.0.12 102 5/22/2025
3.0.11 100 5/22/2025
3.0.10 109 5/22/2025
3.0.9 132 5/19/2025
3.0.8 119 5/18/2025
3.0.7 76 5/18/2025
3.0.6 212 5/15/2025
3.0.5 203 5/15/2025
3.0.4 210 5/15/2025
3.0.3 207 5/14/2025
3.0.2 205 5/14/2025
3.0.1 204 5/14/2025