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.

126 lines
3.6 KiB

  1. #ifndef _ICALL_IN_H_
  2. #define _ICALL_IN_H_
  3. #include "rostinfo.h"
  4. // BUGBUG:
  5. // This is defined as 128 because the RNC_ROSTER structure has the
  6. // same limitation. Investigate what the appropriate number is.
  7. const int MAX_CALLER_NAME = 128;
  8. class COprahNCUI;
  9. class CIncomingCall : public INmCall, public DllRefCount, public CConnectionPointContainer
  10. {
  11. private:
  12. COprahNCUI * m_pOprahNCUI;
  13. IH323Endpoint* m_pConnection;
  14. BOOL m_fInvite;
  15. CONF_HANDLE m_hConf;
  16. BSTR m_bstrCaller;
  17. NM_CALL_STATE m_State;
  18. UINT m_dwFlags;
  19. USER_DATA_LIST m_UserData;
  20. GUID m_guidNode;
  21. BOOL m_fMemberAdded;
  22. VOID ProcessT120UserData(
  23. PUSERDATAINFO pUserDataInfoEntries,
  24. UINT cUserDataEntries);
  25. public:
  26. CIncomingCall( COprahNCUI *pOprahNCUI,
  27. IH323Endpoint* pConnection,
  28. P_APP_CALL_SETUP_DATA lpvMNMData,
  29. DWORD dwFlags);
  30. CIncomingCall( COprahNCUI *pOprahNCUI,
  31. BOOL fInvite,
  32. CONF_HANDLE hConf,
  33. PCWSTR pcwszNodeName,
  34. PUSERDATAINFO pUserDataInfoEntries,
  35. UINT cUserDataEntries);
  36. ~CIncomingCall();
  37. // this method will need to be changed to support proposed the cookie for NM3.0 callers
  38. // it will still need to handle 2.X callers
  39. BOOL MatchAcceptedCaller(PCWSTR pcwszNodeName);
  40. BOOL MatchAcceptedCaller(GUID* pguidNodeId);
  41. BOOL MatchActiveCaller(GUID* pguidNodeId);
  42. IH323Endpoint * GetH323Connection() { return m_pConnection; }
  43. HRESULT OnH323Connected();
  44. HRESULT OnH323Disconnected();
  45. UINT GetFlags() { return m_dwFlags; }
  46. BOOL IsDataOnly() { return (0 == ((CRPCF_AUDIO | CRPCF_VIDEO) & m_dwFlags)); }
  47. BOOL DidUserAccept() { return (NM_CALL_ACCEPTED == m_State); }
  48. VOID SetConfHandle(CONF_HANDLE hConf) { m_hConf = hConf; }
  49. CONF_HANDLE GetConfHandle() { return m_hConf; }
  50. VOID OnIncomingT120Call(
  51. BOOL fInvite,
  52. PUSERDATAINFO pUserDataInfoEntries,
  53. UINT cUserDataEntries);
  54. HRESULT OnT120ConferenceEnded();
  55. HRESULT Terminate(BOOL fReject);
  56. GUID * GetNodeGuid() { return &m_guidNode; }
  57. void Ring();
  58. STDMETHODIMP_(ULONG) AddRef(void);
  59. STDMETHODIMP_(ULONG) Release(void);
  60. STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppvObj);
  61. STDMETHODIMP IsIncoming(void);
  62. STDMETHODIMP GetState(NM_CALL_STATE *pState);
  63. STDMETHODIMP GetName(BSTR *pbstrName);
  64. STDMETHODIMP GetAddr(BSTR *pbstrAddr, NM_ADDR_TYPE *puType);
  65. STDMETHODIMP GetUserData(REFGUID rguid, BYTE **ppb, ULONG *pcb);
  66. STDMETHODIMP GetConference(INmConference **ppConference);
  67. STDMETHODIMP Accept(void);
  68. STDMETHODIMP Reject(void);
  69. STDMETHODIMP Cancel(void);
  70. };
  71. class CIncomingCallManager
  72. {
  73. private:
  74. COBLIST m_CallList;
  75. public:
  76. CIncomingCallManager();
  77. ~CIncomingCallManager();
  78. CREQ_RESPONSETYPE OnIncomingH323Call(
  79. COprahNCUI *pManager,
  80. IH323Endpoint* pConnection,
  81. P_APP_CALL_SETUP_DATA lpvMNMData);
  82. VOID OnH323Connected(IH323Endpoint * lpConnection);
  83. VOID OnH323Disconnected(IH323Endpoint * lpConnection);
  84. HRESULT OnIncomingT120Call(
  85. COprahNCUI *pManager,
  86. BOOL fInvite,
  87. CONF_HANDLE hConf,
  88. PCWSTR pcwszNodeName,
  89. PUSERDATAINFO pUserDataInfoEntries,
  90. UINT cUserDataEntries,
  91. BOOL fSecure);
  92. VOID OnT120ConferenceEnded(CONF_HANDLE hConference);
  93. CIncomingCall* MatchAcceptedCaller(PCWSTR pcwszNodeName);
  94. CIncomingCall* MatchAcceptedCaller(GUID* pguidNodeId);
  95. CIncomingCall* MatchActiveCaller(GUID* pguidNodeId);
  96. GUID* GetGuidFromT120UserData(
  97. PUSERDATAINFO pUserDataInfoEntries,
  98. UINT cUserDataEntries);
  99. VOID CancelCalls();
  100. };
  101. #endif // _ICALL_IN_H_