Bitzsoft.Integrations.OutboundCall.Volcengine
1.0.1
dotnet add package Bitzsoft.Integrations.OutboundCall.Volcengine --version 1.0.1
NuGet\Install-Package Bitzsoft.Integrations.OutboundCall.Volcengine -Version 1.0.1
<PackageReference Include="Bitzsoft.Integrations.OutboundCall.Volcengine" Version="1.0.1" />
<PackageVersion Include="Bitzsoft.Integrations.OutboundCall.Volcengine" Version="1.0.1" />
<PackageReference Include="Bitzsoft.Integrations.OutboundCall.Volcengine" />
paket add Bitzsoft.Integrations.OutboundCall.Volcengine --version 1.0.1
#r "nuget: Bitzsoft.Integrations.OutboundCall.Volcengine, 1.0.1"
#:package Bitzsoft.Integrations.OutboundCall.Volcengine@1.0.1
#addin nuget:?package=Bitzsoft.Integrations.OutboundCall.Volcengine&version=1.0.1
#tool nuget:?package=Bitzsoft.Integrations.OutboundCall.Volcengine&version=1.0.1
Bitzsoft.Integrations.OutboundCall.Volcengine
火山引擎智能外呼实现 — 基于 AI 外呼机器人 REST API(AccessKeyID + SecretKey,签名 V4 / HMAC-SHA256),实现 IOutboundCallService 统一接口。
功能特性
- 实现
IOutboundCallService统一接口:创建 / 暂停 / 恢复 / 停止外呼任务 + 任务列表 / 详情查询 + 通话记录查询 - 创建即启动:火山引擎
CreateTask创建任务后自动启动,无需额外调用StartCampaign(接口兼容返回成功) - 号码追加:
AppendNumbers向已有任务动态追加被叫号码 - 火山引擎签名 V4 鉴权:
HMAC-SHA256计算签名,Authorization头携带Credential(AccessKeyId)与Signature,配合X-Date/X-AK头 - 境内外主叫分离:基于
CreateCampaignRequest.Region选择Callers/OverseaCallers - 白名单 / 黑名单过滤:创建任务前自动过滤号码(复用
CallListFilter),过滤后无可用号码直接返回失败 - 任务状态映射:将火山引擎状态(
pending/running/paused/completed/stopped/failed等)映射为统一CampaignStatus
安装
.NET CLI
dotnet add package Bitzsoft.Integrations.OutboundCall.Volcengine
PackageReference
<PackageReference Include="Bitzsoft.Integrations.OutboundCall.Volcengine" Version="1.0.0" />
配置
appsettings.json
{
"OutboundCall": {
"AccessKeyId": "AKxxxxxxxxxxxxxxxx",
"AccessKeySecret": "SKxxxxxxxxxxxxxxxx",
"Endpoint": "https://visual.volcengineapi.com",
"Callers": [ "01012345678" ],
"OverseaCallers": [],
"Whitelist": [ "5678" ],
"RequireWhitelistInNonProduction": true
}
}
| 配置项 | 说明 | 必填 | 默认值 |
|---|---|---|---|
AccessKeyId |
火山引擎 AccessKeyID | 是 | 空字符串 |
AccessKeySecret |
火山引擎 SecretKey | 是 | 空字符串 |
Endpoint |
API 端点覆盖 | 否 | https://visual.volcengineapi.com |
Callers |
境内主叫号码列表 | 是 | 空列表 |
OverseaCallers |
境外主叫号码列表 | 否 | 空列表 |
Whitelist |
白名单(防误呼,支持后缀匹配) | 否 | null |
RequireWhitelistInNonProduction |
非生产环境强制白名单 | 否 | true |
注册服务
委托配置
using Bitzsoft.Integrations.OutboundCall;
// 命名空间 Microsoft.Extensions.DependencyInjection
builder.Services.AddVolcengineOutboundCall(options =>
{
options.AccessKeyId = "AKxxxxxxxxxxxxxxxx";
options.AccessKeySecret = "SKxxxxxxxxxxxxxxxx";
options.Callers = new() { "01012345678" };
});
从 IConfiguration 绑定
builder.Services.AddVolcengineOutboundCall(
builder.Configuration.GetSection("OutboundCall"));
说明:
AddVolcengineOutboundCall接收Action<OutboundCallOptions>配置委托,绑定到OutboundCallOptions,注册VolcengineOutboundCallService为 typed client(挂载请求审计日志),并注册为IOutboundCallService单例。
使用示例
创建任务 + 追加号码 + 控制
using Bitzsoft.Integrations.OutboundCall;
using Bitzsoft.Integrations.OutboundCall.Dtos;
using Bitzsoft.Integrations.OutboundCall.PhoneNumber;
public class VolcCallService
{
private readonly IOutboundCallService _outbound;
public VolcCallService(IOutboundCallService outbound) => _outbound = outbound;
public async Task RunAsync(string[] rawPhones)
{
var (mainland, _) = PhoneNumberClassifier.Classify(rawPhones);
// 1. 创建任务(火山引擎创建即启动,返回 task_id)
var resp = await _outbound.CreateCampaignAsync(new CreateCampaignRequest
{
Name = "智能外呼",
Region = PhoneRegion.Mainland,
Callees = mainland.ToList(),
MaxAttempts = 2,
NotBefore = DateTimeOffset.UtcNow,
NotAfter = DateTimeOffset.UtcNow.AddHours(2)
});
// 2. 追加号码(AppendNumbers)
await _outbound.ImportContactsAsync(new ImportContactsRequest
{
CampaignId = resp.CampaignId,
Contacts = new() { "0086139xxxxxxxx" }
});
// 3. 暂停 / 恢复 / 停止
await _outbound.PauseCampaignAsync(resp.CampaignId);
await _outbound.ResumeCampaignAsync(resp.CampaignId);
await _outbound.StopCampaignAsync(resp.CampaignId);
}
}
查询任务与话单
// 查询任务列表
var tasks = await _outbound.ListCampaignsAsync(pageIndex: 1, pageSize: 20);
// 查询单个任务详情
var detail = await _outbound.GetCampaignAsync(taskId);
// 查询任务的通话记录(含录音 URL)
var records = await _outbound.QueryCallRecordsAsync(new QueryCallRecordsRequest
{
CampaignId = taskId,
PageSize = 100
});
请求审计
内置 Bitzsoft.Integrations.RequestLogging 出站请求记录管道,默认使用 NullRequestLogStore 不持久化。
// ① 默认:启用记录管道但不持久化(日志丢弃)
services.AddVolcengineOutboundCall(options => { /* ... */ });
// ② 持久化:宿主注册 IRequestLogStore 实现后,所有出站请求自动落库
services.AddRequestLogging<MyRequestLogStore>(opts =>
{
opts.MaxInMemoryBodyBytes = 64 * 1024; // 仅控制内存/加密临时文件切换,不截断正文
opts.SensitiveFields.Add("AccessKeySecret"); // 额外脱敏字段
});
services.AddVolcengineOutboundCall(options => { /* ... */ });
安全说明
- AccessKeyID / SecretKey:火山引擎密钥必须通过环境变量或 Secret Manager 注入,禁止硬编码;SecretKey 仅参与
HMAC-SHA256签名,不出现在请求中 - 签名机制:每次请求实时计算签名,附加
X-Date(Unix 秒时间戳)、X-AK(AccessKeyId)与Authorization头,请求经 HTTPS 发送 - 端点配置:默认端点
https://visual.volcengineapi.com,如使用其他区域或专属端点可通过Endpoint覆盖 - 白名单防护:开发 / 测试环境务必配置
Whitelist,避免误呼叫真实客户
依赖
| 包 | 说明 |
|---|---|
Bitzsoft.Integrations.OutboundCall |
外呼抽象层(IOutboundCallService + OutboundCallOptions) |
Bitzsoft.Integrations.RequestLogging |
出站请求审计日志管道 |
Microsoft.Extensions.Http |
IHttpClientFactory(typed client 连接池) |
Microsoft.Extensions.Logging.Abstractions |
日志抽象 |
Microsoft.Extensions.Options |
选项模式(IOptionsMonitor<OutboundCallOptions>) |
相关包
- Bitzsoft.Integrations.OutboundCall -- 外呼抽象层
- Bitzsoft.Integrations.OutboundCall.Tencent -- 腾讯云 CCC 实现
- Bitzsoft.Integrations.OutboundCall.Aliyun -- 阿里云 CCC 实现
- Bitzsoft.Integrations.OutboundCall.Huawei -- 华为云 CEC 实现
- Bitzsoft.Integrations.OutboundCall.Yuntongxun -- 容联云通讯实现
- Bitzsoft.Integrations.OutboundCall.All -- 聚合包(全部供应商)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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 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. |
-
net10.0
- Bitzsoft.Integrations.OutboundCall (>= 1.0.1)
- Bitzsoft.Integrations.RequestLogging (>= 1.0.1)
- Microsoft.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
-
net5.0
- Bitzsoft.Integrations.OutboundCall (>= 1.0.1)
- Bitzsoft.Integrations.RequestLogging (>= 1.0.1)
- Microsoft.Extensions.Http (>= 5.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 5.0.0)
- Microsoft.Extensions.Options (>= 5.0.0)
-
net8.0
- Bitzsoft.Integrations.OutboundCall (>= 1.0.1)
- Bitzsoft.Integrations.RequestLogging (>= 1.0.1)
- Microsoft.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.OutboundCall.Volcengine:
| Package | Downloads |
|---|---|
|
Bitzsoft.Integrations.OutboundCall.All
外呼服务聚合包 — 包含全部供应商实现(腾讯云/阿里云/火山引擎/容联云/华为云/国际 Twilio/Vonage) |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1 | 69 | 8/3/2026 |
| 1.0.0 | 72 | 8/2/2026 |
| 1.0.0-alpha.10 | 48 | 7/26/2026 |
| 1.0.0-alpha.9 | 51 | 7/12/2026 |
| 1.0.0-alpha.8 | 60 | 7/1/2026 |
| 1.0.0-alpha.7 | 84 | 6/16/2026 |
| 1.0.0-alpha.6 | 73 | 6/16/2026 |