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
        • addAnswerVerb
        • addFunctionInclude
        • addHint
        • addHints
        • addInternalFiller
        • addLanguage
        • addMcpServer
        • addPatternHint
        • addPostAiVerb
        • addPostAnswerVerb
        • addPreAnswerVerb
        • addPronunciation
        • addSkill
        • addSkillByName
        • addSwaigQueryParams
        • asRouter
        • autoMapSipUsernames
        • clearPostAiVerbs
        • clearPostAnswerVerbs
        • clearPreAnswerVerbs
        • clearSwaigQueryParams
        • defineContexts
        • defineTool
        • defineTools
        • defineTypedTool
        • enableDebugEvents
        • enableDebugRoutes
        • enableMcpServer
        • enableSipRouting
        • extractSipUsername
        • getApp
        • getBasicAuthCredentials
        • getFullUrl
        • getMcpServers
        • getName
        • getPostPrompt
        • getPrompt
        • getPromptPom
        • getRegisteredTools
        • getTool
        • handleMcpRequest
        • hasSkill
        • isMcpServerEnabled
        • listSkills
        • manualSetProxyUrl
        • onDebugEvent
        • onFunctionCall
        • onSummary
        • onSwmlRequest
        • promptAddSection
        • promptAddSubsection
        • promptAddToSection
        • promptHasSection
        • registerSipUsername
        • registerSwaigFunction
        • removeSkill
        • removeSkillByName
        • renderSwml
        • resetContexts
        • run
        • serve
        • setDynamicConfigCallback
        • setFunctionIncludes
        • setGlobalData
        • setInternalFillers
        • setLanguages
        • setNativeFunctions
        • setParam
        • setParams
        • setPostPrompt
        • setPostPromptLlmParams
        • setPostPromptUrl
        • setPromptLlmParams
        • setPromptPom
        • setPromptText
        • setPronunciations
        • setupGracefulShutdown
        • setWebHookUrl
        • updateGlobalData
        • validateBasicAuth
        • validateToolToken
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • 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
  • Example
AgentsAgentBase

addPreAnswerVerb

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

addPronunciation

Next
Built with

Add a verb to run before the call is answered (phase 1). Pre-answer verbs execute while the call is still ringing.

Only certain verbs are safe before answering. The platform may ignore or reject verbs that require an active media session. Verbs with auto_answer capability (like play and connect) must include "auto_answer": false in their config to prevent automatic answering.

Safe pre-answer verbs: transfer, execute, return, label, goto, request, switch, cond, if, eval, set, unset, hangup, send_sms, sleep, stop_record_call, stop_denoise, stop_tap.

Parameters

verbName
stringRequired

SWML verb name (e.g., "play", "sleep", "request").

config
Record<string, unknown>Required

Verb configuration object. See the SWML reference for verb-specific parameters.

Returns

AgentBase — Returns this for method chaining.

Example

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'support', route: '/support' });
4agent.setPromptText('You are a helpful assistant.');
5agent.addPreAnswerVerb('play', {
6 urls: ['ring:us'],
7 auto_answer: false,
8});
9await agent.serve();