answer

View as MarkdownOpen in Claude

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

Parameters

max_duration
Optional[int]

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

codecs
Optional[str]

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

1from signalwire import SWMLService, SWMLBuilder
2
3service = SWMLService(name="my-service")
4builder = SWMLBuilder(service)
5
6doc = (
7 builder
8 .answer(max_duration=3600)
9 .play(url="https://example.com/welcome.mp3")
10 .build()
11)
12print(doc)