dial-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Dial webhooks. Use when setting up Dial (phone numbers for AI agents: SMS, iMessage, WhatsApp and AI voice calls) webhook handlers…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Dial Webhooks
When to Use This Skill
- How do I receive Dial webhooks?
- How do I verify Dial webhook signatures (
X-Dial-Signature)? - How do I handle
message.received(SMS, iMessage, WhatsApp) orcall.endedevents? - How do I get a call transcript when
call.transcribedarrives? - Why is my Dial webhook signature verification failing?
- How do I test a Dial webhook with
webhook.ping?
Verification (core)
Dial sends X-Dial-Signature: t=<unix-seconds>,v1=<hex>. v1 is the lowercase hex
HMAC-SHA256 of {t}.{raw request body}, keyed with the full signing secret as a
UTF-8 string, whsec_ prefix included. It is not Standard Webhooks: do not
base64-decode the secret. Always verify against the raw body, never re-serialized
JSON. Dial's docs suggest rejecting timestamps older than 5 minutes; the examples make
that window opt-in (see below).
Dial publishes no webhook verification SDK, so verify manually:
const crypto = require('crypto');
function verifyDialSignature(rawBody, header, secret, toleranceSeconds = 0) {
let t = null;
const v1 = [];
for (const part of String(header || '').split(',')) {
const i = part.indexOf('=');
if (i === -1) continue;
const key = part.slice(0, i).trim();
const value = part.slice(i + 1).trim();
if (key === 't') t = value;
else if (key === 'v1') v1.push(value);
}
if (!t || !/^\d{1,12}$/.test(t) || v1.length === 0) return false;
if (toleranceSeconds > 0 && Math.abs(Date.now() / 1000 - Number(t)) > toleranceSeconds) return false;
const expected = crypto.createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest();
// Check shape first: Buffer.from(x, 'hex') silently truncates invalid hex
return v1.some((sig) => /^[0-9a-f]{64}$/i.test(sig) && crypto.timingSafeEqual(expected, Buffer.from(sig, 'hex')));
}
import hashlib, hmac, time
def verify(raw_body: bytes, header: str, secret: str, tolerance: int = 0) -> bool:
parts = [p.split("=", 1) for p in header.split(",") if "=" in p]
t = next((v.strip() for k, v in parts if k.strip() == "t"), "")
sigs = [v.strip().lower() for k, v in parts if k.strip() == "v1"]
# Cap t at 12 digits: a longer int overflows the float math below (a 500, not a 401)
if not t.isascii() or not t.isdigit() or len(t) > 12 or not sigs:
return False
if tolerance > 0 and abs(time.time() - int(t)) > tolerance:
return False
expected = hmac.new(secret.encode(), t.encode() + b"." + raw_body, hashlib.sha256).hexdigest().encode()
# Compare bytes so a non-ASCII header returns False (401), not a TypeError (500)
return any(hmac.compare_digest(expected, s.encode()) for s in sigs)
Timestamp window is opt-in: Dial signs each of its own retry attempts with a fresh
t, but Hookdeck retries and replays resend the originalt, so a fixed window rejects late redeliveries. The examples skip the check unlessDIAL_WEBHOOK_TOLERANCE_SECONDSis a positive number (e.g.300for Dial's suggested 5 minutes). Either way, dedupe onX-Dial-Event-ID. See references/verification.md.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
Common Event Types
| Event | Triggered When | Common Use Cases |
|---|---|---|
message.received |
An inbound SMS, MMS, iMessage, RCS or WhatsApp message arrives (incl. group messages) | Reply from the agent, read one-time codes |
message.status_changed |
An outbound message is delivered, rejected or read | Confirm delivery, alert on failures, read receipts |
call.status_changed |
A call moves through Queued → Ringing → In-Progress → Terminated |
React the moment a call rings or is answered |
call.ended |
A voice call (inbound or outbound) finishes | Record the outcome and duration |
call.transcribed |
A call's transcript is ready | Fetch GET /api/v1/calls/{id} for the transcript |
number.status_changed |
A phone number's capabilities settle (unsettled / ready / degraded) |
Start using a newly bought number |
webhook.ping |
You fire a test ping at one subscription | Confirm the endpoint is reachable and verifying |
Every delivery has the same envelope: { id, object: "event", type, version, createdAt, relatedObject, data }. Route on type (also in the X-Dial-Event-Type header) and
dedupe on id (also in X-Dial-Event-ID). version is per event type:
number.status_changed is at 2, the others at 1. See
references/overview.md.
Environment Variables
# Full signing secret, whsec_ prefix included
DIAL_WEBHOOK_SECRET=whsec_your_signing_secret
# Optional: max age of the signed timestamp in seconds (unset or 0 = no check;
# Dial's docs suggest 300 for direct delivery)
DIAL_WEBHOOK_TOLERANCE_SECONDS=
PORT=3000
Установить dial-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dial-webhooks?
Receive and verify Dial webhooks. Use when setting up Dial (phone numbers for AI agents: SMS, iMessage, WhatsApp and AI voice calls) webhook handlers, debugging X-Dial-Signature verification, or handling events like message.received, message.status_changed, call.ended and call.transcribed.
Как установить скилл dial-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dial-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic