Platform SDK: Web Telephony Engine

Answering a Call

When a TAPI line device receives an incoming call, TAPI offers the call to the WTE. At this point, Web telephony creates a Session object, answers the call, and starts the application associated with the line being used for an incoming call. Web telephony starts an application by rendering the content of the application's HTML home page.

Having an Application Answer a Call

Alternatively, an administrator can configure Web telephony to leave call answering to an application by using the WTE administration tool. You can also do this programmatically by setting the WTEApplication.DelayedAnswering property to TRUE.

Allowing the application to answer calls gives the application a chance to perform lengthy pre-processing tasks before answering the call, or to check the caller ID (if provided) to determine whether to answer the call at all. Note that performing tasks before answering may cause the caller to hear an additional ringing sound while the task completes, but this is preferable to having one or two seconds of silence after the call is answered.

When an application is configured to answer calls, the WTE creates a Session object when TAPI offers a call to the engine, and then the engine navigates to the home page of the application. The home page must include an immediate script that answers the call, abandons it, or hands it off to another application. To answer or hand off the call, the application uses methods of the TAPI Call object, which can be obtained from the ITBasicCallControl property of the External object. To end the call, the application calls the Abandon method on the External object. In this case, no contact is established with the caller. The caller hears the phone ringing, followed by a dial tone when the call ends.

The following example shows how to write a script that either answers or abandons a call:

<SCRIPT Language=VBS>
' some code for determining whether to answer the call.
 
If WantToAnswer=1 Then
  Window.external.ITBasicCallControl.Answer
 
Else
  Window.external.Abandon
 
End If
 
</SCRIPT>

The WTE receives a notification from TAPI when the application answers the call. At that point, the engine begins rendering the application's HTML content.

Web telephony renders the application's HTML pages as the caller and the application interact. During the session, the WTE application can use the Session object to store objects and variables, keep track of the pages that the caller visited, retrieve status information, and so on. For more information, see Session Object.