Showing posts with label a31. Make Phone Calls from Web Pages. Show all posts
Showing posts with label a31. Make Phone Calls from Web Pages. Show all posts

Saturday, September 6, 2008

How to add a phone book entry?

On your web site's Contact Us page, you probably want to provide an easy way for visitors to add your contact number into their Contacts list without quitting the browser. The Add Phone Book Entry WTAI URL allows you to do just that. The following link prompts a user to add the phone number +18001234567 as ABC Corp in their phone Contacts list :

        <6a7href="wtai://wp/ap;+18001234567;ABC Corp">
Add our contact number
77>

Adding a Contacts list entry from a web site

The complete syntax of the WTAI URL allows you to use a WML variable to capture the return status value of the operation. Table lists the possible return values.

wtai://wp/ap;[phone number];[contact name]![variable name]

Table The status codes after the Add Phone Book Entry operation

Status code

Description

0

Success

-1

Unspecified error

-100

The contact name parameter is too long or unacceptable

-101

The phone number is invalid

-102

The phone number is too long

-103

The phone entry cannot be written

-104

The phone book is full


The corresponding function in WMLScript is addPBEntry:

var flag = WTAPublic.addPBEntry ("+18001234567", "ABC Corp");

So far, I have covered the WTAI public library URLs and functions, which all Nokia devices support. Some phones might support extended WTAI libraries, which provide functions for call management, SMS texting, and more Contacts list operations. You need to check your phone manual and the Forum Nokia web site (http://forum.nokia.com) to find out exactly what WTAI calls are supported on your device.

How to send DMTF tone?

During an active voice call, if you click the following link, the phone will send touch tones (a.k.a. DTMF tones) for the keys 1#23*456 over the voice line:
          Send tone

This can be very useful for interacting with automated answering services, which ask you to press keys to navigate menus. You can also capture the return status of the operation in a WML variable. The following is the complete syntax of the "send DTMF" URL link.

         wtai://wp/sd;[tone sequence]![variable name]

Table. The status codes after the "send DTMF" operation

Status code

Description

0

Success

-1

Unspecified error

-108

There is no active voice connection


The corresponding WMLScript function for sending DTMF tones is as follows:

     var flag = WTAPublic.sendDTMF ("1#23*456");

Friday, August 22, 2008

How to Make Calls from WMLScript?


The WTAI not only defines URL schemes for making phone calls, but it also defines public functions you can invoke in WMLScripts. WMLScript requires the WAP gateway (or precompilation), so it is not as easy to use as plain URL links. On the other hand, WMLScript allows you specific logical conditions for making calls, and it makes it easier to handle the call status return value. For more information on WMLScript programming, check out W3Schools' WMLScript tutorial at http://www.w3schools.com/wmlscript/default.asp. The following WMLScript statement makes a phone call to number 5551234 and stores the return value in the flag variable:

var flag = WTAPublic.makeCall ("5551234");

If the call is successful, the return value in flag is an empty string. If the phone number is not formatted correctly, the flag value is invalid. If the call fails, the return value is one of the error codes.

The makeCall function call blocks, and it will not return until the call is finished. Hence, your browser might freeze when you are making a call via WMLScript.

How to Decide Whom to Call?


In the previous example, the phone number is hardcoded into the URL. This is not very convenient in many scenarios. For instance, you might want a drop-down list of local numbers to choose from, or you might want to be able to enter your own target numbers. With a little help from WML variables, you can easily make the call link dynamic. The following example shows a WML text entry box. You can enter any phone number in the box and then click the link below it to make the call

Download here

In the example, the phoneno WML variable captures your input in the text box. Then its value, $(phoneno), is embedded in the phone call URL as the phone number. If you enter an incorrectly formatted phone number (e.g., alphabetic letters with numbers), the browser will throw an error when you try to make the call.

How to Make Phone Calls from Web Pages?


You might have seen how you can click a link to dial your phone from your wireless operator's 411 service portal page. But how does this work? Well, the process is really easy, with a special WAP interface known as WTAI.

One of the coolest features in WML is its support for telephony functions known as the Wireless Telephony Applications Interface (WTAI). A Nokia WML browser allows users to make phone calls, send touch tones, and update the phone's Contacts list directly from a web page! Since the mobile phone is still primarily a voice communications tool, the ability to integrate the telephone experience with the web-browsing experience proves to be very useful. You can do that with either specially formatted URLs or WML-Script function calls.

You can "link" to any telephone number via a specially formatted URL from your web page. Once you click that URL, the phone prompts you to make a call to the specified phone number. The URL can be embedded in a or a element in your WML, XHTML MP, or plain HTML pages. The following example shows an XHTML MP page with a phone call link:

Download here

The number +15555551234 after the wtai://wp/mc; string in the URL specifies the phone number. You can use any phone number format that your phone and wireless operator can understand.

When you click the link and confirm the message, a call to the specified number is initiated. Once the call is connected, the phone goes back to the browser and you can continue browsing while staying on the phone. The small phone icon at the top-right corner of the last screen indicates that a voice call is in progress. Although the screen-shots are taken from a Series 60 device, the process is similar on Series 40 devices. On a Series 40 device, you are given an additional choice to quit the browser before the call is initiated.

If you are browsing over a GPRS connection, the connection is suspended while the phone call is active.