Update

View as Markdown

Use this endpoint for the Calls method to modify an active call.

Path parameters

AccountSidstringRequiredformat: "uuid"
The Project ID that uniquely identifies the Account.
SidstringRequiredformat: "uuid"
The unique identifier for the call.

Request

UrlstringOptionalformat: "uri"
The URL to handle the call.
MethodenumOptional
Whether the request to `Url` is a `GET` or a `POST`.
Allowed values:
StatusenumOptional
The status to update the call to.
Allowed values:
FallbackUrlstringOptionalformat: "uri"
The URL SignalWire will request if errors occur.
FallbackMethodenumOptional
Whether the request to `FallbackUrl` is a `GET` or a `POST`.
Allowed values:
StatusCallbackstringOptionalformat: "uri"
The URL SignalWire will send webhooks to.
StatusCallbackMethodenumOptional
Whether the request to `StatusCallback` is a `GET` or a `POST`.
Allowed values:

Response

sidstringRequiredformat: "uuid"
The unique identifier for the call.
account_sidstringRequiredformat: "uuid"
The unique identifier for the account that created this call.
date_createdstringRequired
The date, in RFC 2822 GMT format, this call was created.
date_updatedstringRequired
The date, in RFC 2822 GMT format, this call was updated.
parent_call_sidstring or nullRequiredformat: "uuid"
The unique identifier for the call that created this call.
tostringRequired
The address that received the call.
formatted_tostringRequired
The formatted number that received the call.
to_formattedstringRequired
The formatted number that received the call. Alias for formatted_to.
fromstringRequired
The address that initiated the call.
formatted_fromstringRequired
The formatted number that initiated the call.
from_formattedstringRequired
The formatted number that initiated the call. Alias for formatted_from.
phone_number_sidstring or nullRequiredformat: "uuid"
The unique identifier for the phone number.
statusenumRequired
The status of the call.
start_timestring or nullRequired
The time, in RFC 2822 GMT format, on which the call began.
end_timestring or nullRequired
The time, in RFC 2822 GMT format, on which the call was terminated.
durationintegerRequired
The duration, in seconds, of the call.
pricedouble or nullRequired
The charge for the call.
price_unitstringRequired
The currency, in ISO 4127 format, for the price of the call.
directionenumRequired
The direction of the call.
Allowed values:
answered_byenum or nullRequired
Who/what the call was answered by.
Allowed values:
api_versionstringRequired
The version of the SignalWire API.
forwarded_fromstring or nullRequired
The number this call was forwarded from. Always null.
caller_namestring or nullRequired
The caller name. Always null.
uristringRequired
The URI for the call.
subresource_urisobjectRequired
A Map of available sub-resources.
annotationstring or nullRequired
The annotation for the call. Always null.
group_sidstring or nullRequired
The group SID for the call. Always null.
audio_in_mosdouble or nullRequired
The Mean Opinion Score for audio quality (1.0-5.0).
sip_result_codestring or nullRequired
The SIP result code for the call.
audio_rtt_avginteger or nullRequired
The average round-trip time for audio in milliseconds.
audio_rtt_mininteger or nullRequired
The minimum round-trip time for audio in milliseconds.
audio_rtt_maxinteger or nullRequired
The maximum round-trip time for audio in milliseconds.
audio_out_jitter_mininteger or nullRequired
The minimum outbound audio jitter in milliseconds.
audio_out_jitter_maxinteger or nullRequired
The maximum outbound audio jitter in milliseconds.
audio_out_jitter_avginteger or nullRequired
The average outbound audio jitter in milliseconds.
audio_out_lostinteger or nullRequired
The number of outbound audio packets lost.

Request examples

Update a call

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client.calls('Sid')
5 .update()
6 .then(call => console.log(call.to))
7 .done();

Terminate a call

In this example, we terminate a call in progress by updating the call status to completed.

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client.calls('Sid')
5 .update({status: 'completed'})
6 .then(call => console.log(call.to))
7 .done();