Platform SDK: Web Telephony Engine

The Session Object

A session is the period during which the WTE handles a call. A session begins when TAPI offers a call to the WTE, and the engine responds by creating a Session object. A session ends, and the Session object is destroyed, when the application calls the Session.Abandon method. At that point, all resources allocated for the call are destroyed.

A Web telephony application retrieves a reference to the session object by using the Session property of the ExOM object. An application uses the Session object to store and retrieve strings, numbers, and objects that it may need throughout the session. An application stores and retrieves items by using the Value property, specifying a name and value pair, as follows:

   External.Session ("UserName") = "Mr. Smith"
 
   UserName = External.Session ("UserName")

In case of objects, the application must use the Set statement to retrieve the object, or call the object's methods directly. For example:

   Set MySession = External.Session
 
   Set MyMapiSession ("MapiSession") = CreateObject ("mapi.session")
 
   Set MyMapiSession = External.Session ("MapiSession")
 
   External.Session ("MapiSession").Logon

The Session object includes a number of useful read-only properties. An application can use the LastVisitedTagID and LastVisitedPage properties to keep track of the pages that the caller visited. The SessionName and SessionState parameters identify the session and provide the status of the call. The ServerName property identifies the computer on which the WTE is running.