Number
The <Number> noun specifies a phone number to dial. You can use multiple <Number> nouns within a <Dial> verb to simultaneously call all of them at once. The first call to pick up is connected to the current call and the rest are hung up.
Number Attributes
Name | Allowed Values | Default Value |
url | any url | none |
method |
|
|
statusCallbackEvent |
| none |
statusCallback | any url | none |
statusCallbackMethod |
|
|
url. The 'url' attribute allows you to specify a URL for a RCML document that will run on the called party’s end, after he/she answers, but before the parties are connected. You can use this RCML to privately play or say information to the called party, or provide a chance to decline the phone call using <Gather> and <Hangup>. The current caller will continue to hear ringing while the RCML document executes on the other end. RCML documents executed in this manner are not allowed to contain the <Dial> verb
method
The 'method' attribute allows you to specify which HTTP method CallAPI should use when requesting the URL in the 'url' attribute. The default is POST.
statusCallbackEvent
When dialing out to a PSTN Number using <Dial>, an outbound call is initiated. The call transitions from the initiated state to the ringing state when the phone starts ringing. It transitions to the answered state when the call is picked up, and finally to the completed state when the call is over. With statusCallbackEvent, you can subscribe to receive webhooks for the different call progress events: initiated, ringing, answered, or completed for a given call.
The statusCallbackEvent attribute allows you to specify which events CallAPI should webhook on. To specify multiple events separate them with a comma: initiated,ringing,answered,completed
. If a statusCallback is provided and no status callback events are specified the completed event will be sent by default.
As opposed to creating an outbound call via the API, outbound calls created using <Dial> are initiated right away and never queued. The following shows a timeline of possible call events that can be returned and the different call statuses that a <Dial> leg may experience:
The <Number> noun specifies a PSTN Number to dial. You can use multiple <Number> nouns within a <Dial> verb to simultaneously attempt a connection with many numbers at once. The first number to accept the incoming connection is connected to the call and the other connection attempts are canceled.
Event | Description |
initiated | The |
ringing | The |
answered | The |
completed | The |
statusCallback
When dialing out to a PSTN Number using , an outbound call is initiated. The call transitions from the initiated state to the ringing state when the phone starts ringing. It transitions to the answered state when the call is picked up, and finally to the completed state when the call is over. With statusCallbackEvent, you can subscribe to receive webhooks for the different call progress events: initiated, ringing, answered, or completed for a given call. The statusCallbackEvent attribute allows you to specify which events CallAPI should webhook on. To specify multiple events separate them with a comma: initiated,ringing,answered,completed. If a statusCallback is provided and no status callback events are specified the completed event will be sent by default. Compared to creating an outbound call via the API, outbound calls created using are initiated right away and never queued. The following shows a timeline of possible call events that can be returned and the different call statuses that a leg may experience:
The <Number> noun specifies a PSTN Number to dial. You can use multiple nouns within a verb to simultaneously attempt a connection with many numbers at once. The first number to accept the incoming connection is connected to the call and the other connection attempts are canceled.
statusCallbackMethod
The statusCallbackMethod attribute allows you to specify which HTTP method CallAPI should use when requesting the URL in the statusCallback attribute. The default is POST.
Status Callback HTTP Parameters
The parameters CallAPI passes to your application in its asynchronous request to the StatusCallback URL include all parameters passed in a synchronous request to retrieve RCML when CallAPI receives a call to one of your CallAPI numbers. The full list of parameters and descriptions of each are in the RCML Voice Request documentation.
When the call progress events are fired, the Status Callback request also passes these additional parameters:
Parameter | Description |
CallSid | A unique identifier for this call, generated by CallAPI. You can use the |
CallStatus | A descriptive status for the call. The value is one of |
CallDuration | The duration in seconds of the just-completed call. Only present in the |
Timestamp | The timestamp when the event was fired, given as UTC in RFC 2822 format. |
CallbackSource | A string that describes the source of the webhook. This is provided to help disambiguate why the webhook was made. On Status Callbacks, this value is always |
SequenceNumber | The order in which the events were fired, starting from |
Examples
Examples of using the <Dial> verb.
Last updated