Input Processor
Pay Attention
The request will include the previously provided token
. This is how you will associate the input with a specific
contact session.
The request
Once the recipient of the call presses a key on the keypad, the execution of the CXML document is stopped and the
keypress is submitted to the endpoint indicated by the action
. The request will look something like this, while
the keypress data will be available under the Digits
parameter:
POST /processInput HTTP/1.0.
Host: example.com:443.
X-Forwarded-For: 192.168.2.2.
Connection: upgrade.
Accept-Encoding: gzip.
Accept: */*.
Content-Type: application/json.
{
"ApiVersion": "1",
"CallStatus": "in-progress",
"From": "12127773456",
"CallSid": "16a7294c989b11e7b3d32b9edb8660c7",
"To": "63121233333",
"Digits": "1",
"SessionData": {
"id": 10231473,
"domainId": 3,
"destination": "63121233333",
"callerId": "12127773456",
"token": "16a7294c989b11e7b3d32b9edb8660c7",
"profile": {
"callId": [
"315df9a833a762214873c11b49bf622a@XXX.XXX.XXX.XXX:5060"
],
"inbound-trunk-name": "fromPSTN",
"qos": {
"CHANNELQOS": "ssrc=1348516293;themssrc=0;lp=0;rxjitter=0.000000;rxcount=0;txjitter=0.000000;txcount=88;rlp=0;rtt=0.000000;rxmes=0.000000;txmes=0.000000",
"ssrc": "1348516293",
"themssrc": "0",
"lp": 0,
"rxjitter": 0,
"rxcount": 0,
"txjitter": 0,
"txcount": 88,
"rlp": 0,
"rtt": 0,
"rxmes": 0,
"txmes": 0,
"rx_mos": "NaN",
"tx_mos": 4.4
},
"application": [
︙
︙
],
"inbound-trunk-id": 610
},
"callStartTime": 1721662394354,
"callAnswerTime": 1721662396169,
"status": "connected",
"vappServer": "172.24.41.58",
"ringing": false,
"domainNameOrId": "example.com"
},
"Domain": "example.com",
"Direction": "outbound-api",
"AccountSid": "example.com",
"Session": "16a7294c989b11e7b3d32b9edb8660c7"
}
The responses
Digits: "1"
<Response>
<Say>Dear {$fullname}, thank you for confirming your appointment.</Say>
<Say>Scheduled for {$dayOfWeek}, dated {$dayOfMonth} of {$nameOfMonth}, {$year}.</Say>
<Say>We look forward to seeing you. Thank you and goodbye.</Say>
<Hangup/>
</Response>
Digits: "2"
<Response>
<Say>Dear {$fullname}, one of our staff will contact you within 24 hours to reschedule. We look forward to talking with you.</Say>
<Say>Thank you and goodbye.</Say>
<Hangup/>
</Response>