How to configure caller sensitive forwarding for emergency calls

From SIPfoundry sipx, The Open Source SIP PBX for Linux - Calivia

Jump to: navigation, search

Contents

Caller Sensitive Forwarding

Caller sensitive forwarding is a new functionality related to dial plan configuration although implemented in a different manner than typical dial plan forwarding. Usually in SIP most forwarding decisions are based on call destination. Caller sensitive forwarding amends this mechanism, to allow for some limited forwarding based on the source of the call (extension that initiated the call). It is implemented by allowing Media Server to participate in forwarding decisions.

In its current incarnation this mechanism is only used to configure emergency/911 calling. In theory it's possible to use it for other location sensitive services such as 411 (white/yellow pages) or country specific 800 and 900 services.

Note: It is important to note, that the recommended way of configuring emergency/911 calling remains adding a special route to the emergency gateway directly on the user agent (i.e. the phone). Using Caller Sensitive Forwarding in no way prevents the user from configuring emergency/911 routes directly on the phones, if the phones support such configuration.

Note: Using Caller Sensitive Routing replaces settings made in the Emergency Dialing plan. Therefore, you can use either the more simplistic emergency dial plan or caller sensitive routing of emergency calls but not both.

Configuration

The screen for Caller Sensitive Emergency Routing is a bit hard to find. Go to Dialing Plans, then click on the Emergency plan. If the Use Caller Sensitive Emergency Routing box is checked, there will be a link below it for configuring the routing. Click this link, to go to the Caller Sensitive Emergency Routing configuration page. This screen allows sipX administrator to configure phone numbers, for which 911 calls are forwarded to specific gateways.

Image:CallerSensRouting.png


Important note: If you configure your phones to directly route emergency calls to a gateway defined in the phone, then Caller Sensitive Forwarding should not be used. The reason is that an emergency call would never be routed to the sipX server and therefore the rule will never apply. However, if you have a mixed environment of phones where some phones have the capability to directly route emergency calls and others do not, then it would make sense to use this feature.

The first section of the screen allows the definition of a default setting. A default external emergency number (e.g. "911") and gateway are defined through which all emergency calls should be routed. The gateway to be used has to be defined as a gateway first.

By selecting Add Exceptions a second section is opened that allows the definition of a set of extension numbers for which emergency calls are routed to the gateway specified under exceptions. The exception list is a comma separated list of extensions. There is no wild card capability on the list, and one cannot specify the user or device group either. The only way to put the extension number on the exception list is to list it explicitly. If Media Server finds the originating extension on the exception list, it forwards the call through the gateway associated with that exception list, and not through the default gateway.

Note: Several exception sections can be added by pressing Add Exception several times.

The model use case for this feature is a small remote office with few extensions (and cheap) phones. The administrator puts all the extensions in that office on one exception list and associates them with a gateway located in the remote office. All remaining extensions are handled by the default case.

Simultaneously with forwarding the call, media server plays the following message "Your call is being forwarded to emergency response services etc." - in some cases users are able to cancel the call if 911 was dialed by mistake.

Activate the Dial Plan

In order to activate Caller Sensitive Routing rules, one needs to apply the new dialing settings and then activate the dial plan. The dial plan is activated by clicking on the Activate button on the Dial Plan screen and then follow the instructions on the next screen.


Important note: The Dial Plan is not active until activated. There is no warning or other message that will remind you to activate the dialplan should you defer that to later after making changes.


Image:DialPlans.png

Note: In order to complete the activation process certain server processes need to be re-started. sipXconfig will offer to restart necessary services automatically. This will take 1 to 2 seconds and in-process calls are not affected.

Implementation

The feature itself is implemented by the Media Server. The sipXconfig application communicates with the Media Server through an XML file generated every time the exception list changes. The file is named e911rules.xml and it is located in the /etc/sipx directory.

The following example shows the file with 2 exception lists (one with 123, 122 and the other one with a single 523 extension).

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:noNamespaceSchemaLocation="e911rules.xsd">
	<defaultMatch>
		<transform>
			<user>919</user>
			<host>10.2.3.4</host>
		</transform>
	</defaultMatch>
	<userMatch>
	<userPattern>123</userPattern>
		<userPattern>122</userPattern>
		<transform>
			<user>911</user>
			<host>47.1.2.22</host>
		</transform>
	</userMatch>
	<userMatch>
		<userPattern>523</userPattern>
		<transform>
			<user>911</user>
			<host>10.1.2.1</host>
		</transform>
	</userMatch>
</mappings>

Enabling Caller Sensitive Routing for emergency calls results in replacing the fall back rule that forwards emergency calls directly to the specified gateways with the rule that forwards emergency calls to the Media Server. It is achieved by inserting the following URL in the file fallbackrules.xml.

<sip:{digits}@{mediaserver};play={voicemail}/cgi-bin/voicemail/mediaserver.cgi?action=sos>
Personal tools