sipxmedialib  Version 3.3
SourceDescription.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 _SourceDescription_h
16 #define _SourceDescription_h
17 
18 #include "rtcp/RtcpConfig.h"
19 
20 // Includes
21 #include "BaseClass.h"
22 #include "RTCPHeader.h"
23 #include "ISDESReport.h"
24 #include "ISetSrcDescription.h"
25 #include "IGetSrcDescription.h"
26 
27 
49  public CBaseClass, // Inherits the CBaseClass implementation
50  public CRTCPHeader, // Inherits the CRTCPHeader implementation
51  public ISDESReport, // Interface exposed for SDES Reporting
52  public ISetSrcDescription,
53  // Interface exposed for modifying Source Description
54  public IGetSrcDescription
55  // Interface exposed for retrieving Source Description
56  {
57 
58 // Public Methods
59 public:
60 
89  CSourceDescription(ssrc_t ulSSRC=0,
90  unsigned char *puchName=NULL,
91  unsigned char *puchEmail=NULL,
92  unsigned char *puchPhone=NULL,
93  unsigned char *puchLocation=NULL,
94  unsigned char *puchAppName=NULL,
95  unsigned char *puchNotes=NULL,
96  unsigned char *puchPrivate=NULL);
97 
123  CSourceDescription(bool bHeader, unsigned char *puchSDESReport=NULL);
124 
125 
144  ~CSourceDescription(void);
145 
146 
165  static CSourceDescription *GetLocalSDES(void);
193  void SetAllComponents(unsigned char *puchName=NULL,
194  unsigned char *puchEmail=NULL,
195  unsigned char *puchPhone=NULL,
196  unsigned char *puchLocation=NULL,
197  unsigned char *puchAppName=NULL,
198  unsigned char *puchNotes=NULL,
199  unsigned char *puchPrivate=NULL);
200 
224  void GetAllComponents(unsigned char *puchName,
225  unsigned char *puchEmail,
226  unsigned char *puchPhone,
227  unsigned char *puchLocation,
228  unsigned char *puchAppName,
229  unsigned char *puchNotes,
230  unsigned char *puchPrivate);
231 
259  unsigned long GetFieldChange(unsigned long ulChangeMask,
260  unsigned long *pulFieldType,
261  unsigned char *puchFieldBuffer);
262 
263 
282  virtual ssrc_t GetSSRC(void);
283 
302  virtual void SetSSRC(ssrc_t ulSSRC);
303 
304 
327  bool SetName(unsigned char *puchCName, unsigned long ulLength=0);
328 
329 
352  unsigned long GetName(unsigned char *puchName);
353 
354 
376  bool SetEmail(unsigned char *puchEmail, unsigned long ulLength=0);
377 
378 
400  unsigned long GetEmail(unsigned char *puchEmail);
401 
402 
424  bool SetPhone(unsigned char *puchPhone, unsigned long ulLength=0);
425 
426 
448  unsigned long GetPhone(unsigned char *puchPhone);
449 
450 
473  bool SetAppName(unsigned char *puchAppName, unsigned long ulLength=0);
474 
475 
497  unsigned long GetAppName(unsigned char *puchAppName);
498 
499 
500 
523  bool SetLocation(unsigned char *puchLocation, unsigned long ulLength=0);
524 
525 
547  unsigned long GetLocation(unsigned char *puchLocation);
548 
549 
571  bool SetNotes(unsigned char *puchNotes, unsigned long ulLength=0);
572 
573 
595  unsigned long GetNotes(unsigned char *puchNotes);
596 
618  bool SetPrivate(unsigned char *puchPrivate, unsigned long ulLength=0);
619 
620 
642  unsigned long GetPrivate(unsigned char *puchNotes);
643 
660  ISDESReport * GetSDESInterface(void);
661 
680  IGetSrcDescription *GetAccessInterface(void);
681 
701  unsigned long GetChanges(void);
702 
703 
729 unsigned long FormatSDESReport(bool bHeader,
730  long lContentMask,
731  unsigned char *puchReportBuffer,
732  unsigned long ulBufferSize);
733 
734 
758  unsigned long ParseSDESReport(bool bHeader,
759  unsigned char *puchReportBuffer);
760 
761 
762 
763  private: // Private Methods
764 
788  bool FormulateCName(void);
789 
790 
813  bool SetCName(unsigned char *puchCName, unsigned long ulLength=0);
814 
815 
837  unsigned long GetCName(unsigned char *puchCName);
838 
860  unsigned long ExtractFieldInfo(unsigned char *puchReportBuffer);
861 
862 
882  unsigned long ExtractPadding(unsigned char *puchReportBuffer);
883 
909  unsigned long LoadFieldInfo(unsigned char *puchReportBuffer,
910  long lContentMask);
911 
935  unsigned long LoadFieldChanges(unsigned char *puchReportBuffer);
936 
937 
956  unsigned long TerminateNPad(unsigned char *puchReportBuffer,
957  bool *pbPadded);
958 
978 
979 
980 private: // Private Data Members
981 
992 
1004 
1015  unsigned long m_ulContentMask;
1016 
1017 
1029  unsigned long m_ulChangeMask;
1030 
1040  unsigned long m_ulCNameLength;
1041 
1042 
1053 
1063  unsigned long m_ulNameLength;
1064 
1075 
1076 
1086  unsigned long m_ulEmailLength;
1087 
1098 
1099 
1109  unsigned long m_ulPhoneLength;
1110 
1121 
1131  unsigned long m_ulAppNameLength;
1132 
1143 
1153  unsigned long m_ulLocationLength;
1154 
1165 
1175  unsigned long m_ulNotesLength;
1176 
1187 
1197  unsigned long m_ulPrivateLength;
1198 
1209 
1210 };
1211 
1231 inline unsigned long CSourceDescription::GetChanges(void)
1232 {
1233 
1234  return(m_ulChangeMask);
1235 
1236 }
1237 
1254 inline ISDESReport * CSourceDescription::GetSDESInterface(void)
1255 {
1256  ((ISDESReport *)this)->AddRef(ADD_RELEASE_CALL_ARGS(__LINE__));
1257  return((ISDESReport *)this);
1258 
1259 }
1260 
1279 inline IGetSrcDescription *CSourceDescription::GetAccessInterface(void)
1280 {
1281 
1282  ((IGetSrcDescription *)this)->AddRef(ADD_RELEASE_CALL_ARGS(__LINE__));
1283  return((IGetSrcDescription *)this);
1284 
1285 }
1286 
1287 
1307 {
1308 
1309  return(CRTCPHeader::GetSSRC());
1310 
1311 }
1312 
1313 #endif
unsigned long GetCName(unsigned char *puchCName)
CSourceDescription(ssrc_t ulSSRC=0, unsigned char *puchName=NULL, unsigned char *puchEmail=NULL, unsigned char *puchPhone=NULL, unsigned char *puchLocation=NULL, unsigned char *puchAppName=NULL, unsigned char *puchNotes=NULL, unsigned char *puchPrivate=NULL)
unsigned long m_ulEmailLength
Definition: SourceDescription.h:1086
#define MAX_SOURCE_LENGTH
Definition: RTCPHeader.h:26
interface unsigned long ulBufferSize
Definition: INetworkSource.h:54
unsigned long m_ulPrivateLength
Definition: SourceDescription.h:1197
unsigned char m_uchAppName[MAX_SOURCE_LENGTH]
Definition: SourceDescription.h:1142
interface unsigned char unsigned char unsigned char unsigned char unsigned char unsigned char * puchPrivate
Definition: ISetSrcDescription.h:75
unsigned long m_ulNotesLength
Definition: SourceDescription.h:1175
unsigned long m_ulLocationLength
Definition: SourceDescription.h:1153
unsigned long TerminateNPad(unsigned char *puchReportBuffer, bool *pbPadded)
unsigned long GetEmail(unsigned char *puchEmail)
static CSourceDescription * GetLocalSDES(void)
unsigned char m_uchLocation[MAX_SOURCE_LENGTH]
Definition: SourceDescription.h:1164
unsigned long GetPhone(unsigned char *puchPhone)
unsigned long FormatSDESReport(bool bHeader, long lContentMask, unsigned char *puchReportBuffer, unsigned long ulBufferSize)
static CSourceDescription * m_spoLocalSDES
Definition: SourceDescription.h:991
unsigned long m_ulAppNameLength
Definition: SourceDescription.h:1131
unsigned char m_uchNotes[MAX_SOURCE_LENGTH]
Definition: SourceDescription.h:1186
unsigned char m_uchEmail[MAX_SOURCE_LENGTH]
Definition: SourceDescription.h:1097
bool SetPrivate(unsigned char *puchPrivate, unsigned long ulLength=0)
ISDESReport * GetSDESInterface(void)
Definition: SourceDescription.h:1254
unsigned char m_uchCName[MAX_SOURCE_LENGTH]
Definition: SourceDescription.h:1052
unsigned long m_ulContentMask
Definition: SourceDescription.h:1015
bool SetEmail(unsigned char *puchEmail, unsigned long ulLength=0)
bool SetName(unsigned char *puchCName, unsigned long ulLength=0)
unsigned long m_ulPhoneLength
Definition: SourceDescription.h:1109
bool SetNotes(unsigned char *puchNotes, unsigned long ulLength=0)
unsigned long GetPrivate(unsigned char *puchNotes)
unsigned long m_ulNameLength
Definition: SourceDescription.h:1063
#define ADD_RELEASE_CALL_ARGS(x)
Definition: RtcpConfig.h:74
unsigned long GetLocation(unsigned char *puchLocation)
void SetAllComponents(unsigned char *puchName=NULL, unsigned char *puchEmail=NULL, unsigned char *puchPhone=NULL, unsigned char *puchLocation=NULL, unsigned char *puchAppName=NULL, unsigned char *puchNotes=NULL, unsigned char *puchPrivate=NULL)
unsigned long m_ulCNameLength
Definition: SourceDescription.h:1040
virtual ssrc_t GetSSRC(void)
Definition: SourceDescription.h:1306
unsigned long GetAppName(unsigned char *puchAppName)
void GetAllComponents(unsigned char *puchName, unsigned char *puchEmail, unsigned char *puchPhone, unsigned char *puchLocation, unsigned char *puchAppName, unsigned char *puchNotes, unsigned char *puchPrivate)
interface long unsigned char * puchReportBuffer
Definition: ISDESReport.h:79
unsigned char m_uchPrivate[MAX_SOURCE_LENGTH]
Definition: SourceDescription.h:1208
unsigned long ParseSDESReport(bool bHeader, unsigned char *puchReportBuffer)
unsigned long GetNotes(unsigned char *puchNotes)
interface unsigned char unsigned char unsigned char unsigned char * puchAppName
Definition: ISetSrcDescription.h:73
unsigned char m_uchPhone[MAX_SOURCE_LENGTH]
Definition: SourceDescription.h:1120
Definition: RTCPHeader.h:51
#define DECLARE_IBASE_M
Definition: BaseClass.h:368
interface long lContentMask
Definition: ISDESReport.h:79
bool SetLocation(unsigned char *puchLocation, unsigned long ulLength=0)
unsigned long LoadFieldChanges(unsigned char *puchReportBuffer)
unsigned char m_uchName[MAX_SOURCE_LENGTH]
Definition: SourceDescription.h:1074
bool SetPhone(unsigned char *puchPhone, unsigned long ulLength=0)
uint32_t ssrc_t
Definition: RtcpConfig.h:62
bool FormulateCName(void)
unsigned long GetName(unsigned char *puchName)
interface unsigned char * puchEmail
Definition: ISetSrcDescription.h:70
Definition: BaseClass.h:118
IGetSrcDescription * GetAccessInterface(void)
Definition: SourceDescription.h:1279
unsigned long ExtractPadding(unsigned char *puchReportBuffer)
unsigned long ExtractFieldInfo(unsigned char *puchReportBuffer)
interface unsigned char unsigned char unsigned char * puchLocation
Definition: ISetSrcDescription.h:72
Definition: SourceDescription.h:48
interface unsigned char unsigned char unsigned char unsigned char unsigned char * puchNotes
Definition: ISetSrcDescription.h:74
bool SetCName(unsigned char *puchCName, unsigned long ulLength=0)
unsigned long GetChanges(void)
Definition: SourceDescription.h:1231
virtual ssrc_t GetSSRC(void)
interface unsigned char unsigned char * puchPhone
Definition: ISetSrcDescription.h:71
unsigned long GetFieldChange(unsigned long ulChangeMask, unsigned long *pulFieldType, unsigned char *puchFieldBuffer)
bool SetAppName(unsigned char *puchAppName, unsigned long ulLength=0)
virtual void SetSSRC(ssrc_t ulSSRC)
bool m_bCNameSet
Definition: SourceDescription.h:1003
unsigned long LoadFieldInfo(unsigned char *puchReportBuffer, long lContentMask)
unsigned long m_ulChangeMask
Definition: SourceDescription.h:1029