Calls

Redirects an active call to new cXML instructions, cancels a queued call, or completes an in-progress call. Use it when controlling a call by Call SID and form-encoded cXML settings; use the Calling API for SWML call commands.

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/{Sid}

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/{Sid}
  • Auth
    HTTP basic

Path parameters

AccountSidstring uuid required

Universal Unique Identifier.

The Project ID that uniquely identifies the Account.

Sidstring uuid required

Universal Unique Identifier.

The unique identifier for the call.

Request body application/x-www-form-urlencoded

Urlstring uri

The URL to handle the call.

Method'GET' | 'POST'

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

Status'canceled' | 'completed'

The status to update the call to.

FallbackUrlstring uri

The URL SignalWire will request if errors occur.

FallbackMethod'GET' | 'POST'

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

StatusCallbackstring uri

The URL SignalWire will send webhooks to.

StatusCallbackMethod'GET' | 'POST'

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

Example request

{
  "Url": "http://your-application.com/docs/voice.xml",
  "Method": "POST",
  "Status": "completed",
  "FallbackUrl": "https://your-api-endpoint.com/fallback",
  "FallbackMethod": "POST",
  "StatusCallback": "https://your-api-endpoint.com/status",
  "StatusCallbackMethod": "POST"
}

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

      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

      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 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