Sign in
Sign up
Reference Visual Designer Tutorials
    • API Overview
      • API Endpoint
      • Authentication
      • Requests
      • Responses
      • Paging
      • Reason Codes Dictionary
    • Management APIs
      • Accounts
        • Retrieve Account
        • Create Account
        • Update Account
        • Delete Account
        • Account Roles
      • Tags
        • Create Tag
        • Update Tag
        • Get Tag list
        • Retrieve Tag
        • Delete Tag
      • Profiles
        • Create Profile
        • Update Profile
        • Unlink a Profile from an Account
        • Link a Profile to an Organization
        • Unlink a Profile to an Organization
        • Get Profiles List
        • Paging
        • Filtering & Profile Document Inclusion
        • Get Profile Details
        • Get Profile Relationship
        • Get Account Relationship
        • Delete Profile
      • Applications
      • Clients
        • Create a Client
        • Delete a Client
        • Change Client’s Password
        • Get a List of Available Clients
      • Incoming Phone Numbers
        • IncomingPhoneNumber Instance Resource
        • IncomingPhoneNumbers List Resource
        • Local IncomingPhoneNumber Factory Resource
        • Toll-Free IncomingPhoneNumber Factory Resource
        • Mobile IncomingPhoneNumber Factory Resource
        • Attach a phone number to an application
        • Delete a phone number
        • List of Phone Numbers
        • Incoming Phone Number Regex Support
      • Notifications
      • Usage Records
      • Audit Logs
    • Voice APIs
      • Calls
        • Call List Resource URI
        • Making a Call
        • Modifying Live Calls
        • Examples
        • List Filter
        • Paging Information
      • Outgoing Caller ID
      • Conference Management
        • Supported Operations
        • Conference List Resource URI
      • Conference Participants Management
        • Participants List Resource URI
      • Recordings
      • SIP Refer Support
    • SMS APIs
      • Outgoing Caller ID
      • Messages
        • Send SMS
        • Get SMS List
        • Get single SMS Information
        • SMS Attributes
      • Email
    • Turnkey Apps APIs
      • Microsoft Teams
        • Business Customer
        • Manage Mappings
        • Bot details
        • Messages
      • Smart 2FA
        • Sending One-Time Passwords
        • Verifying One-Time Passwords
        • Cancel One-Time Passwords
        • Session Detail Record (SDR)
        • Get list of One-Time Passwords
        • Get a Single One-Time Password
        • Usage Record One-Time Passwords
      • Message Exchange for Cisco UC-One
        • Create Operation
        • Read Operation
        • Update Operation
        • Delete Operation
        • Error Codes
      • Message Exchange for Cisco Webex Teams
        • Create Operation
        • Read Operation
        • Update Operation
        • Delete Operation
      • Call Queuing
        • Create Queue
        • Queue RCML
        • Enqueue RCML
      • Auto Attendant
        • Enterprise
        • User
        • Announcement
        • Auto Attendant System
        • Menu
        • Schedule
        • Phone Number
        • HMAC Key
      • Number Masking
      • Task Router
        • Create Enterprise
        • Get a List of Enterprises
        • Get Single Enterprise
        • Delete Enterprise
        • Create User
        • Get a List of Users
        • Get a Single User
        • Update User
        • Delete user
      • Campaign Manager
        • Business Customers
          • Business Customer Status
          • Create Business Customer
          • Update Business Customer
          • Delete Business Customer
          • Get List of Business Customers
          • Get Single Business Customer
        • User
          • User Role and Status
          • Create User
          • Update User
          • Delete User
        • Get List of Users
        • Get Single User
        • Manage Credits
        • Create Credit
          • Get List of Credits
          • Get Single Credit
        • Campaign
          • Campaign Status
          • Get List of Campaigns
          • Get Single Campaign
    • RCML
      • Overview
        • Interacting with Your Application
        • RCML Verbs
      • Dial
        • Client
        • Conference
        • Number
        • SIP
      • Email
      • Gather
      • Say
        • SSML Reference
      • Play
      • SMS
      • Hangup
      • Pause
      • Redirect
      • Record
      • Reject
docs 1.0
  • docs
    • 1.0
  • docs
  • CSP:RCML
  • CSP:Gather

Gather

Gather

The <Gather> verb supports two modes: DTMF and SPEECH. In DTMF mode it "gathers" digits that a caller enters into his or her telephone keypad. When the caller is done entering digits, Restcomm submits that digits to the provided 'action' URL in an HTTP GET or POST request. In SPEECH mode it "gathers" recognized speech that a caller said. If no input is received before timeout, <Gather> falls through to the next verb in the Restcomm document. You may optionally nest <Say>, <Play>, and <Pause> verbs within a <Gather> verb while waiting for input. This allows you to read menu options to the caller while letting her enter a menu selection at any time. After the first digit is received the audio will stop playing.

Gather Attributes

Name Allowed Values Default Value

action

relative or absolute URL

current document URL

actionOnEmptyResult

true, false

false

method

GET, POST

POST

timeout

positive integer

5 seconds

finishOnKey

any digit, #, *

#

numDigits

integer >= 1

unlimited

input

dtmf, speech

dtmf

partialResultCallback

relative or absolute url

none

partialResultCallbackMethod

GET, POST

POST

language

en-US, en-GB, es-ES, it-IT, fr-FR, pl-PL, pt-PT

en-US

hints

"words, phrases that have many words"

none

  • action. The 'action' attribute takes an absolute or relative URL as a value. When the caller has finished entering digits Restcomm will make a GET or POST request to this URL including the parameters below. If no 'action' is provided, Restcomm will by default make a POST request to the current document’s URL.

Request Parameters

Parameter Description

Digits

The digits the caller pressed, excluding the finishOnKey digit.

SpeechResult

The transcribed result of the speech.

  • actionOnEmptyResult If set to true, it will forcefully trigger a webhook to the action URL even when there is no collected input. Otherwise, the following verb will be processed.

  • method The 'method' attribute takes the value 'GET' or 'POST'. This tells Restcomm whether to request the 'action' URL via HTTP GET or POST.

  • timeout The 'timeout' attribute sets the limit in seconds that Restcomm will wait for the caller to press another digit before moving on and making a request to the 'action' URL. For example, if 'timeout' is '10', Restcomm will wait ten seconds for the caller to press another key before submitting the previously entered digits to the 'action' URL. Restcomm waits until completing the execution of all nested verbs before beginning the timeout period.

  • finishOnKey The 'finishOnKey' attribute lets you choose one value that submits the received data when entered. For example, if you set 'finishOnKey' to '#' and the user enters '1234#', Restcomm will immediately stop waiting for more input when the '#' is received and will submit "Digits=1234" to the 'action' URL. Note that the 'finishOnKey' value is not sent. The allowed values are the digits 0-9, ‘#’, ‘*’ . If the attribute hasn’t been set or has an empty string, the # symbol will be used as a fallback instead.

  • input A list of inputs that Restcomm should accept for <Gather>. Can be "dtmf" or "speech". Defaults to "dtmf".

  • partialResultCallback A relative or fully qualified URL. Is a mandatory attribute for “speech” mode. Restcomm will make requests to your partialResultCallback in real-time as speech is recognized. These webhooks will contain UnstableSpeechResult parameter with partial transcriptions that may change as the recognition progresses.

The Webhooks to partialResultCallback are async and doesn’t accept RCML back. If you want to act based on the partial result, then use the REST API to Live Modify the call.

Request Parameters

Parameter Description

UnstableSpeechResult

Partially recognized speech the caller said.

  • language The language Restcomm should recognize. Defaults to en-US

  • hints A list of words or phrases that Restcomm should expect during recognition. These are very useful for improving recognition of single words or phrases. Entries into hints should be separated by a comma.

Nesting

You can nest the following verbs within <Gather>: <Say>, <Play>, <Pause>

Examples

For an example of how to use the <Gather> verb see below.

<Response>
                <Gather action="handle-user-input.php" numDigits="1">
                    <Say>Welcome to TPS.</Say>
                    <Say>For store hours, press 1.</Say>
                    <Say>To speak to an agent, press 2.</Say>
                    <Say>To check your package status, press 3.</Say>
                </Gather>
                <!-- If customer doesn't input anything, prompt and try again. -->
                <Say>Sorry, I didn't get your response.</Say>
                <Redirect>handle-incoming-call.xml</Redirect>
            </Response>
Contact Us

+1 (650) 263 6146

SALES

SUPPORT

GENERAL

Follow Us

Turnkey Applications

SMART 2FA

MESSAGE EXCHANGE

CISCO WEBEX

CALL QUEUE

Learn

BLOG

TERMS AND CONDITIONS

Additional Links

ABOUT

FAQ'S

PRIVACY POLICY

CONTACT