Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Emergency Calling for SIP Trunking API


Twilio's Emergency Address registration enables emergency call routing to Public Safety Answering Points (PSAPs) in the US, Canada and the UK.

Emergency addresses are registered on a per Phone Number basis. This page outlines the process you should follow to associate/dis-associate emergency addresses on a Phone Number associated with an Elastic SIP Trunk. Please ensure that you also read our Emergency Calling documentation.

The Phone Numbers subresource contains the list of Phone Number instances associated with this Trunk. Phone Number instances are managed through the core Twilio REST API. Check out the Phone Number reference docs for more information.


Associate an Emergency Address with a Twilio Number

associate-an-emergency-address-with-a-twilio-number page anchor
  • Create and validate a new Emergency Address.
  • Associate an Emergency Address with a Twilio number.
  • Check Emergency Address Status on a Twilio number.

Dis-associate an Emergency Address from a Twilio Number

dis-associate-an-emergency-address-from-a-twilio-number page anchor
  • Disassociate an Emergency Address from a Twilio number.
  • Check Emergency Calling Status on a Twilio number.
  • Delete an Emergency Address.

Create and validate a new Emergency Address

create-and-validate-a-new-emergency-address page anchor

POST

https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Addresses

Create a new Address and validate it for Emergency Calling by setting the EmergencyEnabled parameter to true.

Create and validate a new Emergency Address

create-and-validate-a-new-emergency-address-1 page anchor

Ensure to set EmergencyEnabled to True

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = require('twilio')(accountSid, authToken);
_19
_19
client.addresses
_19
.create({
_19
friendlyName: 'Twilio',
_19
emergencyEnabled: true,
_19
customerName: 'Twilio',
_19
street: '645 Harrison St.',
_19
city: 'San Francisco',
_19
region: 'CA',
_19
postalCode: '94105',
_19
isoCountry: 'US'
_19
})
_19
.then(address => console.log(address.sid));

Output

_18
{
_18
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"city": "San Francisco",
_18
"customer_name": "Twilio",
_18
"date_created": "Tue, 18 Aug 2015 17:07:30 +0000",
_18
"date_updated": "Tue, 18 Aug 2015 17:07:30 +0000",
_18
"emergency_enabled": true,
_18
"friendly_name": "Twilio",
_18
"iso_country": "US",
_18
"postal_code": "94105",
_18
"region": "CA",
_18
"sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"street": "645 Harrison St.",
_18
"street_secondary": null,
_18
"validated": false,
_18
"verified": false,
_18
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_18
}

Example Response(s)
example-responses page anchor

A new address might be suggested as part of the validation process:


_10
<?xml version='1.0' encoding='UTF-8'?>
_10
<TwilioResponse>
_10
<RestException>
_10
<Code>21629</Code>
_10
<Message>Failed to validate address. Check the suggested address. | FriendlyName: Twilio, CustomerName: Twilio, Street: 645 HARRISON ST, Locality: SAN FRANCISCO, Region: CA, PostalCode: 94105, IsoCountry: US</Message>
_10
<MoreInfo>https://www.twilio.com/docs/errors/21629</MoreInfo>
_10
<Status>400</Status>
_10
</RestException>
_10
</TwilioResponse>

Associate an Emergency Address with a Twilio number

associate-an-emergency-address-with-a-twilio-number-1 page anchor

POST

https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{PhoneNumberSid}

Associate an Emergency Address with a Twilio Number

associate-an-emergency-address-with-a-twilio-number-2 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({emergencyAddressSid: 'ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'})
_10
.then(incoming_phone_number => console.log(incoming_phone_number.friendlyName));

Output

_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"address_requirements": "none",
_41
"address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"beta": false,
_41
"capabilities": {
_41
"voice": true,
_41
"sms": false,
_41
"mms": true,
_41
"fax": false
_41
},
_41
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"emergency_status": "Inactive",
_41
"emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"emergency_address_status": "registered",
_41
"friendly_name": "(808) 925-5327",
_41
"identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"origin": "origin",
_41
"phone_number": "+18089255327",
_41
"sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"sms_application_sid": "",
_41
"sms_fallback_method": "POST",
_41
"sms_fallback_url": "",
_41
"sms_method": "POST",
_41
"sms_url": "",
_41
"status_callback": "",
_41
"status_callback_method": "POST",
_41
"trunk_sid": null,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41
"voice_application_sid": "",
_41
"voice_caller_id_lookup": true,
_41
"voice_fallback_method": "POST",
_41
"voice_fallback_url": null,
_41
"voice_method": "POST",
_41
"voice_url": null,
_41
"voice_receive_mode": "voice",
_41
"status": "in-use",
_41
"bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_41
}

(information)

Info

You can disassociate an Emergency Address by updating the the emergency_address_sid to null (or undefined, None or nil depending on your programming language).

For curl leave the right side of the = blank:


_10
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json \
_10
--data-urlencode "EmergencyAddressSid=" \
_10
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token

Check Emergency Calling Status on a Twilio number

check-emergency-calling-status-on-a-twilio-number page anchor

GET

https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{PhoneNumberSid}

Check Emergency Calling Status on a Twilio number

check-emergency-calling-status-on-a-twilio-number-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.fetch()
_10
.then(incoming_phone_number => console.log(incoming_phone_number.friendlyName));

Output

_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"address_requirements": "none",
_41
"address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"beta": false,
_41
"capabilities": {
_41
"voice": true,
_41
"sms": false,
_41
"mms": true,
_41
"fax": false
_41
},
_41
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"emergency_status": "Active",
_41
"emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"emergency_address_status": "registered",
_41
"friendly_name": "(808) 925-5327",
_41
"identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"origin": "origin",
_41
"phone_number": "+18089255327",
_41
"sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"sms_application_sid": "",
_41
"sms_fallback_method": "POST",
_41
"sms_fallback_url": "",
_41
"sms_method": "POST",
_41
"sms_url": "",
_41
"status_callback": "",
_41
"status_callback_method": "POST",
_41
"trunk_sid": null,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41
"voice_application_sid": "",
_41
"voice_caller_id_lookup": false,
_41
"voice_fallback_method": "POST",
_41
"voice_fallback_url": null,
_41
"voice_method": "POST",
_41
"voice_url": null,
_41
"voice_receive_mode": "voice",
_41
"status": "in-use",
_41
"bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_41
}

Delete an Emergency Address

delete-an-emergency-address page anchor

DELETE

https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Addresses/{AddressSid}

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();

Changing the Emergency Address on a Twilio Number

  • Dis-associate the Emergency Address from your Twilio Number.
  • Check Emergency Address Status on a Twilio number to ensure it's unregistered.
  • Associate new Emergency Address with Twilio Number.
  • Check Emergency Address Status on a Twilio number to ensure it's registered.

Rate this page: