Ask the Wireless Pro 10-Minute Solution

Examining the Wireless Telephony Application Interface
By Jeromy Hill

One of the most overlooked features of the Wireless Application Protocol (WAP) is its ability to interface with cell phones directly. In this 10-Minute Solution, I examine some of the function calls that are available to the Wireless Telephony Application Interface (WTAI) and show you how to add them effectively to your applications and create the kind of seamless integration between voice and data devices that you ultimately seek.

All of WTAI's magic is contained within separate function libraries. For the scope of this Solution, I'll focus primarily on the Public WTAI function calls. Before I go any further into detail about them, you should know that you can find a much more detailed description of each function at the WAP Forum's specifications page—in particular, I'm referencing material covered in Document WAP-170, "Wireless Telephony Application Interface Specification." (You can download a PDF of it here.)

The makeCall Function
Let's take a look at the most basic of functions for a phone: making a call. The function is called, easily enough, makeCall. To make a phone call programmatically, rather than manually, write something like the following code:

WTAPublic.makeCall("1234567")
This makes a phone call from the phone to the number you specify as the argument. There are also some returns from this function that open more possibilities for application development. If the call is successful, the function will return an empty string. There are four error codes that are also possible outcomes:
  • 105 means the party is busy
  • 106 means the network is not available
  • 107 means the called party did not answer
  • 1 means an unspecified error
You can expand upon the basic function by examining its return values, as such:
Var call = WTAPublic.makeCall("1234567")
The call variable holds the return value of the function, and you can make a select against it to provide your end users with additional options. For example, if call equals "–105" you can inform your users that the line is busy and prompt them for either a second number or perhaps to wait a specified time and retry the number.

The sendDTMF Function
The WTAPublic.sendDTMF function is another call function. DTMF stands for "dual-tone multifrequency"—better known as Touch-Tone dialing. This function gives you the added benefit of adding a # and * in your dialing string.

For example, this code...

WTAPublic.sendDTMF("123*4567")
...would send the Touch-Tone sequence associated with that string, just as if the user had entered it on the keypad manually. Let's address the error return values, and then you'll be able to see what you can do with DTMF. The function returns an empty string if all went as planned:
  • 108 means that there is no active voice connection
  • 1 means an unspecified error
We all know the far-reaching grasp that computers and Touch-Tones have over our lives when we are required to enter account numbers or Social Security Numbers on a keypad to access information. (Or even to play songs!) The DTMF function can automate a great deal of this process. You can grab an account number from a database (granted, you would want to ensure some level of security here), store it temporarily in the phone's memory, and then make the phone dial the bank and transfer the information directly.

The addPBEntry Function
A great feature of cell phones is their ability to remember numbers for us. These mobile phone books can be quite useful. The function that adds entries to that phone book is WTAPublic.addPBEntry.

Imagine this scenario: pressing a single button (or soft key on your keypad) makes your phone read your bank's automated system, dial out, and enter your information. That would give you almost instantaneous access to your bank account.

Let's take a closer look at WTAPublic.addPBEntry. There are two parameters, as you would expect. One is the number and the other is the associated name. The function returns an empty string if the operation completed successfully, or one of six error codes listed below:

  • 100 means the name parameter is too long or unacceptable
  • 101 means the number parameter is not a valid phone number
  • 102 means the number parameter is too long
  • 103 means the phone book entry could not be written
  • 104 means the phone book is full
  • 1 means an unspecified error
Let's say you're a business that provides customer service over the phone. You can add a link to your WAP page that automatically stores your toll-free number in the user's phone to make sure it's always readily available in the future. For the action of a key you would simply add the following code:
WTAPublic.addPBEntry("18001234567", "Cust Svc")
I hope this brief introduction to a few of the basic functions of WTAI gives you some insight into the possibility and the potential for interaction between the phone and the wireless Web device. If you want to know more information, check out the WAP Forum.

Return to Get Help with Wireless Dev Page

Return to Main Get Help Page
 
Other 10-Minute Solutions
 Anatomy of a WAP Site
 Writing Java for the Palm
 Configuration of IIS for WML MIME Content Types
 Making Dynamic Content Available via ASP
 Building a Web Clipping Application
 Examining the Wireless Telephony Application Interface
 Using XML Stylesheet Language Transformations
 Creating Banner Ads for Wireless Sites
 Taking a Look at the WAP Stack's Security Level
 Create Novel Wireless Features with Refresh and Timer Tag Combinations
 Visually Enhancing Wireless Web Sites
 Creating Controls by Hand in the .NET Compact Framework


Sponsored Links


Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map
Jupiterweb networks

internet.comearthweb.comDevx.comClickZ

Search Jupiterweb:

Jupitermedia Corporation has four divisions:
JupiterWeb, JupiterResearch, JupiterEvents, and JupiterImages

Copyright 2004 Jupitermedia Corporation All Rights Reserved.
Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Jupitermedia Corporate Info | Newsletters | Tech Jobs | E-mail Offers