hangup

View as MarkdownOpen in Claude

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

Parameters

reason
str | NoneDefaults to None

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

Returns

Self — The builder instance for method chaining.

Example

from signalwire import SWMLService, SWMLBuilder
service = SWMLService(name="ivr")
builder = SWMLBuilder(service)
doc = (
builder
.answer()
.play(url="https://example.com/goodbye.mp3")
.hangup(reason="Call completed")
.build()
)
print(doc)