The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.
TypeScript ai-receptionistanswering-serviceappointment-bookinglivekitlocal-firstmcpopen-sourceself-hostedsiptelephonytypescriptvoice-agentvoice-ai
call.dial: own permission call:dial, rights and tenancy lists (PR 1970)
Tim Gutberlet4508bb0bc7fb
diff --git a/apps/api/test/tenancy.test.ts b/apps/api/test/tenancy.test.tsindex 55b0dab8..8661693c 100644--- a/apps/api/test/tenancy.test.ts+++ b/apps/api/test/tenancy.test.ts@@ -171,6 +171,7 @@ describe('agent-facing actions', () => {...onCall('x').map(([name]) => name),'call.start','call.startTest',+ 'call.startOutbound','call.findForTest','call.listNumbers','call.newCallerForTest',diff --git a/docs/api.md b/docs/api.mdindex 7b41188f..87398824 100644--- a/docs/api.md+++ b/docs/api.md@@ -36,7 +36,7 @@ To publish another action, add `public: true` to its `defineAction` and make sur## Outbound calls (call.dial)-An AI agent with a workspace key (owner or admin role) or a personal key asks the assistant to phone someone: `call.dial` (`call_dial` over MCP, `POST /v1/actions/call.dial`), public, `settings:write` (`packages/actions/src/calls.ts`, `apps/api/src/outbound-call.ts`, `apps/agent/src/outbound-dial.ts`).+An AI agent with a workspace key (owner or admin role) or a personal key asks the assistant to phone someone: `call.dial` (`call_dial` over MCP, `POST /v1/actions/call.dial`), public, `call:dial` (owners and admins only, `packages/actions/src/calls.ts`, `apps/api/src/outbound-call.ts`, `apps/agent/src/outbound-dial.ts`).- **Input:** `to` (E.164, a country the workspace may call: the countries of its numbers plus the install's `OUTBOUND_COUNTRIES` or Server admin's list, as for transfers; no emergency, premium or service numbers), `goal` (10 to 4000 characters: what to find out, pass on or arrange), `first_sentence` (what the assistant says when the person picks up), optional `language` (a language code; missing: the assistant's main language) and `assistantId` (missing: the one answering the workspace's first number). Answers `data: { room, to, from, assistantId }`.- **How it runs:** the API starts the voice agent in a new room (`outbound-<uuid>`) through LiveKit's `AgentDispatchService/CreateDispatch`, with whom to call and why in the dispatch metadata (set with the install's LiveKit key, so no client can write it). The agent registers the call (`call.startOutbound`, agent only: direction `out`, `from_number` the business number, `to_number` the person), then dials through the same trunk a warm transfer from that number uses and shows the business number. Only after the pickup does the assistant speak: the first sentence, then the conversation with the goal added to its instructions for this call (`outboundInstructions`). Nobody answering, busy or refused: the call is filed with a system line and the room closes.diff --git a/integrations/zapier/generated/actions.json b/integrations/zapier/generated/actions.jsonindex 3b9f71dd..849cf0f1 100644--- a/integrations/zapier/generated/actions.json+++ b/integrations/zapier/generated/actions.json@@ -385,7 +385,7 @@"label": "Dial Call","noun": "Call","description": "Have the assistant phone someone now: it calls `to` (E.164, in a country the workspace may call, see outbound.countries) from its own Linedesk number and works towards `goal` (what to find out, pass on or arrange, and when to end the call; in full sentences). `first_sentence`: the first thing it says when the person picks up, in the call's language (e.g. \"Hello, this is Maya from Brightwater Plumbing, I'm calling about your appointment tomorrow.\"). `language`: the language it speaks on this call (a language code, e.g. de or en; missing: the assistant's main language). `assistantId`: which assistant calls (missing: the one answering the workspace's first number). The answer has the call's `room`; the call shows up in calls_list (direction out) once it rings, with its transcript and summary after it ends, and the call-end webhook is sent like for every call.",- "permission": "settings:write",+ "permission": "call:dial","destructive": true,"fields": [{diff --git a/packages/actions/src/calls.ts b/packages/actions/src/calls.tsindex 568cb933..1dc896f0 100644--- a/packages/actions/src/calls.ts+++ b/packages/actions/src/calls.ts@@ -269,7 +269,7 @@ export const callDial = defineAction({language: z.enum(languageCodes as [Language, ...Language[]]).optional(),assistantId: z.string().min(1).optional(),}),- permission: 'settings:write',+ permission: 'call:dial',public: true,// It reaches a person outside the business: MCP clients ask first, and only admin keys get it.destructive: true,diff --git a/packages/actions/src/define.ts b/packages/actions/src/define.tsindex 424061d5..c9c181bd 100644--- a/packages/actions/src/define.ts+++ b/packages/actions/src/define.ts@@ -19,6 +19,7 @@ import type { z } from 'zod'* and never to a key, so a key never makes or revokes keys.*//** `call:export`: every call of a date range at once (call.export), owners and admins only. */+/** `call:dial`: the assistant phones someone (call.dial, outbound AI calls), owners and admins only: it costs money. *//*** `call:erase`: a deleted call erased at once instead of after 30 days (call.delete with `permanent`), owners and admins* only: it cannot be undone. Not an action's permission; the call.delete handler checks it.@@ -56,6 +57,7 @@ export type Permission =| 'call:write'| 'call:export'| 'call:erase'+ | 'call:dial'| 'contact:write'| 'settings:write'| 'calendar:read'@@ -82,6 +84,7 @@ export const rolePermissions: Record<Role, readonly Permission[]> = {'call:write','call:export','call:erase',+ 'call:dial','contact:write','settings:write','calendar:read',@@ -97,6 +100,7 @@ export const rolePermissions: Record<Role, readonly Permission[]> = {'call:write','call:export','call:erase',+ 'call:dial','contact:write','settings:write','calendar:read',diff --git a/packages/actions/src/openapi.test.ts b/packages/actions/src/openapi.test.tsindex fb82d9ee..0a38a48c 100644--- a/packages/actions/src/openapi.test.ts+++ b/packages/actions/src/openapi.test.ts@@ -19,7 +19,7 @@ describe('OpenAPI document', () => {test('deleting, cancelling, moving, blocking and filing as spam are marked destructive (MCP: admin keys only)', () => {const destructive = [...actions.values()].filter(a => a.destructive).map(a => a.name)- expect(destructive.sort()).toEqual(['appointment.cancel', 'appointment.reschedule', 'call.delete', 'call.markSpam', 'contact.block', 'contact.delete'])+ expect(destructive.sort()).toEqual(['appointment.cancel', 'appointment.reschedule', 'call.delete', 'call.dial', 'call.markSpam', 'contact.block', 'contact.delete'])for (const a of actions.values()) if (a.destructive) expect(a.public).toBe(true)})diff --git a/packages/actions/src/rights.test.ts b/packages/actions/src/rights.test.tsindex b369f799..30bde9e6 100644--- a/packages/actions/src/rights.test.ts+++ b/packages/actions/src/rights.test.ts@@ -74,6 +74,8 @@ const expectedRights: Record<Right, readonly string[]> = {'agentSetup.createWorkspaceKey','agentSetup.revokeWorkspace','call.export',+ // Outbound AI calls (LIN-873): they cost money and reach people outside the business.+ 'call.dial','assistant.update',// Call email routing (LIN-369): who gets which call, and the outside addresses it may name.'emailRouting.get',@@ -206,6 +208,7 @@ const expectedRights: Record<Right, readonly string[]> = {],agent: ['call.start',+ 'call.startOutbound','call.appendTranscript','call.finish','call.recordTimings',@@ -453,7 +456,7 @@ describe('workspace rights', () => {it('members change no workspace setting: settings, team, keys and webhooks are for admins', () => {for (const name of expectedRights.member) {const def = actions.get(name)!- expect(['settings:write', 'team:write', 'workspace:own', 'call:export'], name).not.toContain(def.permission)+ expect(['settings:write', 'team:write', 'workspace:own', 'call:export', 'call:dial'], name).not.toContain(def.permission)}})