***

title: answer
slug: /reference/typescript/agents/swml-builder/answer
description: Add an answer verb to the SWML document.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Add an `answer` verb to the main section. Answers an incoming call.

## **Parameters**

<ParamField path="config" type="Record<string, unknown> | undefined" toc={true}>
  Optional configuration object for the answer verb. Supported keys:

  * `max_duration` (`number`) -- Maximum call duration in seconds.
  * `codecs` (`string`) -- Comma-separated list of codecs to offer. Valid codecs: `PCMU`, `PCMA`, `G722`, `G729`, `AMR-WB`, `OPUS`, `VP8`, `H264`.
  * `username` (`string`) -- Username for SIP authentication.
  * `password` (`string`) -- Password for SIP authentication.
</ParamField>

## **Returns**

`this` -- The builder instance for method chaining.

## **Example**

```typescript {4}
import { SwmlBuilder } from '@signalwire/sdk';

const builder = new SwmlBuilder();
builder.answer({ max_duration: 3600 });
builder.play({ url: 'https://example.com/audio.mp3' });
builder.hangup();
```