Update a Call
Use this endpoint for the Calls method to modify an active call.
Parameters
Parameter | Description |
---|---|
Sid Required | The unique identifier for the call to update. |
FallbackMethod Optional | Whether the request to FallbackUrl is a GET or a POST . Default is POST . |
FallbackUrl Optional | The URL SignalWire will request if errors occur when fetching the Url . |
Method Optional | Whether the request to Url is a GET or a POST . Default is POST . |
Status Optional | Change the status of the call. Possible values are canceled and completed . |
StatusCallback Optional | The URL SignalWire will send webhooks to on every StatusCallbackEvent event. Default is completed . |
StatusCallbackMethod Optional | Whether the request to StatusCallback URL is a GET or a POST . Default is POST . |
Url Optional | The URL of a new Compatibility XML document to start executing. |
Examples
Request
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json \
-X POST \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.calls('Sid')
.update()
.then(call => console.log(call.to))
.done();
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var call = CallResource.Update(
pathSid: "Sid"
);
Console.WriteLine(call.To);
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
call = client.calls('Sid') \
.update()
print(call.to)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
call = @client.calls('Sid')
.update()
puts call.to
Request: Terminate a Call
In this example, we terminate a call in progress by updating the call status to completed
.
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json \
-X POST \
--data-urlencode "Status=completed" \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.calls('Sid')
.update({status: 'completed'})
.then(call => console.log(call.to))
.done();
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var call = CallResource.Update(
status: CallResource.UpdateStatusEnum.Completed,
pathSid: "Sid"
);
Console.WriteLine(call.To);
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
call = client.calls('Sid') \
.update(status='completed')
print(call.to)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
call = @client.calls('Sid')
.update(status: 'completed')
puts call.to