Collecting Input
The input action will collect the digits from the caller or callee on a live call. 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.
- Curl
- Node.js
- Python
Input action JSON
[
{
action: "input",
max_digit: 4,
timeout: 5,
action_url: "https://test.com/dtmf",
}
]
Parameters type and description
Parameter | Type | Description |
---|---|---|
*action | string | The PCMO action to control the flow of the call. |
max_digit | number | It defines the DTMF input length. By default the maximum digit is 1 |
timeout | number | The seconds to wait, to get the DTMF. By default the timeout is 5 seconds. |
*action_url | string | Your webserver URL to inform the DTMf input |
Note
To collect user input during a call in PCMO, you can use the input()
method of the PiopiyAction
class. This method allows you to collect DTMF (keypad) input from users, such as key presses, and send the collected data to a specified URL for processing.
const {PiopiyAction} = require("piopiy");
const action = new PiopiyAction();
const url = "https://example.com/action"
const options = { max_digit: 3, max_retry: 2, timeout: 1 }
action.input( url, options);
Parameters type and description
These are the list of parameters and its description
Main parameters
Parameter | Type | Description |
---|---|---|
url | string | The URL to send the input data to. |
options | object | An object containing optional parameters (max_digit, max_retry & timeout). |
Options parameters
Parameter | Type | Description |
---|---|---|
max_digit | number | Maximum number of digits expected from the user input. |
max_retry | number | Maximum number of retry attempts. |
timeout | number | Time allowed between DTMF inputs in seconds.By default, it is 1 second. |
To collect user input during a call in PCMO, you can use the input()
method of the PiopiyAction
class. This method allows you to collect DTMF (keypad) input from users, such as key presses, and send the collected data to a specified URL for processing.
from piopiy import Action
action = Action()
url = "https://example.com/action"
options = { max_digit: 3, max_retry: 2, timeout: 1 }
action.input( url, options)
Parameters type and description
These are the list of parameters and its description
Main parameters
Parameter | Type | Description |
---|---|---|
url | string | The URL to send the input data to. |
options | object | An object containing optional parameters (max_digit, max_retry & timeout). |
Options parameters
Parameter | Type | Description |
---|---|---|
max_digit | number | Maximum number of digits expected from the user input. |
max_retry | number | Maximum number of retry attempts. |
timeout | number | Time allowed between DTMF inputs in seconds.By default, it is 1 second. |