Dialed Number Identification Service

If your central office and telephone switches provide DNIS information, your VoiceXML application can use the session.connection.local.uri variable to access the telephone number that the caller dialed.

You can use the DNIS information in many ways, such as to track responses to advertising. You can list different telephone numbers in different ads, and then track the response rates based on which number the user dialed.

Note: DNIS numbers are site-dependent because your location determines which users need to dial a country code, area code, city code, long distance access code, etc. to reach your application.

In the following example, a company wants to track which users are calling in response to an advertisement on the Web site and which in response to a product catalog. The company used different telephone numbers in the two ads: (800) 555-9999 in the Web ad, and (800) 555-9990 in the print ad. The VoiceXML application uses the DNIS information to determine which ad the user is responding to and increments a counter on a server that is performing the data mining.

<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-US">
 <var name="AddOneCaller" expr="1"/>
 <form id="RouteCallers">
  <block>
   <!-- Obtain phone number the user dialed. -->
   <var name="NumDialed" expr="session.connection.local.uri"/>
   <if cond="NumDialed == '8005559999'">
    <goto next="#UserFromWebsite"/>
   <elseif cond="NumDialed == '8005559990'"/>
    <goto next="#UserFromCatalog"/>
   </if>
  </block>
 </form>
 <form id="UserFromWebsite">
  <block>
   <!--Add one to the count of WebUsers-->
   <submit namelist="AddOneCaller"
           next="http://SupportLine.com/servlet/TrackWebUsers"/>
  </block>
 </form>
 <form id="UserFromCatalog">
  <block>
   <!-- Add one to the count of CatalogUsers -->
   <submit namelist="AddOneCaller"
           next="http://SupportLine.com/servlet/TrackCatalogUsers"/>
  </block>
 </form>
</vxml>