addVerb

View as MarkdownOpen in Claude

Add a verb to the main section of the current SWML document. Delegates to the underlying SwmlBuilder’s addVerb() method.

Parameters

name
stringRequired

The SWML verb name (e.g., "answer", "play", "ai", "hangup", "connect").

config
unknownRequired

Configuration for the verb.

Returns

this — Returns the service for method chaining.

Example

1import { SWMLService } from '@signalwire/sdk';
2
3const service = new SWMLService({ name: 'my-ivr' });
4service
5 .addVerb('answer', {})
6 .addVerb('play', { url: 'https://example.com/greeting.mp3' })
7 .addVerb('hangup', {});