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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
B
Blog
Jina AI
Jina AI
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
美团技术团队
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
The Cloudflare Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
小众软件
小众软件
罗磊的独立博客
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
GbyAI
GbyAI
腾讯CDC
MongoDB | Blog
MongoDB | Blog

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(telnyx): validate webhook client state base64 · openc...
vincentkoc · 2026-05-14 · via Recent Commits to openclaw:main

File tree

  • extensions/voice-call/src/providers

Original file line numberDiff line numberDiff line change

@@ -43,6 +43,7 @@ Docs: https://docs.openclaw.ai

4343

- Microsoft Teams: reject malformed inline HTML image base64 padding instead of decoding corrupted `data:` image attachments.

4444

- Voice-call realtime: ignore malformed provider media-frame base64 before forwarding audio into bridge and transcription paths.

4545

- QQBot: reject malformed stored cron payload base64 before JSON decoding structured reminder data.

46+

- Telnyx voice-call: use the raw `client_state` fallback when webhook state is malformed base64 instead of using silently corrupted decoded text.

4647

- Models config/auth: stop inferring provider env-var markers from broad `^[A-Z_][A-Z0-9_]*$` strings, and resolve config-backed provider `apiKey` values only through structured env SecretRefs (`secrets.providers[id]` / `secrets.defaults`), so unrelated env vars cannot accidentally become provider credentials. Thanks @sallyom.

4748

- Media fetch: skip allocating and buffering the response body for bodyless media responses (HEAD probes and 204-style empty bodies), avoiding wasted heap on streams that carry no payload. Thanks @shakkernerd.

4849

- CLI/onboarding: forward provider-specific auth flags (e.g. `--openai-api-key`) through the onboarding wizard so they reach provider auth methods via `ctx.opts`, letting `--openai-api-key "$OPENAI_API_KEY"` skip the redundant "use existing env var?" prompt in non-interactive harnesses. (#81669) Thanks @sjf.

Original file line numberDiff line numberDiff line change

@@ -249,6 +249,31 @@ describe("TelnyxProvider.parseWebhookEvent", () => {

249249

expect(event?.to).toBe("+15550000000");

250250

});

251251
252+

it("uses raw client_state fallback when client_state is malformed base64", () => {

253+

const provider = new TelnyxProvider({

254+

apiKey: "KEY123",

255+

connectionId: "CONN456",

256+

publicKey: undefined,

257+

});

258+

const result = provider.parseWebhookEvent(

259+

createCtx({

260+

rawBody: JSON.stringify({

261+

data: {

262+

id: "evt-client-state",

263+

event_type: "call.initiated",

264+

payload: {

265+

call_control_id: "call-fallback",

266+

client_state: "call-1@@@",

267+

},

268+

},

269+

}),

270+

}),

271+

);

272+
273+

expect(result.events).toHaveLength(1);

274+

expect(result.events[0]?.callId).toBe("call-1@@@");

275+

});

276+
252277

it("reads transcription text from Telnyx transcription_data payloads", () => {

253278

const provider = new TelnyxProvider({

254279

apiKey: "KEY123",

Original file line numberDiff line numberDiff line change

@@ -47,6 +47,18 @@ function normalizeTelnyxDirection(

4747

}

4848

}

4949
50+

function normalizeBase64ForCompare(value: string): string {

51+

return value.replace(/=+$/u, "").replace(/-/gu, "+").replace(/_/gu, "/");

52+

}

53+
54+

function decodeClientStateBase64(value: string): string | null {

55+

const buffer = Buffer.from(value, "base64");

56+

if (normalizeBase64ForCompare(buffer.toString("base64")) !== normalizeBase64ForCompare(value)) {

57+

return null;

58+

}

59+

return buffer.toString("utf8");

60+

}

61+
5062

export class TelnyxProvider implements VoiceCallProvider {

5163

readonly name = "telnyx" as const;

5264

@@ -142,12 +154,7 @@ export class TelnyxProvider implements VoiceCallProvider {

142154

// Decode client_state from Base64 (we encode it in initiateCall)

143155

let callId = "";

144156

if (data.payload?.client_state) {

145-

try {

146-

callId = Buffer.from(data.payload.client_state, "base64").toString("utf8");

147-

} catch {

148-

// Fallback if not valid Base64

149-

callId = data.payload.client_state;

150-

}

157+

callId = decodeClientStateBase64(data.payload.client_state) ?? data.payload.client_state;

151158

}

152159

if (!callId) {

153160

callId = data.payload?.call_control_id || "";