Platform SDK: Web Telephony Engine

Setting the Custom Log Field

Each line entry in the log file includes the Custom Log field. This field is empty at the beginning of each call, but an application's scripts and Microsoft ActiveX® controls can set the contents of the field during the call. The Custom Log field consists of a default value and any number of name/value pairs. WTE supports multiple pairs in case several components need to use the Custom Log field simultaneously.

The syntax of the Custom Log field is as follows:

    <DefaultValue>;<Name1=Value1>;<Name2=Value2>&ldots;

By default, the Custom Log field is empty. To set the Custom Log field, an application must first use the LogCustomField property of the ExOM object to obtain an instance of the LogCustomField object. The application can then use the DefaultValue and Value properties of the LogCustomField object to set the contents of the Custom Log field. For example:

    <script LANGUAGE="VBScript">
    DIM objCustomLog
    Set objCustomLog = External.LogCustomField
    objCustomLog.DefaultValue="Step 1 completed"
    objCustomLog("callerID")="007"
        .
        .
        .
    </script>

WTE stores the Custom Log field strings internally, and constructs and adds the complete field to each subsequent line entry in the log. For instance, the script in the preceding example would cause the Custom Log field of all subsequent line entries to contain the following string:

    Step 1 completed;callerID=007

You can clear the default value or a named value by setting the value to an empty string.

Note that setting the DefaultValue or Value property does not cause a new line to be written to the log. To write a new line, use the External.Log method.