<Gather />
prompt a DTMF code
Getting Super Powers
Becoming a super hero is a fairly straight forward process:
<Gather
numDigits="4"
timeout="30000"
finishOnKey="*"
callback="https://dev.alucky.dev/test/code" />
GET
Path Parameters
attempts
integer
How many attempts Gather block should be executed Default: 1
callback
string
remote endpoint url Default: none
method
string
callback method 'GET' or 'POST' Default: 'GET'
finishOnKey
string
+, *, #, 0-9 Default: *
timeout
integer
Block timeout
numDigits
integer
how many digits to wait from user Default: 1
Filler
command sequence which will be played while user entering the code
Callback
remote call flow request
GET
<CALLBACK URL>
Path Parameters
code
integer
dtmf code
success
boolean
dtmf request state
attempts
integer
attempt
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Thank you for entering the code</Say>
</Response>
remote call flow request
POST
Path Parameters
code
integer
dtmf code
success
boolean
dtmf request state
attempts
integer
attempt
Headers
Content-Type
string
application/json
Request Body
body
string
Body contain an object with ISIPControlAppCall object and <Gather /> history
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Thank you for entering the code</Say>
</Response>
Call back post example
import fetch, { RequestInit } from 'node-fetch';
const body = {
history: [
{
success: false,
payload: {
success: false,
command: { command: ''},
error: { error: 'User input error' },
message: {}
}
},
{
success: true,
payload: {
success: true,
command: { command: 'Say'},
error: {},
message: { message: 'Success'}
}
},
],
call: {
account_uuid: '',
from: '15551234567'
to: 155532165487,
state: 'started',
sip_control_app: {
uuid: '',
name: '',
subdomain: '',
}
}
};
const reqInit: RequestInit = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringfy(body),
};
const xml = await fetch(url, reqInit).then(res => res.text());
Last updated
Was this helpful?