<Tone/>
The <Tone/>
tag in Opentact's XML scripting is utilized to play a specified tone or sequence of tones during a call. This command is often used to generate specific signaling tones or messages for the caller or callee. The <Tone/>
command supports various parameters to customize the tone playback.
Hints:
The
tag
attribute is a string used for call notification events if configured.The
loop
parameter, with a default value of 1, creates multiple copies of the specified tone stream in memory before playing.The
volume
parameter controls the loudness of the tones, expressed as the equivalent in dB (deciBels) in a PCM waveform. A value of 0 represents maximum volume, while negative integers indicate quieter volume.The
don
anddoff
parameters set the on and off durations of the tone cadence.The
hz
parameter is an array that specifies the frequencies of the tones to be played. Multiple frequencies can be provided, and the sequence can be repeated using thex
notation.The
timeout
parameter, with a default value of 30,000 milliseconds, sets the command execution timeout.The
leg
parameter allows you to specify whether the tone should be played on the 'aleg', 'bleg', or 'both'.
Examples:
1 sec 480Hz tone:
Same tone, but louder:
US ringing tone:
These examples showcase the flexibility of the <Tone/>
command, allowing for the creation of diverse tone sequences with customizable attributes.
In this example, the <Tone/>
command is strategically placed within a call flow. The first tone is played immediately after answering the call, creating a distinctive auditory signal. Then, the call proceeds to dial a SIP user. Another tone is played after the dialing operation, adding further audio cues. Finally, a polite message is spoken using <Say/>
, followed by hanging up the call. This example demonstrates how <Tone/>
can be integrated seamlessly into the overall call handling process.
Last updated