Opentact
  • Opentact Introduction
  • KEY CONCEPTS
    • Basic Concept
      • Voice Capability
        • Managing Inbound Calls
      • SMS Capability
      • Number Capability
    • Phone Number
      • Voice Enablement
      • SMS Enablement
      • TN Profile
        • Blacklist Caller ID
        • Whitelist Caller ID
    • SIP Control APP
      • Specify Remote Call Control URL
      • Specify Dialplan XML
    • SIP Trunking
    • Messaging
      • Quick Start Guide
      • Prepare Phone Numbers for SMS
    • SIP Connection
      • Associate SIP Connection with Phone Number
    • SIP Domain
      • Send Outbound Call with SIP Domain
      • Receive Inbound Call to SIP User
        • Web Call
        • Zoiper SIP Client
    • SIP Users
      • Create a SIPUser
      • Create a SIPUserInvite
    • Telecom Data
  • Opentact API Documentation
    • Opentact API Integration
      • API Environment
      • Opentact API keys
      • Passing Authentication
      • Authentication API
        • Example API Call
        • Authentiction with Gmail
    • TN Profile
      • Add and Remove Blacklist to TN Profile
        • Example API Call
      • Add and Remove Whitelist to TN Profile
        • Example API Call
    • Phone Number
      • Order Phone Number
        • Example API Usage
      • Release a Number
        • Example API Usage
      • Get all Purchased Numbers
      • Number Search
        • Example API Usage
    • SIP Connection
      • Remove Number from SIP Connection
      • Get Number for a SIP Connection
      • Update SIP Connections
      • Create SIP Conenctions
      • Delete SIP Connections
      • List SIP Connections
      • Assign Number to a SIP Connection
    • Messaging
      • Enable SMS on Numbers
      • Disable SMS on Number
      • Send SMS with Pool
      • Send SMS with Number
      • Receiving SMS
      • Retrieve Message Detail Records
      • Receiving Messaging Events
    • Log Retrieval
      • Retrieve Call Log
      • Retrieve SMS Log
    • Calling
      • Bridge two calls
      • Make Single Call
      • Make Bulk Call
        • Example API Call
    • SIP Domain
      • Create SIP Domain
      • Create SIP User
      • Deleting SIP User
      • Modify SIP User
    • Websocket Event Subscription
      • Create Subscription
      • Remove Subscription
      • Get Subscribed Events
        • Example API Call
  • Websocket Events
    • Event Websocket
    • Websocket Authentication
      • How to Authenticate to WSS
      • Authentication Response
      • Explanation of JSON response
    • Event Definition
      • Call Initiated
        • Example Event
      • Call Ringing
        • Example Event
      • Call Live
        • Example Event
      • Callflow
        • Example Event
      • Call Hangup
        • Example Event
      • Call Destroyed
        • Example Event
      • Call Bridged
        • Example Event
      • Call Answered
        • Example Event
      • Account events
        • Example Event
      • SMS events
        • Example Event
      • TN events
        • Example Event
      • Record Events
        • Example Event
      • Transcript
        • Example Event
      • General Event Fields
      • Example Event
  • Opentact XML
    • Overview
    • <Call/>
    • <Callback/>
    • <Geo/>
    • <Scheduler/>
    • <Play/>
    • <Say/>
    • <Hangup/>
    • <Pause/>
    • <Record/>
    • </Dial>
    • </Gather>
    • <Answer/>
    • <Hold/>
    • <Tone/>
    • <Error/>
    • <Default/>
    • <Meta/>
    • <Curl/>
  • How to build your Opentact Application
    • Introduction
    • Inbound Call Control
    • Opentact Events
    • Call Flow Control
      • Specify CallFlow for TN
        • Dynamic Call Flow XML
        • Basic Workflow
      • Handle Inbound Call
    • Send and Receive SMS
      • Life Cycle of SMS Delivery
      • Real-time SMS over Websocket
      • Send SMS via Restful API
    • Send and Receive SIP Calls
      • Create SIP User
      • Make Calls Between SIP User
      • Receive Calls as SIP User
  • Regulatory Compliance
    • 10DLC FAQs
    • Stir Shaken
  • SIP Trunking
    • Use Opentact for SIP Trunking
  • Webhook Event
    • Introduction
    • Test Webhook with Opentact
    • Event Definition
Powered by GitBook
On this page

Was this helpful?

  1. Opentact XML

<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 and doff 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 the x 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. 1 sec 480Hz tone:

    xmlCopy code<Tone don="1000" hz="480"/>
  2. Same tone, but louder:

    xmlCopy code<Tone don="1000" v="-70" hz="480"/>
  3. US ringing tone:

    xmlCopy code<Tone don="2000" hz="420,500,440,480"/>

These examples showcase the flexibility of the <Tone/> command, allowing for the creation of diverse tone sequences with customizable attributes.

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Answer/>
    <!-- Play a tone -->
    <Tone />

    <!-- Dial a SIP user -->
    <Dial>
        <To>mary@dnl.sip.stage.opentact.org</To>
    </Dial>

    <!-- Play another tone -->
    <Tone />

    <!-- Speak a closing message -->
    <Say>Have a nice day</Say>

    <!-- End the call -->
    <Hangup/>
</Response>

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.

Previous<Hold/>Next<Error/>

Last updated 1 year ago

Was this helpful?