Source code of Windows XP (NT5)
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.

519 lines
21 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. confcall.c
  5. Abstract:
  6. TAPI Service Provider functions related to conference calls.
  7. TSPI_lineAddToConference
  8. TSPI_lineCompleteTransfer
  9. TSPI_linePrepareAddToConference
  10. TSPI_lineRemoveFromConference
  11. TSPI_lineSetupConference
  12. Environment:
  13. User Mode - Win32
  14. --*/
  15. ///////////////////////////////////////////////////////////////////////////////
  16. // //
  17. // Include files //
  18. // //
  19. ///////////////////////////////////////////////////////////////////////////////
  20. #include "globals.h"
  21. ///////////////////////////////////////////////////////////////////////////////
  22. // //
  23. // TSPI procedures //
  24. // //
  25. ///////////////////////////////////////////////////////////////////////////////
  26. LONG
  27. TSPIAPI
  28. TSPI_lineAddToConference(
  29. DRV_REQUESTID dwRequestID,
  30. HDRVCALL hdConfCall,
  31. HDRVCALL hdConsultCall
  32. )
  33. /*++
  34. Routine Description:
  35. This function adds the call specified by hdConsultCall to the conference
  36. call specified by hdConfCall.
  37. Note that the call handle of the added party remains valid after adding
  38. the call to a conference; its state will typically change to conferenced
  39. while the state of the conference call will typically become connected.
  40. The handle to an individual participating call can be used later to remove
  41. that party from the conference call using TSPI_lineRemoveFromConference.
  42. The call states of the calls participating in a conference are not
  43. independent. For example, when dropping a conference call, all
  44. participating calls may automatically become idle. The TAPI DLL may consult
  45. the line's device capabilities to determine what form of conference removal
  46. is available. The TAPI DLL or its client applications should track the
  47. LINE_CALLSTATE messages to determine what really happened to the calls
  48. involved.
  49. The conference call is established either via TSPI_lineSetupConference or
  50. TSPI_lineCompleteTransfer. The call added to a conference will typically be
  51. established using TSPI_lineSetupConference or
  52. TSPI_linePrepareAddToConference. Some switches may allow adding of an
  53. arbitrary calls to conference, and such a call may have been set up using
  54. TSPI_lineMakeCall and be on (hard) hold.
  55. Arguments:
  56. dwRequestID - Specifies the identifier of the asynchronous request.
  57. The Service Provider returns this value if the function completes
  58. asynchronously.
  59. hdConfCall - Specifies the Service Provider's opaque handle to the
  60. conference call. Valid call states: onHoldPendingConference, onHold.
  61. hdAddCall - Specifies the Service Provider's opaque handle to the call to
  62. be added to the conference call. Valid call states: connected, onHold.
  63. Return Values:
  64. Returns zero if the function is successful, the (positive) dwRequestID
  65. value if the function will be completed asynchronously, or a negative error
  66. number if an error has occurred. Possible error returns are:
  67. LINEERR_INVALCONFCALLHANDLE - The specified call handle for the
  68. conference call is invalid or is not a handle for a conference
  69. call.
  70. LINEERR_INVALCALLHANDLE - The specified call handle for the added
  71. call is invalid.
  72. LINEERR_INVALCALLSTATE - One or both of the specified calls are not
  73. in a valid state for the requested operation.
  74. LINEERR_CONFERENCEFULL - The maximum number of parties for a
  75. conference has been reached.
  76. LINEERR_OPERATIONUNAVAIL - The specified operation is not available.
  77. LINEERR_OPERATIONFAILED - The specified operation failed for
  78. unspecified reason.
  79. --*/
  80. {
  81. return LINEERR_OPERATIONUNAVAIL; // CODEWORK...
  82. }
  83. LONG
  84. TSPIAPI
  85. TSPI_lineCompleteTransfer(
  86. DRV_REQUESTID dwRequestID,
  87. HDRVCALL hdCall,
  88. HDRVCALL hdConsultCall,
  89. HTAPICALL htConfCall,
  90. LPHDRVCALL lphdConfCall,
  91. DWORD dwTransferMode
  92. )
  93. /*++
  94. Routine Description:
  95. This function completes the transfer of the specified call to the party
  96. connected in the consultation call.
  97. This operation completes the transfer of the original call, hdCall, to
  98. the party currently connected via hdConsultCall. The consultation call
  99. will typically have been dialed on the consultation call allocated as
  100. part of TSPI_lineSetupTransfer, but it may be any call to which the
  101. switch is capable of transferring hdCall.
  102. The transfer request can be resolved either as a transfer or as a
  103. three-way conference call. When resolved as a transfer, the parties
  104. connected via hdCall and hdConsultCall will be connected to each other,
  105. and both hdCall and hdConsultCall will typically be removed from the line
  106. they were on and both will transition to the idle state. Note that the
  107. Service Provider's opaque handles for these calls must remain valid after
  108. the transfer has completed. The TAPI DLL causes these handles to be
  109. invalidated when it is no longer interested in them using
  110. TSPI_lineCloseCall.
  111. When resolved as a conference, all three parties will enter in a
  112. conference call. Both existing call handles remain valid, but will
  113. transition to the conferenced state. A conference call handle will created
  114. and returned, and it will transition to the connected state.
  115. It may also be possible to perform a blind transfer of a call using
  116. TSPI_lineBlindTransfer.
  117. Arguments:
  118. dwRequestID - Specifies the identifier of the asynchronous request.
  119. The Service Provider returns this value if the function completes
  120. asynchronously.
  121. hdCall - Specifies the Service Provider's opaque handle to the call to be
  122. transferred. Valid call states: onHoldPendingTransfer.
  123. hdConsultCall - Specifies a handle to the call that represents a connection
  124. with the destination of the transfer. Valid call states: connected,
  125. ringback, busy.
  126. htConfCall - Specifies the TAPI DLL's opaque handle to the new call. If
  127. dwTransferMode is specified as LINETRANSFERMODE_CONFERENCE then the
  128. Service Provider must save this and use it in all subsequent calls to
  129. the LINEEVENT procedure reporting events on the call. Otherwise this
  130. parameter is ignored.
  131. lphdConfCall - Specifies a far pointer to an opaque HDRVCALL representing
  132. the Service Provider's identifier for the call. If dwTransferMode is
  133. specified as LINETRANSFERMODE_CONFERENCE then the Service Provider must
  134. fill this location with its opaque handle for the new conference call
  135. before this procedure returns, whether it decides to execute the
  136. request sychronously or asynchronously. This handle is invalid if the
  137. function results in an error (either synchronously or asynchronously).
  138. If dwTransferMode is some other value this parameter is ignored.
  139. dwTransferMode - Specifies how the initiated transfer request is to be
  140. resolved, of type LINETRANSFERMODE. Values are:
  141. LINETRANSFERMODE_TRANSFER - Resolve the initiated transfer by
  142. transferring the initial call to the consultation call.
  143. LINETRANSFERMODE_CONFERENCE - Resolve the initiated transfer by
  144. conferencing all three parties into a three-way conference call.
  145. A conference call is created and returned to the TAPI DLL.
  146. Return Values:
  147. Returns zero if the function is successful, the (positive) dwRequestID
  148. value if the function will be completed asynchronously, or a negative error
  149. number if an error has occurred. Possible error returns are:
  150. LINEERR_INVALCALLHANDLE - The specified call handle is invalid.
  151. LINEERR_INVALCONSULTCALLHANDLE - The specified consultation call
  152. handle is invalid.
  153. LINEERR_INVALCALLSTATE - One or both calls are not in a valid state
  154. for the requested operation.
  155. LINEERR_INVALTRANSFERMODE - The specified transfer mode parameter is
  156. invalid.
  157. LINEERR_INVALPOINTER - The specified pointer parameter is invalid.
  158. LINEERR_OPERATIONUNAVAIL - The specified operation is not available.
  159. LINEERR_OPERATIONFAILED - The specified operation failed for
  160. unspecified reason.
  161. --*/
  162. {
  163. return LINEERR_OPERATIONUNAVAIL; // CODEWORK...
  164. }
  165. LONG
  166. TSPIAPI
  167. TSPI_linePrepareAddToConference(
  168. DRV_REQUESTID dwRequestID,
  169. HDRVCALL hdConfCall,
  170. HTAPICALL htConsultCall,
  171. LPHDRVCALL lphdConsultCall,
  172. LPLINECALLPARAMS const lpCallParams
  173. )
  174. /*++
  175. Routine Description:
  176. This function prepares an existing conference call for the addition of
  177. another party. It creates a new, temporary consultation call. The new
  178. consulatation call can be subsequently added to the conference call.
  179. A conference call handle can be obtained via TSPI_lineSetupConference or
  180. via TSPI_lineCompleteTransfer that is resolved as a three-way conference
  181. call. The function TSPI_linePrepareAddToConference typically places the
  182. existing conference call in the onHoldPendingConference state and creates
  183. a consultation call that can be added later to the existing conference
  184. call via TSPI_lineAddToConference.
  185. The consultation call can be canceled using TSPI_lineDrop. It may also
  186. be possible for the TAPI DLL to swap between the consultation call and
  187. the held conference call via TSPI_lineSwapHold.
  188. The Service Provider initially does media monitoring on the new call for
  189. at least the set of media modes that were monitored for on the line.
  190. Arguments:
  191. dwRequestID - Specifies the identifier of the asynchronous request.
  192. The Service Provider returns this value if the function completes
  193. asynchronously.
  194. hdConfCall - Specifies the Service Provider's opaque handle to a
  195. conference call. Valid call states: connected.
  196. htAddCall - Specifies the TAPI DLL's opaque handle to the new, temporary
  197. consultation call. The Service Provider must save this and use it in
  198. all subsequent calls to the LINEEVENT procedure reporting events on
  199. the new call.
  200. lphdAddCall - Specifies a far pointer to an opaque HDRVCALL representing
  201. the Service Provider's identifier for the new, temporary consultation
  202. call. The Service Provider must fill this location with its opaque
  203. handle for the new call before this procedure returns, whether it
  204. decides to execute the request sychronously or asynchronously. This
  205. handle is invalid if the function results in an error (either
  206. synchronously or asynchronously).
  207. lpCallParams - Specifies a far pointer to call parameters to be used when
  208. establishing the consultation call. This parameter may be set to NULL
  209. if no special call setup parameters are desired.
  210. Return Values:
  211. Returns zero if the function is successful, the (positive) dwRequestID
  212. value if the function will be completed asynchronously, or a negative error
  213. number if an error has occurred. Possible error returns are:
  214. LINEERR_INVALCONFCALLHANDLE - The specified call handle for the
  215. conference call is invalid.
  216. LINEERR_INVALPOINTER - One or more of the specified pointer
  217. parameters are invalid.
  218. LINEERR_INVALCALLSTATE - The conference call is not in a valid state
  219. for the requested operation.
  220. LINEERR_CALLUNAVAIL - All call appearances on the specified address
  221. are currently allocated.
  222. LINEERR_CONFERENCEFULL - The maximum number of parties for a
  223. conference has been reached.
  224. LINEERR_INVALCALLPARAMS - The specified call parameters are invalid.
  225. LINEERR_OPERATIONUNAVAIL - The specified operation is not available.
  226. LINEERR_OPERATIONFAILED - The specified operation failed for
  227. unspecified reason.
  228. --*/
  229. {
  230. return LINEERR_OPERATIONUNAVAIL; // CODEWORK...
  231. }
  232. LONG
  233. TSPIAPI
  234. TSPI_lineSetupConference(
  235. DRV_REQUESTID dwRequestID,
  236. HDRVCALL hdCall,
  237. HDRVLINE hdLine,
  238. HTAPICALL htConfCall,
  239. LPHDRVCALL lphdConfCall,
  240. HTAPICALL htConsultCall,
  241. LPHDRVCALL lphdConsultCall,
  242. DWORD dwNumParties,
  243. LPLINECALLPARAMS const lpCallParams
  244. )
  245. /*++
  246. Routine Description:
  247. This function sets up a conference call for the addition of the third
  248. party.
  249. TSPI_lineSetupConference provides two ways for establishing a new
  250. conference call, depending on whether a normal two-party call is required
  251. to pre-exist or not. When setting up a conference call from an existing
  252. two-party call, the hdCall parameter is a valid call handle that is
  253. initially added to the conference call by the TSPI_lineSetupConference
  254. request and hdLine is ignored. On switches where conference call setup
  255. does not start with an existing call, hdCall must be NULL and hdLine
  256. must be specified to identify the line device on which to initiate the
  257. conference call. In either case, a consultation call is allocated for
  258. connecting to the party that is to be added to the call. The TAPI DLL
  259. can use TSPI_lineDial to dial the address of the other party.
  260. The conference call will typically transition into the
  261. onHoldPendingConference state, the consultation call dialtone state and
  262. the initial call (if one) into the conferenced state.
  263. A conference call can also be set up via a TSPI_lineCompleteTransfer that
  264. is resolved into a three-way conference.
  265. The TAPI DLL may be able to toggle between the consultation call and the
  266. conference call by using TSPI_lineSwapHold.
  267. Arguments:
  268. dwRequestID - Specifies the identifier of the asynchronous request.
  269. The Service Provider returns this value if the function completes
  270. asynchronously.
  271. hdCall - Specifies the Service Provider's opaque handle to the initial
  272. call that identifies the first party of a conference call. In some
  273. environments, a call must exist in order to start a conference call.
  274. In other telephony environments, no call initially exists and hdCall
  275. is left NULL. Valid call states: connected.
  276. hdLine - Specifies the Service Provider's opaque handle to the line device
  277. on which to originate the conference call if hdCall is NULL. The
  278. hdLine parameter is ignored if hdCall is non-NULL. The Service
  279. Provider reports which model it supports through the setupConfNull
  280. flag of the LINEADDRESSCAPS data structure.
  281. htConfCall - Specifies the TAPI DLL's opaque handle to the new conference
  282. call. The Service Provider must save this and use it in all subsequent
  283. calls to the LINEEVENT procedure reporting events on the new call.
  284. lphdConfCall - Specifies a far pointer to an opaque HDRVCALL representing
  285. the Service Provider's identifier for the newly created conference
  286. call. The Service Provider must fill this location with its opaque
  287. handle for the new call before this procedure returns, whether it
  288. decides to execute the request sychronously or asynchronously. This
  289. handle is invalid if the function results in an error (either
  290. synchronously or asynchronously).
  291. htAddCall - Specifies the TAPI DLL's opaque handle to a new call. When
  292. setting up a call for the addition of a new party, a new temporary call
  293. (consultation call) is automatically allocated. The Service Provider
  294. must save the htAddCall and use it in all subsequent calls to the
  295. LINEEVENT procedure reporting events on the new consultation call.
  296. lphdAddCall - Specifies a far pointer to an opaque HDRVCALL representing
  297. the Service Provider's identifier for a call. When setting up a call
  298. for the addition of a new party, a new temporary call (consultation
  299. call) is automatically allocated. The Service Provider must fill this
  300. location with its opaque handle for the new consultation call before
  301. this procedure returns, whether it decides to execute the request
  302. sychronously or asynchronously. This handle is invalid if the
  303. function results in an error (either synchronously or asynchronously).
  304. dwNumParties - Specifies the expected number of parties in the conference
  305. call. The service provider is free to do with this number as it
  306. pleases; ignore it, use it a hint to allocate the right size
  307. conference bridge inside the switch, etc.
  308. lpCallParams - Specifies a far pointer to call parameters to be used when
  309. establishing the consultation call. This parameter may be set to NULL
  310. if no special call setup parameters are desired.
  311. Return Values:
  312. Returns zero if the function is successful, the (positive) dwRequestID
  313. value if the function will be completed asynchronously, or a negative error
  314. number if an error has occurred. Possible error returns are:
  315. LINEERR_INVALCALLHANDLE - The specified call handle for the conference
  316. call is invalid. This error may also indicate that the telephony
  317. environment requires an initial call to set up a conference but a
  318. NULL call handle was supplied.
  319. LINEERR_INVALLINEHANDLE - The specified line handle for the line
  320. containing the conference call is invalid. This error may also
  321. indicate that the telephony environment requires an initial line
  322. to set up a conference but a non-NULL call handle was supplied
  323. instead.
  324. LINEERR_INVALCALLSTATE - The call is not in a valid state for the
  325. requested operation.
  326. LINEERR_CALLUNAVAIL - All call appearances on the specified address
  327. are currently allocated.
  328. LINEERR_CONFERENCEFULL - The requested number of parties cannot be
  329. satisfied.
  330. LINEERR_INVALPOINTER - One or more of the specified pointer
  331. parameters are invalid.
  332. LINEERR_INVALCALLPARAMS - The specified call parameters are invalid.
  333. LINEERR_OPERATIONUNAVAIL - The specified operation is not available.
  334. LINEERR_OPERATIONFAILED - The specified operation failed for
  335. unspecified reason.
  336. --*/
  337. {
  338. return LINEERR_OPERATIONUNAVAIL; // CODEWORK...
  339. }
  340. LONG
  341. TSPIAPI
  342. TSPI_lineRemoveFromConference(
  343. DRV_REQUESTID dwRequestID,
  344. HDRVCALL hdCall
  345. )
  346. /*++
  347. Routine Description:
  348. This function removes the specified call from the conference call to
  349. which it currently belongs. The remaining calls in the conference
  350. call are unaffected.
  351. This operation removes a party that currently belongs to a conference
  352. call. After the call has been successfully removed, it may be possible
  353. to further manipulate it using its handle. The availability of this
  354. operation and its result are likely to be limited in many
  355. implementations. For example, in many implementations, only the most
  356. recently added party may be removed from a conference, and the removed
  357. call may be automatically dropped (becomes idle). Consult the line's
  358. device capabilities to determine the available effects of removing a
  359. call from a conference.
  360. Arguments:
  361. dwRequestID - Specifies the identifier of the asynchronous request.
  362. The Service Provider returns this value if the function completes
  363. asynchronously.
  364. hdCall - Specifies the Service Provider's opaque handle to the call
  365. to be removed from the conference. Valid call states: conferenced.
  366. Return Values:
  367. Returns zero if the function is successful, the (positive) dwRequestID
  368. value if the function will be completed asynchronously, or a negative error
  369. number if an error has occurred. Possible error returns are:
  370. LINEERR_INVALCALLHANDLE - The specified call handle is invalid.
  371. LINEERR_INVALCALLSTATE - The call is not in a valid state for the
  372. requested operation.
  373. LINEERR_OPERATIONUNAVAIL - The specified operation is not available.
  374. LINEERR_OPERATIONFAILED - The specified operation failed for
  375. unspecified reasons.
  376. --*/
  377. {
  378. return LINEERR_OPERATIONUNAVAIL; // CODEWORK...
  379. }