hangup

View as MarkdownOpen in Claude

Add a hangup verb to the main section. Ends the current call.

Parameters

reason
Optional[str]

Reason for the hangup. Valid values: "hangup", "busy", "decline".

Returns

Self — The builder instance for method chaining.

Example

1from signalwire import SWMLService, SWMLBuilder
2
3service = SWMLService(name="ivr")
4builder = SWMLBuilder(service)
5
6doc = (
7 builder
8 .answer()
9 .play(url="https://example.com/goodbye.mp3")
10 .hangup(reason="Call completed")
11 .build()
12)
13print(doc)