SwmlTransferSkill

View as MarkdownOpen in Claude

Transfer calls using SWML transfer actions. Supports named pattern-based transfers with friendly destination names, or arbitrary direct-destination transfers.

Class: SwmlTransferSkill

Tools: transfer_call (always), list_transfer_destinations (when patterns are configured)

Env vars: None

patterns
Record<string, unknown>[]

Array of named transfer patterns. Each object has:

  • name (string, required) — Friendly name for the destination.
  • destination (string, required) — SIP URI, phone number, or agent URL.
  • description (string, optional) — Human-readable description.
allow_arbitrary
boolean

Whether to allow transfers to arbitrary destinations not in the patterns list. Defaults to true when no patterns are configured, false when patterns exist.

default_message
stringDefaults to Transferring your call now.

Default message to say before transferring.

1import { AgentBase, SwmlTransferSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new SwmlTransferSkill({
7 patterns: [
8 {
9 name: 'sales',
10 destination: 'https://your-server.com/sales-agent',
11 description: 'Sales team',
12 },
13 {
14 name: 'support',
15 destination: '+15551234567',
16 description: 'Technical support line',
17 },
18 ],
19 default_message: 'Let me connect you now.',
20}));
21
22agent.run();