Calls

Starts an outbound call whose behavior is supplied by a cXML URL or Application SID. Use this form-encoded route for integrations built around cXML call control and Call SIDs; use the Calling API for SWML-driven calls and command-based control.

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: Voice.

Learn more about API scopes.

post/Accounts/{AccountSid}/Calls

Request

  • Base URL
    https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01
  • URL
    https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Calls
  • Auth
    HTTP basic

Path parameters

AccountSidstring uuid required

Universal Unique Identifier.

The Project ID that uniquely identifies the Account.

Request body application/x-www-form-urlencoded

Tostring required

The address that received the call. Can be a phone number in E.164 format, a SIP URI, or a client identifier.

Fromstring required

The address that initiated the call. Must be a phone number in E.164 format for PSTN calls.

Urlstring uri

The URL to handle the call. Required if ApplicationSid and Laml/Twiml are not used.

ApplicationSidstring uuid

Universal Unique Identifier.

Method'GET' | 'POST'

Whether the request to Url is a GET or a POST. Default is POST.

FallbackUrlstring uri

The URL SignalWire will request if errors occur when fetching the Url.

FallbackMethod'GET' | 'POST'

Whether the request to FallbackUrl is a GET or a POST. Default is POST.

StatusCallbackstring uri

The URL SignalWire will send webhooks to on every requested StatusCallbackEvent event. See the Voice status callback webhook for the payload your URL will receive.

StatusCallbackMethod'GET' | 'POST'

Whether the request to StatusCallback URL is a GET or a POST. Default is POST.

StatusCallbackEventstring[]

The status events that trigger a SignalWire webhook. Valid values: initiated, ringing, answered, completed, ringing_forwarded, ringing_queued. Defaults to completed. If StatusCallbackEvent includes completed, which it does by default, you also receive a callback with CallStatus set to failed when SignalWire stops the call before dialing it. The Voice status callback lists the reasons.

CallerIdstring

The number, in E.164 format, or identifier of the caller. Used to override the From for caller ID purposes.

SendDigitsstring

The digits to press after a call is connected. Valid characters are 0-9, #, *, w (wait 0.5s), and W (wait 1s).

Timeoutinteger

The time in seconds SignalWire will wait before assuming the call has no answer. Default is 60 seconds.

MachineDetection'Enable' | 'DetectMessageEnd' | 'none'

Whether a human or machine picked up the call. Default is none.

MachineDetectionTimeoutinteger

The time in seconds SignalWire will wait for machine detection before timing out. Default is 30 seconds.

MachineDetectionSpeechThresholdinteger

How many milliseconds of voice to decide it is a machine. Default is 2400 milliseconds.

MachineDetectionSpeechEndThresholdinteger

Number of milliseconds to wait for voice to finish. Default is 1200 milliseconds.

MachineDetectionSilenceTimeoutinteger

Number of milliseconds to wait for initial voice before giving up. Default is 5000 milliseconds.

MachineWordsThresholdinteger

How many words to count to decide it is a machine. Default is 6.

AsyncAmdboolean

Whether or not to execute machine detection asynchronously. Default is false.

AsyncAmdStatusCallbackMethod'GET' | 'POST'

Whether the request to AsyncAmdStatusCallback is a GET or a POST. Default is POST.

AsyncAmdStatusCallbackstring uri

The URL to request when the machine detection is completed.

AsyncAmdPartialResultsboolean

Whether or not to report partial (interim) results to the callback url. Default is false.

Recordboolean

Whether or not to record a call. Default is false.

RecordingChannels'mono' | 'dual'

The number of channels in the recording. Default is mono.

RecordingTrack'inbound' | 'outbound' | 'both'

Specifies whether to record the inbound, outbound, or both audio. Default is both.

RecordingStatusCallbackstring uri

The URL to request when recording is available. See the Recording status callback webhook for the payload your URL will receive.

RecordingStatusCallbackMethod'GET' | 'POST'

Whether the request to RecordingStatusCallback URL is a GET or a POST. Default is POST.

RecordingStatusCallbackEventstring

The recording status events that trigger a webhook. Space-separated list. Valid values: completed, in-progress, absent. Default is completed.

Trim'trim-silence' | 'do-not-trim'

Whether leading and trailing silence is trimmed from a recording. Default is trim-silence.

SipAuthUsernamestring

The username to authenticate the caller when making an outbound SIP call.

SipAuthPasswordstring

The password to authenticate the caller when making an outbound SIP call.

MaxPricePerMinutestring

The maximum price in USD acceptable for the call to be created. Format: up to 4 decimal places.

Example request

{
  "To": "+13105678901",
  "From": "+13103384645",
  "Url": "http://your-application.com/docs/voice.xml",
  "Method": "POST",
  "FallbackUrl": "https://your-api-endpoint.com/path",
  "FallbackMethod": "POST",
  "StatusCallback": "https://your-api-endpoint.com/path",
  "StatusCallbackMethod": "POST",
  "StatusCallbackEvent": [
    "initiated",
    "ringing",
    "answered",
    "completed"
  ],
  "CallerId": "+13102259067",
  "SendDigits": "1ww2",
  "Timeout": 60,
  "MachineDetection": "Enable",
  "MachineDetectionTimeout": 30,
  "MachineDetectionSpeechThreshold": 2400,
  "MachineDetectionSpeechEndThreshold": 1200,
  "MachineDetectionSilenceTimeout": 5000,
  "MachineWordsThreshold": 6,
  "AsyncAmdStatusCallbackMethod": "POST",
  "AsyncAmdStatusCallback": "https://your-api-endpoint.com/path",
  "RecordingChannels": "mono",
  "RecordingTrack": "both",
  "RecordingStatusCallback": "https://your-api-endpoint.com/path",
  "RecordingStatusCallbackMethod": "POST",
  "RecordingStatusCallbackEvent": "completed",
  "Trim": "trim-silence",
  "SipAuthUsername": "sipuser",
  "SipAuthPassword": "sippassword",
  "MaxPricePerMinute": "0.0075"
}

Response

The request has succeeded.

sidstring uuid required

Universal Unique Identifier.

account_sidstring uuid required

Universal Unique Identifier.

date_createdstring required

The date, in RFC 2822 GMT format, this call was created.

date_updatedstring required

The date, in RFC 2822 GMT format, this call was updated.

parent_call_sidstring uuid required

Universal Unique Identifier.

tostring required

The address that received the call.

formatted_tostring required

The formatted number that received the call.

to_formattedstring required

The formatted number that received the call. Alias for formatted_to.

fromstring required

The address that initiated the call.

formatted_fromstring required

The formatted number that initiated the call.

from_formattedstring required

The formatted number that initiated the call. Alias for formatted_from.

phone_number_sidstring uuid required

Universal Unique Identifier.

status'queued' | 'ringing' | 'in-progress' | 'canceled' | 'completed' | 'busy' | 'failed' | 'no-answer' required

Call status.

start_timestring nullable required

The time, in RFC 2822 GMT format, on which the call began.

end_timestring nullable required

The time, in RFC 2822 GMT format, on which the call was terminated.

durationinteger required

The duration, in seconds, of the call.

pricenumber float nullable required

The charge for the call.

price_unitstring required

The currency, in ISO 4127 format, for the price of the call.

direction'inbound' | 'outbound' required

Call direction.

answered_by'human' | 'machine' required

Who/what answered the call.

api_versionstring required

The version of the SignalWire API.

forwarded_fromstring nullable required

The number this call was forwarded from. Always null.

caller_namestring nullable required

The caller name. Always null.

uristring required

The URI for the call.

annotationstring nullable required

The annotation for the call. Always null.

group_sidstring nullable required

The group SID for the call. Always null.

audio_in_mosnumber float nullable required

The Mean Opinion Score for audio quality (1.0-5.0).

sip_result_codestring nullable required

The SIP result code for the call.

audio_rtt_avginteger nullable required

The average round-trip time for audio in milliseconds.

audio_rtt_mininteger nullable required

The minimum round-trip time for audio in milliseconds.

audio_rtt_maxinteger nullable required

The maximum round-trip time for audio in milliseconds.

audio_out_jitter_mininteger nullable required

The minimum outbound audio jitter in milliseconds.

audio_out_jitter_maxinteger nullable required

The maximum outbound audio jitter in milliseconds.

audio_out_jitter_avginteger nullable required

The average outbound audio jitter in milliseconds.

audio_out_lostinteger nullable required

The number of outbound audio packets lost.

Example response

{
  "date_created": "Wed, 19 Sep 2018 20:00:00 +0000",
  "date_updated": "Wed, 19 Sep 2018 21:00:00 +0000",
  "to": "+13105678901",
  "formatted_to": "(310) 567-8901",
  "to_formatted": "(310) 567-8901",
  "from": "+13103384645",
  "formatted_from": "(310) 338-4645",
  "from_formatted": "(310) 338-4645",
  "start_time": "Wed, 19 Sep 2018 20:00:01 +0000",
  "end_time": "Fri, 21 Sep 2018 10:00:00 +0000",
  "duration": 20,
  "price": 0.003,
  "price_unit": "USD",
  "api_version": "2010-04-01",
  "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472ca.json",
  "subresource_uris": {
    "recordings": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472ca/Recordings.json"
  },
  "audio_in_mos": 4.5,
  "sip_result_code": "200",
  "audio_rtt_avg": 50,
  "audio_rtt_min": 20,
  "audio_rtt_max": 100,
  "audio_out_jitter_min": 1,
  "audio_out_jitter_max": 10,
  "audio_out_jitter_avg": 5
}

Changes

    • breaking

      added to the request property allOf list

    • breaking

      the response's property type changed from string to no type, and format from uuid to no format for status

    • breaking

      the response's property format changed from uuid to no format for status

    • breaking

      the response's property format changed from uuid to no format for status

    • breaking

      the response's property type changed from string to no type, and format from uuid to no format for status

    • info

      the request property type was generalized from string to no type, and format from uuid to no format

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property anyOf list for the response status

    • info

      added to the response property anyOf list for the response status

    • info

      removed subschema #1 from the response property anyOf list for the response status

    • info

      removed subschema #1 from the response property anyOf list for the response status

    • breaking

      added 'unevaluatedProperties' constraint to the request body

    • info

      added 'unevaluatedProperties' constraint to the response body for the status

    • info

      added 'unevaluatedProperties' constraint to the response body for the status

    • info

      added 'unevaluatedProperties' constraint to the response body for the status

    • info

      added 'unevaluatedProperties' constraint to the response body for the status

    • info

      added 'unevaluatedProperties' constraint to the / response property for the status

    • info

      added 'unevaluatedProperties' constraint to the //// response property for the status