Play & Get Input

The play_get_input action will collect the digits from the caller or callee on a live call while listening to the audio file. when the digits are collected, you can make the call jump to the next action also. Collecting the digits will be useful to create multi-level IVR, confirming the order, etc,

Prerequisites

  1. Sign up for a free PIOPIY demo account.

  2. Create your endpoint and add capacity.

  3. Buy PIOPIY phone number.

  4. Setup your webserver and map your POST method URL in answer URL.

Input action JSON

[
{
"action": "play_get_input",
"file_name": "music_file.wav",
"max_digit": 4,
"max_retry": 2,
"action_url": "https://test.com/dtmf"
}
]

Properties

PropertyTypeDescription
*actionstringThe PCMO action to control the flow of the call.
*file_namestringThe file_name will play the audio file from TeleCMI cloud CDN.
max_digitnumberIt defines the DTMF input length. By default the maximum digit is 1.
max_retrynumberThe number of time music file need to be played without receiving DTMF input. By default the maximum retry is 1.
*action_urlstringYour webserver URL to inform the DTMf input
Note
The * marked property is mandatory.

Sample JSON Response

Your web server will get a sample response from PIOPIY Platform as given below for incoming call.

{
action: 'inbound',
from: '19170000001',
to: '19170000000',
time: 1670568234000,
cmiuuid: '28b9fc5f-b147-47e1-80a4-1edf1339efe1'
}

Properties

These are the list of properties and its description

PropertyTypeDescription
actionstringDirection of this call
fromnumberThe number who made a call
tostringYour PIOPIY phone number
timestringTimestamp of this call
cmiuuidstringA unique identifier of this call

Sample JSON Response for DTMF

If the provided information is valid, your web server will get a sample response from PIOPIY Platform as given below

{
"from": 919100000000,
"to": 4471000000,
"dtmf": "1234",
"cmuuid": "41aa4bb1-d693-415e-82ce-bdf2e8814aeb"
}

Properties

These are the list of properties and its description

PropertyTypeDescription
fromnumberThe number the call came from
tonumberYour PIOPIY phone number
dtmfstringThe digits entered during the call
cmiuuidstringA unique identifier of this call

HTTP status codes

TeleCMI API platform represents the following status code to identity the errors.

Status codeStatus codeDescription
404ErrorInvalid music filename