Skip to main content
Dynamic E911: Location-Based SIP

This article is about Dynamic e911 which provide accurate location based on the SIP header

Shubam avatar
Written by Shubam
Updated over 6 months ago

Background

9-1-1, usually called 911, is an emergency telephone number for the United States, Canada, Palau, Argentina, Philippines, Jordan, and the North American Numbering Plan (NANP), one of eight N11 codes. Like other emergency numbers around the world, this number is intended for use in emergency circumstances only.


Calls to 911 are routed to a Public Safety Answering Point (PSAP). E911 identifies the caller's location, routes the call to the appropriate local PSAP, and provides the PSAP with location information, enabling emergency responders to dispatch a team to the caller's location.

Standard E911 for VoIP is enabled by setting a physical address to show up when 911 is dialed, and this location can be updated if your work location changes — you may move offices or start working from home. The key thing to note here is that the address associated with the number and provided to the PSAP is static, and not necessarily a representation of live location information.


What is Dynamic e911?


Dynamic e911 on the other hand provides a “dispatchable location” — which is current location information consisting of street address plus additional information such as suite, apartment, or similar information necessary to adequately identify the location of the calling party — using PIDF-LO (Presence Information Data Format Location Object). PIDF-LO represents location information in SIP headers in XML format, allowing organizations to send a caller’s location information to the PSAP in IP-based 911 networks. Essentially, 911 calls can be routed according to the location of the Wi-Fi hotspot, rather than a static address that may or may not represent the caller’s actual location. This makes Dynamic E911 the ideal solution for large enterprises with callers frequently moving around multi-tenanted addresses, high rises, or large campuses.

Dynamic e911 using Telnyx

Telnyx does provide dynamic e911 solution using API which can provide accurate location information at the time of a 911 call using PIDF-LO (Presence Information Data Format-Location Object), which will allow emergency responders to quickly reach the person placing the call.


Step 1

Create a Dynamic Address using POST request as shown below.

curl -L -X POST 'https://api.telnyx.com/v2/dynamic_emergency_addresses' -H 'Authorization: Bearer YOUR API KEY' -H 'Content-Type: application/json' --data-raw '{
"house_number": "1901",
"street_pre_directional": "W",
"street_name": "MADISON",
"street_suffix": "ST",
"extended_address": "West Madison Street ",
"locality": "CHICAGO",
"administrative_area": "IL",
"postal_code": "60612",
"country_code": "US"
}'

Response

{
"data": {
"street_pre_directional": "W",
"house_number": "1901",
"postal_code": "60612",
"created_at": "2021-09-21T23:21:20.607173Z",
"extended_address": "WEST MADISON STREET",
"updated_at": "2021-09-21T23:21:20.607174Z",
"administrative_area": "IL",
"street_post_directional": null,
"street_name": "MADISON",
"house_suffix": null,
"locality": "CHICAGO",
"status": "pending",
"id": "f7a13541-ca9e-45c5-8268-e928396471df",
"sip_geolocation_id": "d4f52baed311ef95",
"country_code": "US",
"street_suffix": "ST",
"record_type": "dynamic_emergency_address"
}
}

in the above response please make a note of sip_geolocation_id as this will be used as a reference for the next steps.


After the dynamic address is generated you can verify it using a GET request using the id generated in the above response.

curl -L -X GET 'https://api.telnyx.com/v2/dynamic_emergency_addresses/f7a13541-ca9e-45c5-8268-e928396471df' -H 'Authorization: Bearer YOUR API KEY'Here is the process flow.

Step 2

Create a new Dynamic Emergency Endpoint associated with the Dynamic Emergency Address ID

 curl -L -X POST 'https://api.telnyx.com/v2/dynamic_emergency_endpoints' -H 'Authorization: Bearer YOUR API KEY' -H 'Content-Type: application/json' --data-raw '{
"callback_number":"+13125550000",
"caller_name":"Jane Doe",
"dynamic_emergency_address_id":"f7a13541-ca9e-45c5-8268-e928396471df"
}

Response

{
"data": {
"status": "activated",
"sip_from_id": "2d117a0a1dee74f1",
"caller_name": "Jane Doe",
"callback_number": "+13125550000",
"created_at": "2021-09-21T23:33:12.334938Z",
"updated_at": "2021-09-21T23:33:12.334942Z",
"id": "64798021-5f31-46e0-965b-60196fd46cfe",
"Dynamic_emergency_address_id": "f7a13541-ca9e-45c5-8268-e928396471df",
"record_type": "dynamic_emergency_endpoint"
}
}

As you can see we have successfully activated dynamic_emergency_endpoint which contains sip_from_id details.

Testing the dynamic e911 service.

You can test the dynamic e911 service by making a call to 933 instead of 911 as it will ring up the actual emergency services. Please refer 933 testing article

Below is an example 933 call invite where the From address is basically a sip_from_id and Geolocation: d4f52baed311ef95 as generated in the above steps

INVITE sip:933@Telnyx SIP Proxy:5060 SIP/2.0
Via: SIP/2.0/UDP Telnyx Media IP:5060;branch=z9hG4bK-4126-1-0
From: "+13121234567" <sip:+13121234567@sip.telnyx.com:5060>;tag=4126SIPpTag001
To: 933 <sip:1818933@sip.telnyx.com:5060>
Call-ID: 1-4126@Telnyx Media IP
CSeq: 1 INVITE
Contact: sip:sipp@Telnyx Media IP:5060
Max-Forwards: 70
Subject: Performance Test
Geolocation:d4f52baed311ef95
Content-Type: application/sdp
Content-Length: 135
P-Asserted-Identity: <sip:2d117a0a1dee74f1@sbc.example.com:5060>

v=0
o=user1 53655765 2353687637 IN IP4 Telnyx Media IP
s=-
c=IN IP4 Telnyx Media IP
t=0 0
m=audio 6036 RTP/AVP 0
a=rtpmap:0 PCMU/8000

Alternatively, the sip_from_id parameter value 2d117a0a1dee74f1 can also be added to the P-Asserted-Identity SIP header, in addition to the From header:

P-Asserted-Identity: <sip:2d117a0a1dee74f1@sbc.example.com:5060>

Here is the process flow in a nutshell.

process flow image.

Kindly note that both Geolocation and P-Asserted-Identity are RFC-compliant headers, they are not custom headers or “X-” headers.

SIP/2.0 404 Invalid caller ID number for emergency services D8

If you have received this SIP Response, please ensure that at least one of the Caller ID headers includes the actual phone number making the call as seen in the above SIP INVITE example.

You can find more details on the dynamic e911 on our Developer's Page

Did this answer your question?