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.

319 lines
9.2 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. call.h
  5. Abstract:
  6. Definitions for H.323 TAPI Service Provider call objects.
  7. Environment:
  8. User Mode - Win32
  9. Revision History:
  10. --*/
  11. #ifndef _INC_CALL
  12. #define _INC_CALL
  13. ///////////////////////////////////////////////////////////////////////////////
  14. // //
  15. // Header files //
  16. // //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #include "channel.h"
  19. ///////////////////////////////////////////////////////////////////////////////
  20. // //
  21. // Type definitions //
  22. // //
  23. ///////////////////////////////////////////////////////////////////////////////
  24. typedef enum _H323_CALLSTATE {
  25. H323_CALLSTATE_ALLOCATED = 0,
  26. H323_CALLSTATE_IN_USE
  27. } H323_CALLSTATE, *PH323_CALLSTATE;
  28. typedef struct _H323_U2ULE {
  29. LIST_ENTRY Link;
  30. DWORD dwU2USize;
  31. PBYTE pU2U;
  32. } H323_U2ULE, *PH323_U2ULE;
  33. typedef struct _H323_CALL {
  34. HDRVCALL hdCall; // tspi call handle
  35. HTAPICALL htCall; // tapi call handle
  36. CC_HCALL hccCall; // intelcc call handle
  37. CC_HCONFERENCE hccConf; // intelcc conf handle
  38. H323_CALLSTATE nState; // state of call object
  39. DWORD dwCallState; // tspi call state
  40. DWORD dwCallStateMode; // tspi call state mode
  41. DWORD dwOrigin; // inbound or outbound
  42. DWORD dwAddressType; // type of dst address
  43. DWORD dwIncomingModes; // available media modes
  44. DWORD dwOutgoingModes; // available media modes
  45. DWORD dwRequestedModes; // requested media modes
  46. DWORD dwAppSpecific;
  47. BOOL fMonitoringDigits; // listening for dtmf flag
  48. DWORD dwLinkSpeed; // speed of network connection
  49. LIST_ENTRY IncomingU2U; // incoming user user messages
  50. LIST_ENTRY OutgoingU2U; // outgoing user user messages
  51. CC_ADDR ccCalleeAddr; // intelcc src address
  52. CC_ADDR ccCallerAddr; // intelcc dst address
  53. CC_ALIASITEM ccCalleeAlias; // intelcc src alias
  54. CC_ALIASITEM ccCallerAlias; // intelcc dst alias
  55. CC_TERMCAP ccRemoteAudioCaps; // remote party audio
  56. CC_TERMCAP ccRemoteVideoCaps; // remote party video
  57. PH323_CHANNEL_TABLE pChannelTable; // table of logical channels
  58. struct _H323_LINE * pLine; // pointer to containing line
  59. } H323_CALL, *PH323_CALL;
  60. typedef struct _H323_CALL_TABLE {
  61. DWORD dwNumSlots; // number of entries
  62. DWORD dwNumInUse; // number of entries in use
  63. DWORD dwNumAllocated; // number of entries allocated
  64. DWORD dwNextAvailable; // next available table index
  65. PH323_CALL pCalls[ANYSIZE]; // array of object pointers
  66. } H323_CALL_TABLE, *PH323_CALL_TABLE;
  67. ///////////////////////////////////////////////////////////////////////////////
  68. // //
  69. // Public prototypes //
  70. // //
  71. ///////////////////////////////////////////////////////////////////////////////
  72. BOOL
  73. H323BindCall(
  74. PH323_CALL pCall,
  75. PCC_CONFERENCEID pConferenceID
  76. );
  77. BOOL
  78. H323UnbindCall(
  79. PH323_CALL pCall
  80. );
  81. BOOL
  82. H323PlaceCall(
  83. PH323_CALL pCall
  84. );
  85. BOOL
  86. H323HangupCall(
  87. PH323_CALL pCall
  88. );
  89. BOOL
  90. H323CloseCall(
  91. PH323_CALL pCall
  92. );
  93. BOOL
  94. H323DropCall(
  95. PH323_CALL pCall,
  96. DWORD dwDisconnectMode
  97. );
  98. BOOL
  99. H323GetCallAndLock(
  100. PH323_CALL * ppCall,
  101. HDRVCALL hdCall
  102. );
  103. BOOL
  104. H323GetCallByHCall(
  105. PH323_CALL * ppCall,
  106. struct _H323_LINE * pLine,
  107. CC_HCALL hccCall
  108. );
  109. BOOL
  110. H323ChangeCallState(
  111. PH323_CALL pCall,
  112. DWORD dwCallState,
  113. DWORD dwCallStateMode
  114. );
  115. BOOL
  116. H323ChangeCallStateToIdle(
  117. PH323_CALL pCall,
  118. DWORD dwDisconnectMode
  119. );
  120. BOOL
  121. H323AllocCallTable(
  122. PH323_CALL_TABLE * ppCallTable
  123. );
  124. BOOL
  125. H323FreeCallTable(
  126. PH323_CALL_TABLE pCallTable
  127. );
  128. BOOL
  129. H323CloseCallTable(
  130. PH323_CALL_TABLE pCallTable
  131. );
  132. BOOL
  133. H323AllocCallFromTable(
  134. PH323_CALL * ppCall,
  135. PH323_CALL_TABLE * ppCallTable,
  136. struct _H323_LINE * pLine
  137. );
  138. BOOL
  139. H323FreeCallFromTable(
  140. PH323_CALL pCall,
  141. PH323_CALL_TABLE pCallTable
  142. );
  143. BOOL
  144. H323UpdateMediaModes(
  145. PH323_CALL pCall
  146. );
  147. BOOL
  148. H323AcceptCall(
  149. PH323_CALL pCall
  150. );
  151. BOOL
  152. H323AddU2U(
  153. PLIST_ENTRY pListHead,
  154. DWORD dwDataSize,
  155. PBYTE pData
  156. );
  157. BOOL
  158. H323RemoveU2U(
  159. PLIST_ENTRY pListHead,
  160. PH323_U2ULE * ppU2ULE
  161. );
  162. DWORD
  163. H323DetermineLinkSpeed(
  164. DWORD dwHostAddr
  165. );
  166. BOOL
  167. H323GetTermCapList(
  168. PH323_CALL pCall,
  169. PCC_TERMCAPLIST pTermCapList,
  170. PCC_TERMCAPDESCRIPTORS pTermCapDescriptors
  171. );
  172. ///////////////////////////////////////////////////////////////////////////////
  173. // //
  174. // Call capabilites //
  175. // //
  176. ///////////////////////////////////////////////////////////////////////////////
  177. #define H323_CALL_INBOUNDSTATES (LINECALLSTATE_ACCEPTED | \
  178. LINECALLSTATE_CONNECTED | \
  179. LINECALLSTATE_DISCONNECTED | \
  180. LINECALLSTATE_IDLE | \
  181. LINECALLSTATE_OFFERING)
  182. #define H323_CALL_OUTBOUNDSTATES (LINECALLSTATE_CONNECTED | \
  183. LINECALLSTATE_DIALING | \
  184. LINECALLSTATE_DISCONNECTED | \
  185. LINECALLSTATE_IDLE | \
  186. LINECALLSTATE_RINGBACK)
  187. ///////////////////////////////////////////////////////////////////////////////
  188. // //
  189. // Macros //
  190. // //
  191. ///////////////////////////////////////////////////////////////////////////////
  192. #define H323IsCallAllocated(_pCall_) \
  193. ((_pCall_) != NULL)
  194. #define H323IsCallInUse(_pCall_) \
  195. (H323IsCallAllocated(_pCall_) && \
  196. ((_pCall_)->nState > H323_CALLSTATE_ALLOCATED))
  197. #define H323IsCallEqual(_pCall_,_hdCall_) \
  198. (H323IsCallInUse(_pCall_) && \
  199. ((_pCall_)->hdCall == (_hdCall_)))
  200. #define H323IsCallActive(_pCall_) \
  201. (((_pCall_)->dwCallState != LINECALLSTATE_IDLE) && \
  202. ((_pCall_)->dwCallState != LINECALLSTATE_DISCONNECTED))
  203. #define H323IsCallIdle(_pCall_) \
  204. ((_pCall_)->dwCallState == LINECALLSTATE_IDLE)
  205. #define H323IsCallDisconnected(_pCall_) \
  206. ((_pCall_)->dwCallState == LINECALLSTATE_DISCONNECTED)
  207. #define H323IsCallConnected(_pCall_) \
  208. ((_pCall_)->dwCallState == LINECALLSTATE_CONNECTED)
  209. #define H323IsCallProceeding(_pCall_) \
  210. (((_pCall_)->dwCallState == LINECALLSTATE_DIALING) || \
  211. ((_pCall_)->dwCallState == LINECALLSTATE_RINGBACK))
  212. #define H323IsCallOffering(_pCall_) \
  213. ((_pCall_)->dwCallState == LINECALLSTATE_OFFERING)
  214. #define H323IsCallInbound(_pCall_) \
  215. ((_pCall_)->dwOrigin == LINECALLORIGIN_INBOUND)
  216. #define H323GetCallFeatures(_pCall_) \
  217. (((_pCall_)->dwCallState != LINECALLSTATE_IDLE) \
  218. ? LINECALLFEATURE_DROP \
  219. : 0)
  220. #define H323GetLineHandle(_hdCall_) \
  221. ((HDRVLINE)(DWORD)HIWORD((DWORD)(_hdCall_)))
  222. #define H323GetCallTableIndex(_hdCall_) \
  223. ((DWORD)LOWORD((DWORD)(_hdCall_)))
  224. #define H323CreateCallHandle(_hdLine_,_i_) \
  225. ((HDRVCALL)MAKELONG(LOWORD((DWORD)(_i_)),LOWORD((DWORD)(_hdLine_))))
  226. #define H323IsVideoRequested(_pCall_) \
  227. ((_pCall_)->dwRequestedModes & LINEMEDIAMODE_VIDEO)
  228. #define H323IsAutomatedVoiceRequested(_pCall_) \
  229. ((_pCall_)->dwRequestedModes & LINEMEDIAMODE_AUTOMATEDVOICE)
  230. #define H323IsInteractiveVoiceRequested(_pCall_) \
  231. ((_pCall_)->dwRequestedModes & LINEMEDIAMODE_INTERACTIVEVOICE)
  232. #define H323IsMediaUnresolved(_pCall_) \
  233. ((_pCall_)->dwOutgoingModes & LINEMEDIAMODE_UNKNOWN)
  234. #define H323IsAudioRequested(_pCall_) \
  235. (H323IsAutomatedVoiceRequested(_pCall_) || \
  236. H323IsInteractiveVoiceRequested(_pCall_))
  237. #endif // _INC_CALL