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.

146 lines
5.7 KiB

  1. /*
  2. * File: iconnect.h
  3. *
  4. * Network audio connection interface header file.
  5. *
  6. * Revision History:
  7. *
  8. * 04/15/96 mikev created
  9. */
  10. #ifndef _ICONNECT_H
  11. #define _ICONNECT_H
  12. #include "icomchan.h"
  13. #include "apierror.h"
  14. // RES_PAIR contains an instance of a matching set of local and remote
  15. // capability IDs.
  16. typedef struct res_pair
  17. {
  18. MEDIA_FORMAT_ID idLocal; // locally unique ID
  19. MEDIA_FORMAT_ID idRemote; // remote's ID
  20. MEDIA_FORMAT_ID idPublicLocal; // the public ID that corresponds to the (private) idLocal
  21. }RES_PAIR, *PRES_PAIR;
  22. typedef enum {
  23. AT_H323_ID =1, // unicode string (typically user name or full email address)
  24. AT_H323_E164, // unicode E164
  25. AT_INVALID // this always goes last. it marks the end of valid values
  26. }ALIAS_ADDR_TYPE;
  27. typedef struct
  28. {
  29. ALIAS_ADDR_TYPE aType;
  30. WORD wDataLength; // UNICODE character count
  31. LPWSTR lpwData; // UNICODE data.
  32. } H323ALIASNAME, *P_H323ALIASNAME;
  33. typedef struct
  34. {
  35. WORD wCount; // # of entries in array of H323ALIASNAME
  36. P_H323ALIASNAME pItems; // points to array of H323ALIASNAME
  37. } H323ALIASLIST, *P_H323ALIASLIST;
  38. typedef enum {
  39. CLS_Idle,
  40. CLS_Connecting,
  41. CLS_Inuse,
  42. CLS_Listening,
  43. CLS_Disconnecting,
  44. CLS_Alerting
  45. }ConnectStateType;
  46. //
  47. // call progress codes
  48. //
  49. #define CONNECTION_CONNECTED 0x00000001 // connected at network level
  50. #define CONNECTION_RECEIVED_DISCONNECT 0x00000002 // other end disconnected
  51. #define CONNECTION_CAPABILITIES_READY 0x00000003 // capabilities have been exchanged
  52. #define CONNECTION_PROCEEDING 0x00000005 // "ringing"
  53. #define CONNECTION_READY 0x00000006 // start talking!
  54. #define CONNECTION_REJECTED 0x00000007 // received a rejection
  55. #define CONNECTION_DISCONNECTED 0x00000008 // this end is now disconnected
  56. #define CONNECTION_BUSY 0x00000012 // busy signal
  57. #define CONNECTION_ERROR 0x00000013
  58. //
  59. // Call completion summary codes ("Reason") for disconnecting or being rejected.
  60. // This is a "first error" code. It is assigned its value at the first detectable
  61. // event which is known to terminate a call.
  62. //
  63. // The IConfAdvise implementation bears the responsibility for preserving the
  64. // summary codes. Control channel implementations (IControlChannel) supply the
  65. // best known summary code for each event, regardless of prior events.
  66. //
  67. #define CCR_INVALID_REASON 0 // this indicates that no reason has been assigned
  68. #define CCR_UNKNOWN MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 1)
  69. #define CCR_LOCAL_DISCONNECT MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 2)
  70. #define CCR_REMOTE_DISCONNECT MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 3)
  71. #define CCR_REMOTE_REJECTED MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 4)
  72. #define CCR_REMOTE_BUSY MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 5)
  73. #define CCR_LOCAL_PROTOCOL_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 6)
  74. #define CCR_REMOTE_PROTOCOL_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 7)
  75. #define CCR_INCOMPATIBLE_VERSION MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 8)
  76. #define CCR_LOCAL_SYSTEM_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 9)
  77. #define CCR_REMOTE_SYSTEM_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 10)
  78. #define CCR_LOCAL_MEDIA_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 11)
  79. #define CCR_REMOTE_MEDIA_ERROR MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 12)
  80. #define CCR_LOCAL_REJECT MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 13)
  81. #define CCR_LOCAL_BUSY MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 14)
  82. #define CCR_INCOMPATIBLE_CAPS MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 15) // no capabilities in common
  83. #define CCR_NO_ANSWER_TIMEOUT MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 16)
  84. #define CCR_GK_NO_RESOURCES MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 17)
  85. #define CCR_LOCAL_SECURITY_DENIED MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 18)
  86. #define CCR_REMOTE_SECURITY_DENIED MAKE_CUSTOM_HRESULT(SEVERITY_SUCCESS, TRUE, FACILITY_CALLSUMMARY, 19)
  87. //
  88. // IH323Endpoint
  89. //
  90. #undef INTERFACE
  91. #define INTERFACE IH323Endpoint
  92. DECLARE_INTERFACE( IH323Endpoint )
  93. {
  94. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  95. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  96. STDMETHOD_(ULONG,Release) (THIS) PURE;
  97. STDMETHOD(SetAdviseInterface)(THIS_ IH323ConfAdvise *pH323ConfAdvise) PURE;
  98. STDMETHOD(ClearAdviseInterface)(THIS) PURE;
  99. STDMETHOD(PlaceCall)(THIS_ BOOL bUseGKResolution, PSOCKADDR_IN pCallAddr,
  100. P_H323ALIASLIST pDestinationAliases, P_H323ALIASLIST pExtraAliases,
  101. LPCWSTR pCalledPartyNumber, P_APP_CALL_SETUP_DATA pAppData) PURE;
  102. STDMETHOD(Disconnect)(THIS) PURE;
  103. STDMETHOD(GetState)(THIS_ ConnectStateType *pState) PURE;
  104. STDMETHOD(GetRemoteUserName)(THIS_ LPWSTR lpwszName, UINT uSize) PURE;
  105. STDMETHOD(GetRemoteUserAddr)(THIS_ PSOCKADDR_IN psinUser) PURE;
  106. STDMETHOD(AcceptRejectConnection)(THIS_ CREQ_RESPONSETYPE Response) PURE;
  107. STDMETHOD_(HRESULT, GetSummaryCode)(THIS) PURE;
  108. STDMETHOD(CreateCommChannel)(THIS_ LPGUID pMediaGuid, ICommChannel **ppICommChannel,
  109. BOOL fSend) PURE;
  110. STDMETHOD (ResolveFormats)(THIS_ LPGUID pMediaGuidArray, UINT uNumMedia,
  111. PRES_PAIR pResOutput) PURE;
  112. STDMETHOD(GetVersionInfo)(THIS_
  113. PCC_VENDORINFO *ppLocalVendorInfo,
  114. PCC_VENDORINFO *ppRemoteVendorInfo) PURE;
  115. };
  116. #endif //#ifndef _ICONNECT_H