Inbound Call
InboundCallReceivedWebhook is sent to the URL set up with the /webhooks endpoint for webhook type
InboundCallReceived when an Inbound Call is received.
In order to proceed with the Inbound Call, you need to respond to this webhook with a Call Script. Examples of the Call Scripts:
-
Forward the Inbound Call to the specific Phone Number:
<Response><Dial>+1234567890</Dial></Response> -
Or forward to the specific SIP URI:
<Response><Dial>sip:username@server.com</Dial></Response>
Examples of valid SIP URI:
sip:user@server.com:5060sip:user@server.com;transport=TLSsip:user@server.com?header1=value1&header2=value2sip:user@server.com:5060;transport=TCP?header=value
⚠️ To use SIP destinations with Static Forwarding, the receiving system must be configured to accept SIP traffic from the IP addresses below:
137.192.78.201137.192.80.201
These IPs should be added to the receiving system’s allowlist or firewall rules to ensure successful call delivery.
- Read the specified text and hangup:
<Response><Hangup>Hello voice</Hangup></Response>
- Hangup:
<Response><Hangup/></Response>
or any other response
Authorization
basic Basic Authorization header using the BASIC scheme. Use a pair companySid:token to access the API.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Inbound call received event.
Response Body
curl -X POST "https://example.com/v1/Webhooks/InboundCallReceivedWebhook" \ -H "Content-Type: application/json" \ -d '{ "type": "InboundCallReceived", "sid": "WH08df051c8bb9f0e2548e99fa4740bb51649e4aba18bacba4", "payload": { "callSid": "CAXXXXXXXX", "legSid": "CLXXXXXXXX", "from": "+13234567890", "to": "+19876543210", "eventDate": "2023-03-22T16:44:55.123Z" } }'Phone Number status POST
`PhoneNumberStatusChangedWebhook` is sent to the URL set up with the `/webhooks` endpoint for webhook type `PhoneNumberStatusChanged` when a Phone Number status has been changed.
Call status POST
`CallStatusChangedWebhook` is sent to the URL set up with `/webhooks` endpoint for webhook type `CallStatusChanged` when a Call status is changed.