Call to Emergency Response Centers are done by dialing a well-known number, such as 911 in North America or 112 in Western Europe.
Use the Router to redirect calls to these numbers (in any Domain) to the emergency application:
<911@*> = emergency#pbx@localhost
The stock emergency application requires the caller to authenticate, and then it retrieves the following Account PSTN Settings:
PSTNEmergency (Emergency Code): This setting specifies the way to contact the Emergency Response Center for this Account user.
The applications needs to retrieve Settings from other Accounts, so it should be started on behalf of an Account with the Domain Administrator access rights.
The automatically created postmaster or pbx Accounts can be used.
The application processes the retrieved PSTNEmergency setting value:
The application makes an HTTP request using the emergency.settings dictionary as parameters for the HTTPCall CG/PL operation. The call body is a dictionary with the following elements:
userName: the authenticated caller's Account Name (accountName@domainName).
fromWhom: the caller's name (URI) as specified in the Request From: data.
areaCode: the PSTNEmergency Setting value with the http= prefix removed.
When the application receives an HTTP response, the HTTP response body should contain a string or an array with the destination address(es).
The application redirects the call to the specified address(es).