Board index » delphi » Simple TAPI question

Simple TAPI question

I'm using Davide Moretti's TAPI unit to write a simple TAPI-compliant
dialer, however I would like to allow the end-user to select which TAPI
device they wish to use.

Does anybody know how to retrieve a list of attached TAPI devices and
select a particular one?

 

Re:Simple TAPI question


RAS?

--
Nicholas Robinson
Senior Software Engineer
Delta Data Capture
'...the complete data capture specialists...'
http://www.ddcapture.com/

Quote
Richard Sutcliffe wrote in message <01bd58b3$cf784d40$a2075cc3@richard>...
>I'm using Davide Moretti's TAPI unit to write a simple TAPI-compliant
>dialer, however I would like to allow the end-user to select which TAPI
>device they wish to use.

>Does anybody know how to retrieve a list of attached TAPI devices and
>select a particular one?

Re:Simple TAPI question


Richard Sutcliffe escribi en mensaje
<01bd58b3$cf784d40$a2075cc3@richard>...

Quote
>I'm using Davide Moretti's TAPI unit to write a simple TAPI-compliant
>dialer, however I would like to allow the end-user to select which TAPI
>device they wish to use.

>Does anybody know how to retrieve a list of attached TAPI devices and
>select a particular one?

with the TAPI functions:

LONG lineInitialize(LPHLINEAPP lphLineApp, HINSTANCE hInstance,
INECALLBACK lpfnCallback, LPCSTR lpszAppName, LPDWORD lpdwNumDevs)

if you want know the Devices count, and the function :

LONG lineGetDevCaps(HLINEAPP hLineApp, DWORD dwDeviceID,   DWORD
dwAPIVersion, DWORD dwExtVersion, LPLINEDEVCAPS lpLineDevCaps)

dwDeviceID is the Number of Device : 0...NumDevs..
wExtVersion must be 0

in lpLineDevCaps structure, you will find the record : LineNameOffset.
The value of LineNameOffset points to Offset from lpLineDevCaps where are
saved the name of Device as null-terminated string..

the structure in Delphi format should be :

 TLineDevCaps = record
    case Integer of
      0: (TotalSize          : DWORD;
          NeededSize         : DWORD;
          UsedSize           : DWORD;
         ProviderInfoSize   : DWORD;
          ProviderInfoOffset : DWORD;
          SwitchInfoSize     : DWORD;
          SwitchInfoOffset   : DWORD;
         PermanentLineId    : DWORD;
          LineNameSize       : DWORD;
          LineNameOffset     : DWORD;
          StringFormat       : DWORD;
          AddressModes       : DWORD;
          NumAddresses       : DWORD;
          BearerModes        : DWORD;
          MaxRate            : DWORD;
          MediaModes         : DWORD;
          GenerateToneModes  : DWORD;
          GenerateToneMaxNumFreq : DWORD;
          GenerateDigitModes : DWORD;
         MonitorToneMaxNumFreq : DWORD;
          MonitorToneMaxNumEntries : DWORD;
          MonitorDigitModes  : DWORD;
          GatherDigitsMinTimeout : DWORD;
          GatherDigitsMaxTimeout : DWORD;
          MedCtlDigitMaxListSize : DWORD;
          MedCtlMediaMaxListSize : DWORD;
          MedCtlToneMaxListSize : DWORD;
          MedCtlCallstateMaxListSize : DWORD;
          DevCapFlags        : DWORD;
          MaxNumActiveCalls  : DWORD;
          AnswerMode         : DWORD;
          RingModes          : DWORD;
          LineStates         : DWORD;
          UUIAcceptSize      : DWORD;
          UUIAnswerSize      : DWORD;
          UUIMakeCallsize    : DWORD;
          UUIdropSize        : DWORD;
          UUISendUserUserInfoSize : DWORD;
          UUICallInfoSize    : DWORD;
          MinDialParams      : TLineDialParams;
          MaxDialParams      : TLineDialParams;
          DefaultDialParams  : TLineDialParams;
          NumTerminals       : DWORD;
          TerminalCapsSize   : DWORD;
          TerminalCapsOffset : DWORD;
          TerminalTextEntrySize : DWORD;
          TerminalTextSize   : DWORD;
          TerminalTextOffset : DWORD;
          DevSpecificSize    : DWORD;
          DevSpecificOffset  : DWORD;
          LineFeatures       : DWORD;
          EndMark            : Integer);
      1: (Data               : array[0..65520] of Char);
  end;

In Delphi, you needs the Data record if you want read the Offset
bytes...Once you have filled the structure with  lineGetDevCaps function you
can read he name of Device

DeviceName := StrPas(LineCaps^.Data[LineCaps.LineNameOffset])

regards,

Raistlin

Other Threads