Make a call
 

After the line device has been selected and activated, you are bale to make calls on it. Calls are created using the MakeCall or MakeCall (2) method of ThbTapiLine. Make call accepts a destination address (phone number) and uses the line's CallParams property for further settings like the call's media mode or the line's address to use.

MakeCall (2) accepts a CallParams object with these additional information.

try
  hbTapiLine1.MakeCall('123456');
except
  on EhbTapiError do
    // Handle an error
end;

In some cases you will have to modify the ThbTapiLine.CallParams property i.g. to make a call with a special media mode or a special address. The example below uses the line's CallParams property for additional call settings. It creates a call with the media mode LINEMEDIAMODE_INTERACTIVEVOICE on the second address of the line.

hbTapiLine1.CallParams.AddressID := 1;
hbTapiLine1.CallParams.MediaMode := LINEMEDIAMODE_INTERACTIVEVOICE;
try
  hbTapiLine1.MakeCall('123456');
except
  on EhbTapiError do
    // Handle an error
end;

Another way is to use the ThbTapiCallParams object to pass parametes to the MakeCall method.

procedure TForm1.MakeCall(PhoneNo: String);
var cp: ThbTapiCallParams;
begin
  cp := ThbTapiCallParams.Create;
  try
    cp.AddressMode := LINEADDRESSMODE_ADDRESSID; // Default
    cp.AddressID   := 0; // Default
    cp.MediaMode   := LINEMEDIAMODE_DATAMODEM; // Select the media mode of the new call
    cp.Flags       := 0; // No special flags, default
    cp.NoAnswerTimeout := 3; // Number of seconds till timeout
    hbTapiLine1.MakeCall(PhoneNo, 0, cp.TapiData);
  finally
    cp.Free;
  end;
end;