|
Prior you are able to use a line device to make or receive calls, the following steps are required:
Set DeviceName or DeviceID to select the device you wish to work with. All installed devices are listed in the ThbTapiLine's DeviceList property. In this list, the index of an device is equal to the DeviceID. To select a device you are able to set either the DeviceID or the DeviceName. If you set the DeviceID the DeviceName property will be updated. If you set the DeviceName property the name must match exactly the desired device. The DeviceID will be updated too. Example 1: Get all installed line devices procedure TForm1.FormCreate(Sender: TObject); Example 2: Select one installed line device procedure TForm1.ComboBox1Change(Sender: TObject); After a device is selected successfully and the Available property returns True, you are able to read the device's capabilities and examine the addresses too.
Set the MediaModes property to the type(s) of calls you want to handle. If your application is an inbound application that has to handle incoming calls of special media modes, you need to specify the media modes to become an owner of such calls. The supported media modes of the device can be found within the Caps.MediaModes property. You are able to select one or more media modes or set this value to zero to let ThbTapiLine select all supported media modes automatically. hbTapiLine1.DeviceID := 'Modem XYZ'; This setting works directly together with the Privileges property and is ignored if privileges are set to "None".
Set the Privileges property to that required for incoming calls. This setting does not affect the ability to make outbound calls. If your application has to make outgoing calls only, it is recommended to specify privilege None (selected media modes are ignored). The application will not be notified of any inbound or outbound calls aside from the one it creates by it's onw. If the application just wants to monitor calls, then it can specify privilege Monitor. If the application has to answer inbound calls of the specified MediaModes (Step 2), it must use privilege Owner. In that case, the application is NOT notified of calls, if another application has already opened the line device with owner privileges to the calls media mode. If the application has to handle inbound calls as an owner and wants to be notified of calls too, then it can specify privilege Owner and Monitor together. This is the most far-reaching selection and gives your application the full control to all calls. hbTapiLine1.Privileges.Owner := True; ThbTapiLine supports also the AutoSelect property to simpify selection of privileges. If AutoSelect is used, your Application should check the privileges is has gotten after activation.
Activate the line device by setting ThbTapiLine's Active property to True. hbTapiLine1.DeviceName := 'Sample TSP v1.0';
|