home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / k95source / ckntap.h < prev    next >
C/C++ Source or Header  |  2020-01-01  |  6KB  |  156 lines

  1. /* C K N T A P  --  Kermit Telephony interface for MS Win32 TAPI systems */
  2.  
  3. /*
  4.   Author: Jeffrey E Altman (jaltman@secure-endpoints.com),
  5.           Secure Endpoints Inc., New York City.
  6.  
  7.   Copyright (C) 1985, 2004, Trustees of Columbia University in the City of New
  8.   York.
  9. */
  10.  
  11. #ifdef CK_TAPI
  12. #ifdef COMMENT
  13. #undef CK_TAPI
  14. #endif /* COMMENT */
  15. #else
  16. #ifndef COMMENT
  17. #ifndef NODIAL
  18. #define CK_TAPI
  19. #endif /* NODIAL */
  20. #endif /* COMMENT */
  21. #endif
  22.  
  23. _PROTOTYP( int cktapiinit, (void) ) ;
  24. _PROTOTYP( int cktapiopen, (void) ) ;
  25. _PROTOTYP( int cktapiclose, (void) ) ;
  26. _PROTOTYP( int cktapiload, (void) ) ;
  27. _PROTOTYP( int cktapiunload, (void) ) ;
  28. _PROTOTYP( int cktapidial, (char *) ) ;
  29. _PROTOTYP( int cktapihangup, (void) ) ;
  30. _PROTOTYP( int cktapianswer, (void) ) ;
  31. _PROTOTYP( int cktapiBuildLineTable, (struct keytab **, struct keytab **, int *) ) ;
  32. _PROTOTYP( int cktapiBuildLocationTable, (struct keytab **, int *) ) ;
  33. _PROTOTYP( int cktapiFetchLocationInfoByID, (int) ) ;
  34. _PROTOTYP( int cktapiFetchLocationInfoByName, (char *) ) ;
  35. _PROTOTYP( int cktapiGetCurrentLocationID, (void) ) ;
  36. _PROTOTYP( void CopyTapiLocationInfoToKermitDialCmd, ( void ));
  37. _PROTOTYP( void cktapiConfigureLine, (int) );
  38. _PROTOTYP( void cktapiDialingProp, (void) );
  39. _PROTOTYP( int cktapiConvertPhoneNumber, (char * source, char ** converted));
  40. _PROTOTYP( int cktapiCallInProgress, (void));
  41. _PROTOTYP( int tapi_open, ( char * ) ) ;
  42. _PROTOTYP( int tapi_clos, ( void ) ) ;
  43. _PROTOTYP( HANDLE GetModemHandleFromLine, ( HLINE ) );
  44. _PROTOTYP( struct mdminf * cktapiGetModemInf, (DWORD,HANDLE) );
  45. _PROTOTYP( void DisplayCommProperties, (HANDLE));
  46. _PROTOTYP( void cktapiDisplayRegistryModemInfo, (LPCSTR));
  47. _PROTOTYP( void cktapiDisplayTapiLocationInfo, (VOID));
  48.  
  49. #define SUCCESS 0
  50. extern int TAPIAvail ;
  51.  
  52. #ifdef COMMENT
  53. From "comm/datamodem":
  54.  
  55. When using the lineGetDevConfig and lineSetDevConfig functions, some service
  56. providers require that the configuration data for this device class have the
  57. following format.
  58. #endif /* COMMENT */
  59. // Device setting information
  60. typedef struct  tagDEVCFGDR  {
  61.   DWORD       dwSize;
  62.   DWORD       dwVersion;
  63.   WORD        fwOptions;
  64.   WORD        wWaitBong;
  65. } DEVCFGHDR;
  66.  
  67. typedef struct  tagDEVCFG  {
  68.   DEVCFGHDR   dfgHdr;
  69.   COMMCONFIG  commconfig;
  70. } DEVCFG, *PDEVCFG, FAR* LPDEVCFG;
  71.  
  72. #ifdef COMMENT
  73. Contains device configuration information for use with the lineGetDevConfig
  74. and lineSetDevConfig functions.
  75.  
  76. dwSize          Sum of the size of the DEVCFGHDR structure and the actual
  77.                 size of COMMCONFIG structure.
  78. dwVersion       Version number of the Unimodem DevConfig structure. This
  79.                 member can be MDMCFG_VERSION (0x00010003).
  80. fwOptions       Option flags that appear on the Unimodem Option page.
  81.                 This member can be a combination of these values:
  82.  
  83. TERMINAL_PRE  (1)       Displays the preterminal screen.
  84. TERMINAL_POST (2)       Displays the post terminal screen.
  85. MANUAL_DIAL   (4)       Dials the phone manually, if capable of doing so.
  86. LAUNCH_LIGHTS (8)       Displays the modem tray icon.
  87.  
  88.                 Only the LAUNCH_LIGHTS value is set by default.
  89. wWaitBong       Number of seconds (in two seconds granularity) to replace
  90.                 the wait for credit tone ($).
  91. commconfig      COMMCONFIGstructure that can be used with the Win32
  92.                 communications and MCX functions.
  93. #endif /* COMMENT */
  94.  
  95. #ifdef COMMENT
  96. From lineSetDevConfig:
  97.  
  98. Typically, an application will call lineGetID to identify the media stream
  99. device associated with a line, and then call lineConfigDialog to allow the
  100. user to set up the device configuration. It could then call lineGetDevConfig
  101. and save the configuration information in a phone book or other database
  102. associated with a particular call destination. When the user later wants
  103. to call the same destination again, this function lineSetDevConfig can be
  104. used to restore the configuration settings selected by the user.
  105. lineSetDevConfig, lineConfigDialog, and lineGetDevConfigcan be used, in
  106. that order, to allow the user to view and update the settings.
  107.  
  108. The exact format of the data contained within the structure is specific
  109. to the line and media stream API (device class), is undocumented, and is
  110. undefined. The application must treat it as "opaque" and not manipulate the
  111. contents directly. Generally, the structure can be sent using this function
  112. only to the same device from which it was obtained. Certain Telephony
  113. service providers may, however, permit structures to be interchanged between
  114. identical devices (that is, multiple ports on the same multi-port modem card).
  115. Such interchangability is not guaranteed in any way, even for devices of
  116. the same device class.
  117.  
  118. Note that some service providers may permit the configuration to be set
  119. while a call is active, and others may not.
  120. #endif /* COMMENT */
  121.  
  122. #ifdef COMMENT
  123. Service providers that support LINEBEARERMODE_PASSTHROUGH indicate it in the
  124. dwBearerModes member of the LINEDEVCAPS structure. When
  125. LINEBEARERMODE_PASSTHROUGH is indicated, the Unimodem service provider will
  126. also include in the DevSpecific area of the LINEDEVCAPS structure the registry
  127. key used to access information about the modem associated with the line device,
  128. in the following format:
  129. #endif
  130.  
  131. typedef struct  tagDEVREGKEY {
  132.     DWORD dwContents;   // Set to 1 (indicates containing key)
  133.     DWORD dwKeyOffset;  // Offset to key from start of this
  134.                         // structure (not from start of
  135.                         // LINEDEVCAPS structure). 8 in
  136.                         // our case.
  137.     BYTE rgby[1];       // place containing null-terminated
  138.                         // registry key.
  139. } DEVREGKEY;
  140.  
  141. #ifdef COMMENT
  142. For example:
  143.     00000001 00000008 74737953 435c6d65  ........System\C
  144.     65727275 6f43746e 6f72746e 7465536c  urrentControlSet
  145.     7265535c 65636976 6c435c73 5c737361  urrentControlSet
  146.     65646f4d 30305c6d xx003030 xxxxxxxx  Modem\0000.
  147.  
  148. This registry key could then be opened using this function:
  149. RegOpenKey(HKEY_LOCAL_MACHINE, pszDevSpecificRegKey, &phkResult)
  150. #endif
  151.  
  152. int cktapiGetModemSettings(LPDEVCFG *, LPMODEMSETTINGS *, LPCOMMCONFIG *, DCB **);
  153. int cktapiDisplayModemSettings(LPDEVCFG, LPMODEMSETTINGS, LPCOMMCONFIG, DCB *);
  154. int cktapiSetModemSettings(LPDEVCFG,LPCOMMCONFIG);
  155.  
  156.