***

title: answer
slug: /reference/python/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="max_duration" type="Optional[int]" toc={true}>
  Maximum call duration in seconds. The call is automatically hung up after this
  duration elapses.
</ParamField>

<ParamField path="codecs" type="Optional[str]" toc={true}>
  Comma-separated list of audio codecs to use for the call. Valid values include:
  `PCMU`, `PCMA`, `G722`, `G729`, `AMR-WB`, `OPUS`, `VP8`, `H264`.
</ParamField>

## **Returns**

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

## **Example**

```python {8}
from signalwire import SWMLService, SWMLBuilder

service = SWMLService(name="my-service")
builder = SWMLBuilder(service)

doc = (
    builder
    .answer(max_duration=3600)
    .play(url="https://example.com/welcome.mp3")
    .build()
)
print(doc)
```