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.

197 lines
8.7 KiB

  1. /*
  2. * File: ictlchan.h
  3. *
  4. * Network AV conference control channel interface header file.
  5. *
  6. * Revision History:
  7. *
  8. * 04/15/96 mikev created
  9. */
  10. #ifndef _ICTLCHAN_H
  11. #define _ICTLCHAN_H
  12. // Call progress states
  13. typedef enum {
  14. CCS_Idle,
  15. CCS_Connecting,
  16. CCS_Accepting,
  17. CCS_Ringing,
  18. CCS_Opening,
  19. CCS_Closing,
  20. CCS_Ready, // the diff between Ready and InUse is that going to the CCS_Ready
  21. // state notifies the parent object (The one that implements IConfAdvise) and
  22. // then the state goes immediately to CCS_InUse
  23. CCS_InUse,
  24. CCS_Listening,
  25. CCS_Disconnecting,
  26. CCS_Filtering
  27. }CtlChanStateType;
  28. //
  29. // event status codes passed to IConfAdvise::OnControlEvent
  30. //
  31. #define CCEV_RINGING 0x00000001 // waiting for user to accept
  32. #define CCEV_CONNECTED 0x00000002 // accepted. Remote user info is available.
  33. // undefined whether or not capabilities have been exchanged.
  34. // undefined whether or not default channels are open at this time Should there be a
  35. // CCEV_MEMBER_ADD indication even on a point to point connection then?
  36. #define CCEV_CAPABILITIES_READY 0x00000003 // capabilities are available. it's
  37. // best to cache them now, default channels will be opened next (may already be open)
  38. // attempts at opening ad-hoc channels can now be made
  39. #define CCEV_CHANNEL_READY_RX 0x00000004// (or call channel->OnChannelOpen ???)
  40. #define CCEV_CHANNEL_READY_TX 0x00000005//
  41. #define CCEV_CHANNEL_READY_BIDI 0x00000006//
  42. // parent obj supplies expected channels in EnumChannels(). Requests are fulfilled
  43. // using the supplied channels if possible, and if not, the request is passed upward
  44. #define CCEV_CHANNEL_REQUEST 0x00000007 // another channel is being requested
  45. // what about invalid requests, like unsupported formats? reject and report the error
  46. // upward or just pass upward and require the parent to reject?
  47. // what's the H.323 behavior of mute?
  48. //#define CCEV_MUTE_INDICATION 0x00000008
  49. //#define CCEV_UNMUTE_INDICATION 0x00000009
  50. //#define CCEV_MEMBER_ADD 0x0000000a
  51. //#define CCEV_MEMBER_DROP 0x0000000b
  52. #define CCEV_DISCONNECTING 0x0000000e // opportunity to cleanup channels
  53. #define CCEV_REMOTE_DISCONNECTING 0x0000000f // opportunity to cleanup channels
  54. #define CCEV_DISCONNECTED 0x00000010 //
  55. #define CCEV_ALL_CHANNELS_READY 0x00000011 // all *mandatory* channels are open
  56. // but not necessarily all channels
  57. #define CCEV_CALL_INCOMPLETE 0x00000012 // busy, no answer, rejected, etc.
  58. #define CCEV_ACCEPT_INCOMPLETE 0x00000013 //
  59. #define CCEV_CALLER_ID 0x00000014
  60. //
  61. // Extended information for CCEV_CALL_INCOMPLETE event. Not all are applicable to all
  62. // call control implementations
  63. //
  64. #define CCCI_UNKNOWN MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000000)
  65. #define CCCI_BUSY MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000001)
  66. #define CCCI_REJECTED MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000002)
  67. #define CCCI_REMOTE_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000003)
  68. #define CCCI_LOCAL_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000004)
  69. #define CCCI_CHANNEL_OPEN_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000005) // all mandatory channels could not be opened.
  70. #define CCCI_INCOMPATIBLE MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000006)
  71. #define CCCI_REMOTE_MEDIA_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000007)
  72. #define CCCI_LOCAL_MEDIA_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000008)
  73. #define CCCI_PROTOCOL_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x00000009)
  74. #define CCCI_USE_ALTERNATE_PROTOCOL MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x0000000a)
  75. #define CCCI_NO_ANSWER_TIMEOUT MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x0000000b)
  76. #define CCCI_GK_NO_RESOURCES MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x0000000c)
  77. #define CCCI_SECURITY_DENIED MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLINCOMPLETE, 0x0000000d)
  78. //
  79. // User information structure. This needs to be replaced by a real property interface.
  80. // The only viable content at this time is a user name string. There is still some
  81. // volatility in the H.323 draft regarding how the user name gets propagated
  82. typedef struct _user_info {
  83. DWORD dwCallerIDSize; // total size of this structure
  84. LPVOID lpvCallerIDData; // pointer to caller ID
  85. LPVOID lpvRemoteProtocolInfo; // protocol specific extra info
  86. LPVOID lpvLocalProtocolInfo; //
  87. }CTRL_USER_INFO, *LPCTRL_USER_INFO;
  88. #ifdef __cplusplus
  89. class IConfAdvise
  90. {
  91. public:
  92. STDMETHOD_(ULONG, AddRef()) =0;
  93. STDMETHOD_(ULONG, Release())=0;
  94. STDMETHOD(OnControlEvent(DWORD dwEvent, LPVOID lpvData, LPIControlChannel lpControlObject))=0;
  95. STDMETHOD(GetCapResolver(LPVOID *lplpCapObject, GUID CapType))=0;
  96. STDMETHOD_(LPWSTR, GetUserDisplayName()) =0;
  97. STDMETHOD_(PCC_ALIASNAMES, GetUserAliases()) =0;
  98. STDMETHOD_(PCC_ALIASITEM, GetUserDisplayAlias()) =0;
  99. STDMETHOD_( CREQ_RESPONSETYPE, FilterConnectionRequest(
  100. LPIControlChannel lpControlChannel, P_APP_CALL_SETUP_DATA pAppData))=0;
  101. // GetAcceptingObject may create a new conf object, but always creates a new control
  102. // channel and initializes it with a back pointer to the new or existing conf object.
  103. // the accepting object is the new control channel object. Whatever the accepting
  104. // objects back pointer points to will get the CCEV_CONNECTED notification and then
  105. // will be able to get the caller ID etc., and then decide if it wants to accept the
  106. // call.
  107. STDMETHOD(GetAcceptingObject(LPIControlChannel *lplpAcceptingObject,
  108. LPGUID pPID))=0;
  109. STDMETHOD(FindAcceptingObject(LPIControlChannel *lplpAcceptingObject,
  110. LPVOID lpvConfID))=0;
  111. STDMETHOD_(IH323Endpoint *, GetIConnIF()) =0;
  112. STDMETHOD(AddCommChannel) (THIS_ ICtrlCommChan *pChan) PURE;
  113. };
  114. class IControlChannel
  115. {
  116. public:
  117. STDMETHOD_(ULONG, AddRef()) =0;
  118. STDMETHOD_(ULONG, Release())=0;
  119. STDMETHOD( Init(IConfAdvise *pConfAdvise))=0;
  120. STDMETHOD( DeInit(IConfAdvise *pConfAdvise))=0;
  121. // so we know what address we accepted on
  122. STDMETHOD( GetLocalAddress(PSOCKADDR_IN *lplpAddr))=0;
  123. // so we know the address of the caller
  124. STDMETHOD( GetRemoteAddress(PSOCKADDR_IN *lplpAddr))=0;
  125. STDMETHOD( GetRemotePort(PORT * lpPort))=0;
  126. STDMETHOD( GetLocalPort(PORT * lpPort))=0;
  127. STDMETHOD(PlaceCall (BOOL bUseGKResolution, PSOCKADDR_IN pCallAddr,
  128. P_H323ALIASLIST pDestinationAliases, P_H323ALIASLIST pExtraAliases,
  129. LPCWSTR pCalledPartyNumber, P_APP_CALL_SETUP_DATA pAppData))=0;
  130. STDMETHOD_(VOID, Disconnect(DWORD dwReason))=0;
  131. STDMETHOD( ListenOn(PORT Port))=0;
  132. STDMETHOD( StopListen(VOID))=0;
  133. STDMETHOD( AsyncAcceptRejectCall(CREQ_RESPONSETYPE Response))=0;
  134. // accept from the listening connection. The ideal is that the accepting
  135. // object would QueryInterface for a private interface, then grab all the
  136. // pertinent connection info through that interface. Temporarily expose this
  137. // using the IControlChannel interface. The call control state will vary greatly
  138. // between implementations. For some implementations, this may perform
  139. // a socket accept before user information has been exchanged. User information will
  140. // be read into the accepting object directly. For other implementations, the
  141. // socket accept is decoupled and has already been performed, and user information
  142. // has already been read into the listening object. In that case, this method
  143. // copies the user info and advises the parent "Conference" object of the
  144. // incoming call
  145. STDMETHOD( AcceptConnection(IControlChannel *pListenObject, LPVOID lpvAcceptData))=0;
  146. // true if this channel is resonsible for accepting connections into the conference
  147. // indicated by lpvConfID. In the future this may be split into two methods:
  148. // GetConfID() and IsAccepting()
  149. STDMETHOD_(BOOL, IsAcceptingConference(LPVOID lpvConfID))=0;
  150. STDMETHOD( GetProtocolID(LPGUID lpPID))=0;
  151. STDMETHOD_(IH323Endpoint *, GetIConnIF()) =0;
  152. STDMETHOD( MiscChannelCommand(ICtrlCommChan *pChannel,VOID * pCmd)) =0;
  153. STDMETHOD( MiscChannelIndication(ICtrlCommChan *pChannel,VOID * pCmd)) =0;
  154. STDMETHOD( OpenChannel(ICtrlCommChan* pCommChannel, IH323PubCap *pCapResolver,
  155. MEDIA_FORMAT_ID dwIDLocalSend, MEDIA_FORMAT_ID dwIDRemoteRecv))=0;
  156. STDMETHOD (CloseChannel(ICtrlCommChan* pCommChannel))=0;
  157. STDMETHOD (AddChannel(ICtrlCommChan * pCommChannel, LPIH323PubCap pCapabilityResolver))=0;
  158. STDMETHOD(GetVersionInfo)(THIS_
  159. PCC_VENDORINFO *ppLocalVendorInfo, PCC_VENDORINFO *ppRemoteVendorInfo) PURE;
  160. };
  161. #endif // __cplusplus
  162. #endif //#ifndef _ICTLCHAN_H