> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# answer

> Add an answer verb to the SWML document.

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

## **Parameters**

**`max_duration`** `int | None` — default: None

Maximum call duration in seconds. The call is automatically hung up after this
duration elapses.

---

**`codecs`** `str | None` — default: None

Comma-separated list of audio codecs to use for the call. Valid values include:
`PCMU`, `PCMA`, `G722`, `G729`, `AMR-WB`, `OPUS`, `VP8`, `H264`.

---

## **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)
```