sipxmedialib  Version 3.3
RTCPSession.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2013 SIPez LLC. All rights reserved.
3 //
4 // Copyright (C) 2004-2006 SIPfoundry Inc.
5 // Licensed by SIPfoundry under the LGPL license.
6 //
7 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
8 // Licensed to SIPfoundry under a Contributor Agreement.
9 //
10 // $$
12 
13 
14 // Border Guard
15 #ifndef _RTCPSession_h
16 #define _RTCPSession_h
17 
18 #include "rtcp/RtcpConfig.h"
19 
20 // Includes
21 #include "TLinkedList.h"
22 #include "RTCPConnection.h"
23 #include "IRTCPRender.h"
24 #include "INetworkRender.h"
25 #include "IRTCPSession.h"
26 #include "IRTCPNotify.h"
27 
28 
49  public CBaseClass, // Inherits CBaseClass implementation
50  public CTLinkedList<CRTCPConnection *>,
51  // Inherit Connection Linked List Services
52  public IRTCPSession, // Interface exposed for RTCP Session Control
53  public IRTCPNotify // Interface exposed for RTCP Notifications
54  {
55 
56 // Public Methods
57 public:
58 
80  CRTCPSession(unsigned long ulSSRC,
81  IRTCPNotify *piRTCPNotify,
82  ISDESReport *piSDESReport);
83 
105  ~CRTCPSession(void);
106 
107 
108 
126  IRTCPConnection *CreateRTCPConnection(void);
127 
128 
149  bool TerminateRTCPConnection(IRTCPConnection *piRTCPConnection);
150 
174  void TerminateAllConnections(void);
175 
197  void ReassignSSRC(unsigned long ulSSRC, unsigned char *puchReason=NULL);
198 
227  void ForwardSDESReport(IGetSrcDescription *piGetSrcDescription,
228  IRTCPConnection *piRTCPConnection);
229 
230 
258  void ForwardByeReport(IGetByeInfo *piGetByeInfo,
259  IRTCPConnection *piRTCPConnection);
260 
280  void CheckLocalSSRCCollisions(void);
281 
300  void CheckRemoteSSRCCollisions(IRTCPConnection *piRTCPConnection);
301 
319  void SetMixerMode(MIXER_MODE_ET etMixerMode);
320 
338 
355  unsigned long GetSessionID(void);
356 
373  ssrc_t GetSSRC(int, int, int);
374 
393  unsigned long GetEventInterest(void);
394 
395 
418  IRTCPConnection *GetFirstConnection(void);
419 
442  IRTCPConnection *GetNextConnection(void);
443 
444 
466  IRTCPConnection *CheckConnection(IRTCPConnection *);
467 
468 
497  void NewSDES(IGetSrcDescription *piGetSrcDescription,
498  IRTCPConnection *piRTCPConnection,
499  IRTCPSession *piRTCPSession=NULL);
500 
527  void UpdatedSDES(IGetSrcDescription *piGetSrcDescription,
528  unsigned long ulChangeMask,
529  IRTCPConnection *piRTCPConnection,
530  IRTCPSession *piRTCPSession=NULL);
531 
532 
557  void SenderReportReceived(IGetSenderStatistics *piGetSenderStatistics,
558  IRTCPConnection *piRTCPConnection,
559  IRTCPSession *piRTCPSession=NULL);
560 
561 
586  void ReceiverReportReceived(IGetReceiverStatistics *piGetReceiverStatistics,
587  IRTCPConnection *piRTCPConnection,
588  IRTCPSession *piRTCPSession=NULL);
589 
590 
617  void ByeReportReceived(IGetByeInfo *piGetByeInfo,
618  IRTCPConnection *piRTCPConnection,
619  IRTCPSession *piRTCPSession=NULL);
620 
645  void SDESReportSent(IGetSrcDescription *piGetSrcDescription,
646  IRTCPConnection *piRTCPConnection,
647  IRTCPSession *piRTCPSession=NULL);
648 
673  void SenderReportSent(IGetSenderStatistics *piGetSenderStatistics,
674  IRTCPConnection *piRTCPConnection,
675  IRTCPSession *piRTCPSession=NULL);
676 
677 
702  void ReceiverReportSent(IGetReceiverStatistics *piGetReceiverStatistics,
703  IRTCPConnection *piRTCPConnection,
704  IRTCPSession *piRTCPSession=NULL);
705 
706 
732  void ByeReportSent(IGetByeInfo *piGetByeInfo,
733  IRTCPConnection *piRTCPConnection,
734  IRTCPSession *piRTCPSession=NULL);
735 
758  void RTCPReportingAlarm(IRTCPConnection *piRTCPConnection,
759  IRTCPSession *piRTCPSession=NULL);
760 
761 
785  void RTCPConnectionStopped(IRTCPConnection *piRTCPConnection,
786  IRTCPSession *piRTCPSession=NULL);
787 
788 
789 
809 
810 private: // Private Member Functions
811 
834  void ResetAllConnections(unsigned char *puchReason);
835 
836 
837 private: // Private Data Members
838 
839 
850 
861  unsigned long m_ulSessionID;
862 
873  unsigned long m_ulEventInterest;
874 
885 
896  IRTCPNotify * m_piRTCPNotify;
897 
908  ISDESReport *m_piSDESReport;
909 
910 };
911 
912 
931 inline unsigned long CRTCPSession::GetEventInterest(void)
932 {
933 
934  return(m_ulEventInterest);
935 }
936 
958 inline IRTCPConnection
959  *CRTCPSession::CheckConnection(IRTCPConnection *piRTCPConnection)
960 {
961  // Attempt to retrieve the connection from the collection
962  CRTCPConnection *poRTCPConnection =
963  GetEntry((CRTCPConnection *)piRTCPConnection);
964 
965  // See whether the Render object is still active
966  if(poRTCPConnection)
967  {
968  IRTCPRender *piRtcpRender = poRTCPConnection->GetRenderInterface();
969  if(piRtcpRender)
970  {
971  piRtcpRender->Release(ADD_RELEASE_CALL_ARGS(__LINE__));
972  return((IRTCPConnection *)poRTCPConnection);
973  }
974  }
975 
976  return(NULL);
977 
978 }
979 
980 
999 {
1000 
1001 // Set the mixer attribute for this session
1002  m_etMixerMode = etMixerMode;
1003 
1004 }
1005 
1023 {
1024 
1025 // return the mixer attribute for this session
1026  return(m_etMixerMode);
1027 }
1028 
1045 inline unsigned long CRTCPSession::GetSessionID(void)
1046 {
1047 
1048  return(m_ulSessionID);
1049 
1050 }
1051 
1052 #endif
void ResetAllConnections(unsigned char *puchReason)
void RTCPConnectionStopped(IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
MIXER_MODE_ET GetMixerMode(void)
Definition: RTCPSession.h:1022
IRTCPConnection * GetFirstConnection(void)
ssrc_t GetSSRC(int, int, int)
void ForwardSDESReport(IGetSrcDescription *piGetSrcDescription, IRTCPConnection *piRTCPConnection)
IRTCPConnection * CreateRTCPConnection(void)
void SDESReportSent(IGetSrcDescription *piGetSrcDescription, IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
void RTCPReportingAlarm(IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
unsigned long m_ulSessionID
Definition: RTCPSession.h:861
IRTCPConnection * GetNextConnection(void)
bool TerminateRTCPConnection(IRTCPConnection *piRTCPConnection)
MIXER_MODE_ET
Definition: IRTCPSession.h:30
unsigned long m_ulEventInterest
Definition: RTCPSession.h:873
void ReceiverReportSent(IGetReceiverStatistics *piGetReceiverStatistics, IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
IRTCPRender * GetRenderInterface(void)
void CheckLocalSSRCCollisions(void)
IRTCPNotify * m_piRTCPNotify
Definition: RTCPSession.h:896
void SenderReportReceived(IGetSenderStatistics *piGetSenderStatistics, IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
Definition: RTCPSession.h:48
void UpdatedSDES(IGetSrcDescription *piGetSrcDescription, unsigned long ulChangeMask, IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
#define ADD_RELEASE_CALL_ARGS(x)
Definition: RtcpConfig.h:74
~CRTCPSession(void)
void CheckRemoteSSRCCollisions(IRTCPConnection *piRTCPConnection)
virtual CRTCPConnection * GetEntry(CRTCPConnection *tEntry)
void TerminateAllConnections(void)
IRTCPConnection * CheckConnection(IRTCPConnection *)
Definition: RTCPSession.h:959
void ByeReportSent(IGetByeInfo *piGetByeInfo, IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
Definition: RTCPConnection.h:71
#define DECLARE_IBASE_M
Definition: BaseClass.h:368
void ReassignSSRC(unsigned long ulSSRC, unsigned char *puchReason=NULL)
ssrc_t m_ulSSRC
Definition: RTCPSession.h:849
uint32_t ssrc_t
Definition: RtcpConfig.h:62
void ReceiverReportReceived(IGetReceiverStatistics *piGetReceiverStatistics, IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
unsigned long GetEventInterest(void)
Definition: RTCPSession.h:931
Definition: BaseClass.h:118
ISDESReport * m_piSDESReport
Definition: RTCPSession.h:908
MIXER_MODE_ET m_etMixerMode
Definition: RTCPSession.h:884
CRTCPSession(unsigned long ulSSRC, IRTCPNotify *piRTCPNotify, ISDESReport *piSDESReport)
void SenderReportSent(IGetSenderStatistics *piGetSenderStatistics, IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
Definition: TLinkedList.h:44
void NewSDES(IGetSrcDescription *piGetSrcDescription, IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
interface IGetSenderStatistics IGetReceiverStatistics IGetByeInfo ** piGetByeInfo
Definition: IRTCPStatistics.h:74
void ByeReportReceived(IGetByeInfo *piGetByeInfo, IRTCPConnection *piRTCPConnection, IRTCPSession *piRTCPSession=NULL)
unsigned long GetSessionID(void)
Definition: RTCPSession.h:1045
void ForwardByeReport(IGetByeInfo *piGetByeInfo, IRTCPConnection *piRTCPConnection)
void SetMixerMode(MIXER_MODE_ET etMixerMode)
Definition: RTCPSession.h:998