惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
爱范儿
爱范儿
量子位
Martin Fowler
Martin Fowler
V
V2EX
博客园 - 三生石上(FineUI控件)
I
InfoQ
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
Engineering at Meta
Engineering at Meta

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: sequence meet dtmf before realtime bridge · openclaw...
steipete · 2026-05-01 · via Recent Commits to openclaw:main

@@ -3,6 +3,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";

33

const {

44

addTranscriptEntryMock,

55

clearMaxDurationTimerMock,

6+

generateDtmfRedirectTwimlMock,

67

generateNotifyTwimlMock,

78

getCallByProviderCallIdMock,

89

mapVoiceToPollyMock,

@@ -12,6 +13,7 @@ const {

1213

} = vi.hoisted(() => ({

1314

addTranscriptEntryMock: vi.fn(),

1415

clearMaxDurationTimerMock: vi.fn(),

16+

generateDtmfRedirectTwimlMock: vi.fn(),

1517

generateNotifyTwimlMock: vi.fn(),

1618

getCallByProviderCallIdMock: vi.fn(),

1719

mapVoiceToPollyMock: vi.fn(),

@@ -45,6 +47,7 @@ vi.mock("../voice-mapping.js", () => ({

4547

}));

46484749

vi.mock("./twiml.js", () => ({

50+

generateDtmfRedirectTwiml: generateDtmfRedirectTwimlMock,

4851

generateNotifyTwiml: generateNotifyTwimlMock,

4952

}));

5053

@@ -69,6 +72,7 @@ describe("voice-call outbound helpers", () => {

6972

beforeEach(() => {

7073

vi.clearAllMocks();

7174

mapVoiceToPollyMock.mockReturnValue("Polly.Joanna");

75+

generateDtmfRedirectTwimlMock.mockReturnValue("<DtmfRedirect />");

7276

generateNotifyTwimlMock.mockReturnValue("<Response />");

7377

});

7478

@@ -169,6 +173,51 @@ describe("voice-call outbound helpers", () => {

169173

expect(persistCallRecordMock).toHaveBeenCalledTimes(2);

170174

});

171175176+

it("initiates conversation calls with pre-connect DTMF TwiML", async () => {

177+

const initiateProviderCall = vi.fn(async () => ({ providerCallId: "provider-1" }));

178+

const ctx = {

179+

activeCalls: new Map(),

180+

providerCallIdMap: new Map(),

181+

provider: { name: "twilio", initiateCall: initiateProviderCall },

182+

config: {

183+

maxConcurrentCalls: 3,

184+

outbound: { defaultMode: "conversation" },

185+

fromNumber: "+14155550100",

186+

},

187+

storePath: "/tmp/voice-call.json",

188+

webhookUrl: "https://example.com/webhook",

189+

};

190+191+

const result = await initiateCall(ctx as never, "+14155550123", "session-1", {

192+

mode: "conversation",

193+

message: "hello meet",

194+

dtmfSequence: "ww123456#",

195+

});

196+197+

expect(result).toEqual({

198+

callId: expect.any(String),

199+

success: true,

200+

});

201+

const callId = result.callId;

202+203+

expect(generateDtmfRedirectTwimlMock).toHaveBeenCalledWith(

204+

"ww123456#",

205+

"https://example.com/webhook",

206+

);

207+

expect(initiateProviderCall).toHaveBeenCalledWith({

208+

callId,

209+

from: "+14155550100",

210+

to: "+14155550123",

211+

webhookUrl: "https://example.com/webhook",

212+

inlineTwiml: undefined,

213+

preConnectTwiml: "<DtmfRedirect />",

214+

});

215+

expect(ctx.activeCalls.get(callId)?.metadata).toMatchObject({

216+

initialMessage: "hello meet",

217+

mode: "conversation",

218+

});

219+

});

220+172221

it("fails initiateCall cleanly when provider initiation throws", async () => {

173222

const ctx = {

174223

activeCalls: new Map(),