ThbTapiLine.Active
Unit: hbTapi
 

This property activates and deactivates the telephony line device. In TAPI terms the lineOpen/lineClose function is called. The media modes defined in the ThbTapiLine.MediaModes property and the privleges defined in the ThbTapiLine.Privilege properties are used when opening (activating) the line device.

Opening a line device always entitles the application to make calls on any address available on the line (CallParams.AddressID). The ability of the application to deal with incoming calls or to be the target of call handoffs on the line is determined by the MediaModes parameter.

The Privileges value is used to register the application for having an interest in monitoring calls or receiving ownership of calls that are of the specified media types. If the application just wants to monitor calls, then it can specify LINECALLPRIVILEGE_MONITOR. If the application just wants to make outgoing calls, it can specify LINECALLPRIVILEGE_NONE. If the application is willing to control unclassified calls (calls of unknown media type), it can specify LINECALLPRIVILEGE_OWNER and LINEMEDIAMODE_UNKNOWN. Otherwise, the application should specify the media type it is interested in handling.

Availability

Design-Time: Read, Write / Run-Time: Read, Write

Declaration

property Active: Boolean;

Example 1:

The line is activated to handle (become the owner) of all call of the media mode interactive voice.

hbTapiLine1.DeviceName := 'Sample TSP v1.0';
hbTapiLine1.MediaModes := LINEMEDIAMODE_INTERACTIVEVOICE;
hbTapiLine1.Privileges.Owner := TRUE;

if hbTapiLine1.Available the
try
  hbTapiLine1.Active := True;
except
  on E:EhbTapiError do
    MessageDlg('Error opening line device: ' + E.Message, mtError, [mbOk],0);
end;

Example 2:

The line is activated to make outbound calls, inbound calls are not handled.

hbTapiLine1.DeviceName := 'Sample TSP v1.0';
hbTapiLine1.MediaModes := 0;
hbTapiLine1.Privileges.None := TRUE;

if hbTapiLine1.Available the
try
  hbTapiLine1.Active := True;
except
  on E:EhbTapiError do
    MessageDlg('Error opening line device: ' + E.Message, mtError, [mbOk],0);
end;

Example 3:

The line is activated with Privileges.AutoSelect option. The privileges are chosen automatically depending on the selected media modes.

hbTapiLine1.DeviceName := 'Sample TSP v1.0';
hbTapiLine1.MediaModes := LINEMEDIAMODE_INTERACTIVEVOICE;
hbTapiLine1.Privileges.AutoSelect := TRUE;

if hbTapiLine1.Available the
try
  hbTapiLine1.Active := True;
except
  on E:EhbTapiError do
    MessageDlg('Error opening line device: ' + E.Message, mtError, [mbOk],0);
end;

Errors

Using this property may cause an EhbTapiError exception. Possible errors are:

LINEERR_ALLOCATED, LINEERR_LINEMAPPERFAILED, LINEERR_BADDEVICEID, LINEERR_NODRIVER, LINEERR_INCOMPATIBLEAPIVERSION, LINEERR_NOMEM, LINEERR_INCOMPATIBLEEXTVERSION, LINEERR_OPERATIONFAILED, LINEERR_INVALAPPHANDLE, LINEERR_RESOURCEUNAVAIL, LINEERR_INVALMEDIAMODE, LINEERR_STRUCTURETOOSMALL, LINEERR_INVALPOINTER, LINEERR_UNINITIALIZED, LINEERR_INVALPRIVSELECT, LINEERR_REINIT, LINEERR_NODEVICE, LINEERR_OPERATIONUNAVAIL.

See Also

ThbTapiLine.MediaModes,ThbTapiLine.Privileges, Activating a telephony line device