<Hangup/>

Introduction to <Hangup/> Tag in Opentact XML

The <Hangup/> tag in Opentact XML serves a fundamental role in call control by allowing users to gracefully conclude a phone call. When implemented, this tag effectively terminates the call, providing a straightforward way to manage the lifecycle of interactions. Let's explore how the <Hangup/> tag works through an illustrative example:

Immediate Call Termination:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
   <!-- The <Hangup/> tag terminates the call immediately -->
   <Hangup />
</Response>

In this example, the <Hangup/> tag is utilized to terminate the call without any additional actions. As soon as this tag is encountered in the call flow, Opentact promptly ends the ongoing conversation. This functionality is particularly useful for scenarios where an immediate conclusion of the call is desired.

Notification Event Tag:

The <Hangup/> tag also supports a tag field, which plays a crucial role in WebSocket events. This field allows users to specify a tag that provides information about the reason for the hangup. This tag can be used in WebSocket notifications, enabling the client side to understand and respond to specific hangup events.

<?xml version="1.0" encoding="UTF-8"?>
<Response>
   <!-- The <Hangup/> tag with a specified tag field -->
   <Hangup tag="CallEndedByUser" />
</Response>

In this scenario, the tag field is set to "CallEndedByUser," providing a clear indication in WebSocket events that the call termination was initiated by the user.

Seamless Integration:

The <Hangup/> tag seamlessly integrates into call flows, allowing users to strategically manage call durations and streamline communication processes.

Last updated