AgentsSkills

swml_transfer

View as MarkdownOpen in Claude

Transfer calls between agents using SWML or direct connect, with regex pattern matching to route to different destinations from a single tool. Each transfer destination can use either a SWML endpoint URL or a phone number / SIP address.

Tools: transfer_call (default, customizable via tool_name)

Requirements: None

Multi-instance: Yes

transfers
dictRequired

Transfer configurations mapping regex patterns to destinations. Each key is a regex pattern (e.g., /sales/i) and each value is an object with:

  • url (str) — SWML endpoint URL for agent transfer. Mutually exclusive with address.
  • address (str) — Phone number or SIP address for direct connect. Mutually exclusive with url.
  • message (str, default "Transferring you now...") — Message to say before transferring.
  • return_message (str, default "The transfer is complete. How else can I help you?") — Message when returning from transfer.
  • post_process (bool, default True) — Whether to process message with AI before saying.
  • final (bool, default True) — Whether transfer is permanent (True) or temporary (False).
  • from_addr (str, optional) — Caller ID for connect action.
description
strDefaults to Transfer call based on pattern matching

Description for the transfer tool.

parameter_name
strDefaults to transfer_type

Name of the parameter that accepts the transfer type.

parameter_description
strDefaults to The type of transfer to perform

Description for the transfer type parameter.

default_message
strDefaults to Please specify a valid transfer type.

Message when no pattern matches.

default_post_process
boolDefaults to False

Whether to process the default (no-match) message with AI.

required_fields
dictDefaults to {}

Additional required fields to collect before transfer. Keys are field names, values are descriptions. Collected values are saved under call_data in global data.

1from signalwire import AgentBase
2
3class MyAgent(AgentBase):
4 def __init__(self):
5 super().__init__(name="assistant", route="/assistant")
6 self.set_prompt_text("You are a helpful assistant.")
7 self.add_skill("swml_transfer", {
8 "tool_name": "route_call",
9 "transfers": {
10 "/sales/i": {
11 "url": "https://your-server.com/sales-agent",
12 "message": "Let me connect you with our sales team."
13 },
14 "/support/i": {
15 "address": "+15551234567",
16 "final": False
17 }
18 }
19 })
20
21agent = MyAgent()
22agent.serve()