Skip to main content

Create a Call

Use this endpoint for the Calls method to create a new call.

Parameters

ParameterDescription
ApplicationSid required*if Url is not presentThe unique identifier of the application used to handle the call.
From RequiredThe number that initiated the call.
To RequiredThe number that received the call.
Url required*if ApplicationSid is not presentThe URL of the call.
CallerId OptionalThe number, in E.164 format, or identifier of the caller.
FallbackMethod OptionalWhether the request to FallbackUrl is a GET or a POST. Default is POST. If ApplicationSid is present, this parameter is ignored.
FallbackUrl OptionalThe URL SignalWire will request if errors occur when fetching the Url. If ApplicationSid is present, this parameter is ignored.
MachineDetection OptionalWhether a human or machine picked up the call. Possible values are Enable, DetectMessageEnd and none.
AsyncAmd OptionalWhether or not to execute machine detection asynchronously. Possible values are true or false. Default is false.
AsyncAmdStatusCallback OptionalThe URL to request when the machine detection is completed. This parameter is ignored if AsyncAmd is false.
AsyncAmdStatusCallbackMethod OptionalWhether the request to AsyncAmdStatusCallback is a GET or a POST. Default is POST.
MachineDetectionSilenceTimeout OptionalNumber of milliseconds to wait for initial voice before giving up. Must be at least 2000 to a maximum of 10000. Default is 5000 milliseconds.
MachineDetectionSpeechThreshold OptionalHow many milliseconds of voice to decide if it is a machine. If a voice is detected for longer than this value, it is interpreted as a machine. Must be at least 1000 to a maximum of 6000. Default is 2400 milliseconds.
MachineDetectionSpeechEndThreshold OptionalNumber of milliseconds of silence before speech is considered finished. Must be at least 500 to a maximum of 5000. Default is 1200 milliseconds.
MachineDetectionTimeout OptionalThe time SignalWire will wait for machine detection before timing out. Default is 30 seconds.
MachineWordsThreshold OptionalHow many words counted to decide if it is a machine. If more words than this value are counted, it is interpreted as a machine. Must be at least one to a maximum of 100. Default is 6.
MaxPricePerMinute OptionalThe maximum price in USD acceptable for the call to be created. If the cost to create the call is calculated at greater than MaxPricePerMinute, the call will not be created and error 30010: MaxPricePerMinute was exceeded. This call's cost is XX. will be returned. You will not be charged. If MaxPricePerMinute is not set, all calls will be created. The price can have a maximum of four decimal places, i.e. 0.0075.
Method OptionalWhether the request to Url is a GET or a POST. Default is POST. Ignored if ApplicationSid is present.
Record OptionalWhether or not to record a call. Possible values are true or false. Default is false.
RecordingChannels OptionalThe number of channels in the recording. Can be mono (both legs of call recorded under one channel into one recording file) or dual (each leg of call recorded in separate channels into one recording file).
RecordingStatusCallback OptionalThe URL to request to when recording is available.
RecordingStatusCallbackEvent OptionalThe different recording statuses. Possible values are completed, in-progress, and absent. To specify multiple events, separate with a space. Defaults to completed.
RecordingStatusCallbackMethod OptionalWhether the request to RecordingStatusCallback URL is a GET or a POST. Default is POST.
RecordingTrack OptionalSpecifies whether to record the inbound audio to SignalWire from the called party or the outbound audio from SignalWire to the called party or both the inbound and outbound audio. Defaults to both.
SipAuthUsername OptionalThe username to authenticate the caller when making an outbound SIP call.
SipAuthPassword OptionalThe password to authenticate the caller when making an outbound SIP call.
SendDigits OptionalThe digits to press after a call is connected. Possible values are (0-9), #, *, and w. Each w gives a 0.5 second pause before moving on to the next instruction.
StatusCallback OptionalThe URL SignalWire will send webhooks to on every requested StatusCallbackEvent event.
StatusCallbackEvent OptionalThe status events that trigger a SignalWire webhook. Possible values are initiated, ringing, answered, and completed. To specify multiple events, specify each one in a separate parameter of the same name. Default is completed.
StatusCallbackMethod OptionalWhether the request to StatusCallback URL is a GET or a POST. Default is POST. Ignored if ApplicationSid is present.
Timeout OptionalThe time SignalWire will wait before assuming the call has no answer. Max wait time is 600 seconds. Default is 60 seconds.
Trim OptionalWhether leading and trailing silence is trimmed from a recording. Possible values are trim-silence and do-not-trim. Default is trim-silence.

Request

curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Calls.json \
-X POST \
--data-urlencode "Url=http://your-application.com/docs/voice.xml" \
--data-urlencode "To=+13105678901" \
--data-urlencode "From=+13103384645" \
-u "YourProjectID:YourAuthToken"

Responses

200 OK

{
"account_sid": "b3877c40-da60-4998-90ad-b792e98472af",
"annotation": null,
"answered_by": null,
"api_version": "2010-04-01",
"caller_name": null,
"date_created": "Wed, 19 Sept 2018 20:00:00 +0000",
"date_updated": "Thur, 20 Sept 2018 10:00:00 +0000",
"direction": "inbound",
"duration": "20",
"end_time": "Fri, 21 Sept 2018 10:00:00 +0000",
"forwarded_from": "+13102259067",
"from": "+13103384645",
"from_formatted": "(310) 338-4645",
"group_sid": "b3877c40-da60-4998-90ad-b792e98472pg",
"parent_call_sid": "b3877c40-da60-4998-90ad-b792e98472pa",
"phone_number_sid": "b3877c40-da60-4998-90ad-b792e98472ph",
"price": -0.02000,
"price_unit": "USD",
"sid": "b3877c40-da60-4998-90ad-b792e98472pa",
"start_time": "Wed, 19 Sept 2018 20:00:01 +0000",
"status": "completed",
"subresource_uris": {
"notifications": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa/Notifications.json",
"recordings": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa/Recordings.json",
"feedback": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa/Feedback.json",
"feedback_summaries": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/FeedbackSummary.json"
},
"to": "+13105678901",
"to_formatted": "(310) 567-8901",
"uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa.json",
"url": "http://your-application.com/docs/voice.xml"
}