Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
5.8 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. devspec.h
  5. Abstract:
  6. This module contains the line/phoneDevSpecific interface
  7. definitions for tapi apps to pass data to esp32.tsp,
  8. i.e. msgs the app wants esp32.tsp to indicate
  9. Author:
  10. Dan Knudson (DanKn) 25-Apr-1996
  11. Revision History:
  12. Notes:
  13. --*/
  14. #define ESPDEVSPECIFIC_KEY ((DWORD) 'DPSE')
  15. #define ESP_DEVSPEC_MSG 1
  16. #define ESP_DEVSPEC_RESULT 2
  17. //
  18. // The following structure is used when an app wants to tell esp to
  19. // indicate a certain message, i.e. LINE_ADDRESSSTATE. Note that
  20. // the fields must be filled in with values that are valid at the
  21. // SPI level, which are not necessarily the same as those at the
  22. // API level. (Consult the win32 sdk for more info.) For example,
  23. // there is no LINE_CALLDEVSPECIFIC message defined a the API level,
  24. // but it is used at the SPI level to denote that TAPI should pass
  25. // the corresponding call handle (rather than the line handle) to
  26. // apps in the hDevice parameter of the LINE_DEVSPECIFIC message
  27. //
  28. typedef struct _ESPDEVSPECMSG
  29. {
  30. DWORD dwMsg;
  31. DWORD dwParam1;
  32. DWORD dwParam2;
  33. DWORD dwParam3;
  34. } ESPDEVSPECMSG, *PESPDEVSPECMSG;
  35. //
  36. // The following structure is used when an app wants to tell esp how
  37. // to complete next request. (Bear in mind that esp may override the
  38. // app's request if it encounters an "internal" error somewhere along
  39. // the way.) Valid values for the "lResult" field are 0 or any of
  40. // the LINEERR_XXX / PHONEERR_XXX constants defined in tapi.h. Valid
  41. // values for the "dwCompletionType" field are any of the ESP_RESULT_XXX
  42. // values defined below.
  43. //
  44. // This operation allows for testing the following scenarios for
  45. // synchronous telephony APIs:
  46. //
  47. // 1. Service provider's TSPI_xxx function returns success.
  48. // App recives success result
  49. //
  50. // 2. Service provider's TSPI_xxx function returns error.
  51. // App recives error result
  52. //
  53. // This operation allows for testing the following scenarios for
  54. // ASYNCHRONOUS telephony APIs (in each case, app recieves a request
  55. // id from the API, then later a LINE/PHONE_REPLY msg with a matching
  56. // request id (dwParam1) and result (dwParam2)):
  57. //
  58. // 1. Service provider's TSPI_xxx func calls tapi's completion proc
  59. // with success result
  60. //
  61. // 2. Service provider's worker thread calls tapi's completion proc
  62. // with success result
  63. //
  64. // 3. Service provider's TSPI_xxx function returns error
  65. //
  66. // 4. Service provider's TSPI_xxx func calls tapi's completion proc
  67. // with error result
  68. //
  69. // 5. Service provider's worker thread calls tapi's completion proc
  70. // with error result
  71. //
  72. typedef struct _ESPDEVSPECRESULT
  73. {
  74. LONG lResult; // 0, LINEERR_XXX, PHONEERR_XXX
  75. DWORD dwCompletionType; // ESP_RESULT_XXX
  76. } ESPDEVSPECRESULT, *PESPDEVSPECRESULT;
  77. #define ESP_RESULT_RETURNRESULT 0
  78. #define ESP_RESULT_CALLCOMPLPROCSYNC 1
  79. #define ESP_RESULT_CALLCOMPLPROCASYNC 2
  80. //
  81. // The following structure is the device specific information
  82. // "wrapper". The app must initialize the dwKey & dwType fields
  83. // to create a valid header and fill in the appropriate
  84. // union substructure before passing the info to esp32.tsp via
  85. // line/phoneDevSpecific.
  86. //
  87. // If esp32.tsp detects an invalid parameter(s) it will return an
  88. // OPERATIONFAILED error, and spit out relevant debug information
  89. // in the espexe.exe window.
  90. //
  91. typedef struct _ESPDEVSPECIFICINFO
  92. {
  93. DWORD dwKey; // App must init this to ESPDEVSPECIFIC_KEY
  94. DWORD dwType; // App must init this to ESP_DEVSPEC_MSG, ...
  95. union
  96. {
  97. ESPDEVSPECMSG EspMsg;
  98. ESPDEVSPECRESULT EspResult;
  99. } u;
  100. } ESPDEVSPECIFICINFO, *PESPDEVSPECIFICINFO;
  101. /*
  102. //
  103. // Example: if an app wanted esp32.tsp to indicate a
  104. // LINE_LINEDEVSTATE\RENINIT msg it would do
  105. // the following
  106. //
  107. {
  108. LONG lResult;
  109. HLINE hLine;
  110. ESPDEVSPECIFICINFO info;
  111. // do a lineInitialize, lineNegotiateAPIVersion, lineOpen, etc...
  112. info.dwKey = ESPDEVSPECIFIC_KEY;
  113. info.dwType = ESP_DEVSPEC_MSG;
  114. // make sure to use the SPI (not API) msg params here (not
  115. // necessarily the same)
  116. info.u.EspMsg.dwMsg = LINE_LINEDEVSTATE;
  117. info.u.EspMsg.dwParam1 = LINEDEVSTATE_REINIT;
  118. info.u.EspMsg.dwParam2 = 0;
  119. info.u.EspMsg.dwParam3 = 0;
  120. lResult = lineDevSpecific (hLine, 0, NULL, &info, sizeof (info));
  121. // some time later a LINE_LINEDEVSTATE\REINIT msg will show up
  122. }
  123. //
  124. // Example: if an app wanted esp32.tsp to fail a request
  125. // to lineMakeCall asynchronously with the error
  126. // LINEERR_CALLUNAVAIL it would do the following
  127. // (ESP's worker thread would complete the request
  128. // in this case)
  129. //
  130. {
  131. LONG lResult, lResult2;
  132. HCALL hCall;
  133. HLINE hLine;
  134. ESPDEVSPECIFICINFO info;
  135. // do a lineInitialize, lineNegotiateAPIVersion, lineOpen, etc...
  136. info.dwKey = ESPDEVSPECIFIC_KEY;
  137. info.dwType = ESP_DEVSPEC_RESULT;
  138. info.u.EspResult.lResult = LINEERR_CALLUNAVAIL;
  139. info.u.EspResult.dwCompletionType = ESP_RESULT_CALLCOMPLPROCASYNC;
  140. lResult = lineDevSpecific (hLine, 0, NULL, &info, sizeof (info));
  141. lResult2 = lineMakeCall (hLine, &hCall, "555-1212", 1, NULL);
  142. // some time later a LINE_REPLY will show for for both the DevSpecific
  143. // & MakeCall requests. the LINE_REPLY for the MakeCall will have
  144. // dwParam1 = lResult2, and dwParam2 = LINEERR_CALLUNAVAIL
  145. }
  146. */