For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
        • addAction
        • addActions
        • addDynamicHints
        • clearDynamicHints
        • connect
        • createPaymentAction
        • createPaymentParameter
        • createPaymentPrompt
        • enableExtensiveData
        • enableFunctionsOnTimeout
        • executeRpc
        • executeSwml
        • hangup
        • hold
        • joinConference
        • joinRoom
        • pay
        • playBackgroundFile
        • recordCall
        • removeGlobalData
        • removeMetadata
        • replaceInHistory
        • rpcAiMessage
        • rpcAiUnhold
        • rpcDial
        • say
        • sendSms
        • setEndOfSpeechTimeout
        • setMetadata
        • setPostProcess
        • setResponse
        • setSpeechEventTimeout
        • simulateUserInput
        • sipRefer
        • stop
        • stopBackgroundFile
        • stopRecordCall
        • stopTap
        • switchContext
        • swmlChangeContext
        • swmlChangeStep
        • swmlTransfer
        • swmlUserEvent
        • tap
        • toDict
        • toggleFunctions
        • updateGlobalData
        • updateSettings
        • waitForUser
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Parameters
  • Returns
  • Examples
  • Permanent Transfer
  • Temporary Transfer
  • Custom Caller ID
AgentsFunctionResult

connect

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

createPaymentAction

Next
Built with

Transfer or connect the call to another destination. Generates a SWML connect verb under the hood.

When final is true (the default), the call permanently leaves the agent. When final is false, the call returns to the agent if the far end hangs up first.

Parameters

destination
stringRequired

Where to connect the call. Accepts a phone number in E.164 format (e.g., "+15551234567") or a SIP address (e.g., "support@company.com").

final
booleanDefaults to true

Whether this is a permanent transfer.

  • true — call exits the agent completely (terminal action)
  • false — call returns to the agent when the far end hangs up
fromAddr
string | undefinedDefaults to undefined

Caller ID override. Phone number or SIP address to show as the caller. When undefined, the current call’s originating address is used.

Returns

FunctionResult — this, for chaining.

Examples

Permanent Transfer

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult('Transferring you to sales.')
4 .connect('+15551234567');

Temporary Transfer

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult('Connecting you to a specialist.')
4 .connect('+15551234567', false);

Custom Caller ID

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult('Transferring now.')
4 .connect('support@company.com', true, '+15559876543');