00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef OPAL_H224_H224_H
00027 #define OPAL_H224_H224_H
00028
00029 #ifdef P_USE_PRAGMA
00030 #pragma interface
00031 #endif
00032
00033 #ifndef _PTLIB_H
00034 #include <ptlib.h>
00035 #endif
00036
00037 #include <opal/buildopts.h>
00038
00039 #include <opal/mediatype.h>
00040 #include <opal/mediafmt.h>
00041 #include <h224/q922.h>
00042
00043 #define H224_HEADER_SIZE 6
00044
00046
00047
00048
00049
00050 class OpalH224MediaType : public OpalRTPAVPMediaType
00051 {
00052 public:
00053 static const char * Name();
00054
00055 OpalH224MediaType();
00056
00057 static const OpalMediaType & MediaType();
00058
00059 #if OPAL_SIP
00060 static const PCaselessString & GetSDPMediaType();
00061
00062 virtual bool MatchesSDP(
00063 const PCaselessString & sdpMediaType,
00064 const PCaselessString & sdpTransport,
00065 const PStringArray & sdpLines,
00066 PINDEX index
00067 );
00068
00069 virtual SDPMediaDescription * CreateSDPMediaDescription(
00070 const OpalTransportAddress & localAddress
00071 ) const;
00072 #endif // OPAL_SIP
00073 };
00074
00076
00077
00078
00079
00080 class OpalH224MediaFormat : public OpalMediaFormat
00081 {
00082 PCLASSINFO(OpalH224MediaFormat, OpalMediaFormat);
00083
00084 public:
00085 OpalH224MediaFormat(
00086 const char * fullName,
00087 RTP_DataFrame::PayloadTypes rtpPayloadType
00088 );
00089 virtual PObject * Clone() const;
00090 virtual PBoolean IsValidForProtocol(const PString & protocol) const;
00091 };
00092
00093 extern const OpalMediaFormat & GetOpalH224_H323AnnexQ();
00094 extern const OpalMediaFormat & GetOpalH224_HDLCTunneling();
00095
00096
00097 #define OpalH224AnnexQ GetOpalH224_H323AnnexQ()
00098 #define OpalH224Tunnelled GetOpalH224_HDLCTunneling()
00099
00101
00102 class OpalH224Client;
00103
00104 class H224_Frame : public Q922_Frame
00105 {
00106 PCLASSINFO(H224_Frame, Q922_Frame);
00107
00108 public:
00109
00110 H224_Frame(PINDEX clientDataSize = 254);
00111 H224_Frame(const OpalH224Client & h224Client, PINDEX clientDataSize = 254);
00112 ~H224_Frame();
00113
00114 PBoolean IsHighPriority() const { return (GetLowOrderAddressOctet() == 0x71); }
00115 void SetHighPriority(PBoolean flag);
00116
00117 WORD GetDestinationTerminalAddress() const;
00118 void SetDestinationTerminalAddress(WORD destination);
00119
00120 WORD GetSourceTerminalAddress() const;
00121 void SetSourceTerminalAddress(WORD source);
00122
00124 void SetClient(const OpalH224Client & h224Client);
00125
00126 BYTE GetClientID() const;
00127 void SetClientID(BYTE clientID);
00128
00130 BYTE GetExtendedClientID() const;
00132 void SetExtendedClientID(BYTE extendedClientID);
00133
00135 BYTE GetCountryCode() const;
00136 BYTE GetCountryCodeExtension() const;
00137 WORD GetManufacturerCode() const;
00138 BYTE GetManufacturerClientID() const;
00139
00141 void SetNonStandardClientInformation(BYTE countryCode,
00142 BYTE countryCodeExtension,
00143 WORD manufacturerCode,
00144 BYTE manufacturerClientID);
00145
00148 PBoolean GetBS() const;
00149 void SetBS(PBoolean bs);
00150
00151 PBoolean GetES() const;
00152 void SetES(PBoolean es);
00153
00154 PBoolean GetC1() const;
00155 void SetC1(PBoolean c1);
00156
00157 PBoolean GetC0() const;
00158 void SetC0(PBoolean c0);
00159
00160 BYTE GetSegmentNumber() const;
00161 void SetSegmentNumber(BYTE segmentNumber);
00162
00163 BYTE *GetClientDataPtr() const;
00164
00165 PINDEX GetClientDataSize() const;
00166 void SetClientDataSize(PINDEX size);
00167
00168 PBoolean DecodeAnnexQ(const BYTE *data, PINDEX size);
00169 PBoolean DecodeHDLC(const BYTE *data, PINDEX size);
00170
00171 private:
00172 PINDEX GetHeaderSize() const;
00173 };
00174
00175 #endif // OPAL_H224_H224_H
00176