Ledon.Sip.Client 0.0.1

dotnet add package Ledon.Sip.Client --version 0.0.1
                    
NuGet\Install-Package Ledon.Sip.Client -Version 0.0.1
                    
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="Ledon.Sip.Client" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ledon.Sip.Client" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Ledon.Sip.Client" />
                    
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 Ledon.Sip.Client --version 0.0.1
                    
#r "nuget: Ledon.Sip.Client, 0.0.1"
                    
#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.
#:package Ledon.Sip.Client@0.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ledon.Sip.Client&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Ledon.Sip.Client&version=0.0.1
                    
Install as a Cake Tool

Ledon.Sip.Client

SIP 客户端(事务用户):基于 Ledon.Sockets.Client 的 socket 库构建,协议解析用 Ledon.Sip。

builder.Services.AddLedonSipClient(o =>
{
    o.Host = "pbx.example.com";
    o.Port = 5060;
});

var client = provider.GetRequiredService<SipClient>();
await client.ConnectAsync();

var response = await client.SendRequestAsync(request);   // 等最终响应(2xx-6xx)

请求需要带 Via 的 branch 参数(事务匹配的依据):

var request = SipParser.CreateRequest("OPTIONS", "sip:pbx.example.com", new Dictionary<string, string>
{
    ["Via"] = $"SIP/2.0/UDP 127.0.0.1;branch=z9hG4bK-{Guid.NewGuid():N}",
    ["From"] = "<sip:me@example.com>;tag=1",
    ["To"] = "<sip:pbx.example.com>",
    ["Call-ID"] = $"{Guid.NewGuid():N}@example.com",
    ["CSeq"] = "1 OPTIONS",
});
  • 事务匹配按 Via branch(RFC 3261 的规定做法);
  • 临时响应(1xx)不完成事务,只记日志;
  • UDP 上指数退避重传(默认 500ms 起,最多 7 次);
  • 超时抛 TimeoutException(默认 32 秒 = Timer B);
  • 传输层(连接/重连/半包拼接)由 Ledon.Sockets.Client 负责。

完整文档:https://github.com/wosledon/ledon-framework

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
0.0.1 47 10/28/2026