00001 /* 00002 * t38proto.h 00003 * 00004 * T.38 protocol handler 00005 * 00006 * Open Phone Abstraction Library 00007 * 00008 * Copyright (c) 2001 Equivalence Pty. Ltd. 00009 * 00010 * The contents of this file are subject to the Mozilla Public License 00011 * Version 1.0 (the "License"); you may not use this file except in 00012 * compliance with the License. You may obtain a copy of the License at 00013 * http://www.mozilla.org/MPL/ 00014 * 00015 * Software distributed under the License is distributed on an "AS IS" 00016 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00017 * the License for the specific language governing rights and limitations 00018 * under the License. 00019 * 00020 * The Original Code is Open H323 Library. 00021 * 00022 * The Initial Developer of the Original Code is Equivalence Pty. Ltd. 00023 * 00024 * Contributor(s): ______________________________________. 00025 * 00026 * $Log: t38proto.h,v $ 00027 * Revision 2.8 2005/02/21 12:19:48 rjongbloed 00028 * Added new "options list" to the OpalMediaFormat class. 00029 * 00030 * Revision 2.7 2003/01/07 04:39:53 robertj 00031 * Updated to OpenH323 v1.11.2 00032 * 00033 * Revision 2.6 2002/11/10 11:33:17 robertj 00034 * Updated to OpenH323 v1.10.3 00035 * 00036 * Revision 2.5 2002/09/16 02:52:36 robertj 00037 * Added #define so can select if #pragma interface/implementation is used on 00038 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00039 * 00040 * Revision 2.4 2002/09/04 06:01:47 robertj 00041 * Updated to OpenH323 v1.9.6 00042 * 00043 * Revision 2.3 2002/02/11 09:32:12 robertj 00044 * Updated to openH323 v1.8.0 00045 * 00046 * Revision 2.2 2002/01/14 06:35:57 robertj 00047 * Updated to OpenH323 v1.7.9 00048 * 00049 * Revision 2.1 2001/08/01 05:06:00 robertj 00050 * Major changes to H.323 capabilities, uses OpalMediaFormat for base name. 00051 * 00052 * Revision 2.0 2001/07/27 15:48:24 robertj 00053 * Conversion of OpenH323 to Open Phone Abstraction Library (OPAL) 00054 * 00055 * Revision 1.9 2002/12/02 04:07:58 robertj 00056 * Turned T.38 Originate inside out, so now has WriteXXX() functions that can 00057 * be call ed in different thread contexts. 00058 * 00059 * Revision 1.8 2002/12/02 00:37:15 robertj 00060 * More implementation of T38 base library code, some taken from the t38modem 00061 * application by Vyacheslav Frolov, eg redundent frames. 00062 * 00063 * Revision 1.7 2002/09/16 01:14:15 robertj 00064 * Added #define so can select if #pragma interface/implementation is used on 00065 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00066 * 00067 * Revision 1.6 2002/09/03 06:19:37 robertj 00068 * Normalised the multi-include header prevention ifdef/define symbol. 00069 * 00070 * Revision 1.5 2002/02/09 04:39:01 robertj 00071 * Changes to allow T.38 logical channels to use single transport which is 00072 * now owned by the OpalT38Protocol object instead of H323Channel. 00073 * 00074 * Revision 1.4 2002/01/01 23:27:50 craigs 00075 * Added CleanupOnTermination functions 00076 * Thanks to Vyacheslav Frolov 00077 * 00078 * Revision 1.3 2001/12/22 01:57:04 robertj 00079 * Cleaned up code and allowed for repeated sequence numbers. 00080 * 00081 * Revision 1.2 2001/11/09 05:39:54 craigs 00082 * Added initial T.38 support thanks to Adam Lazur 00083 * 00084 * Revision 1.1 2001/07/17 04:44:29 robertj 00085 * Partial implementation of T.120 and T.38 logical channels. 00086 * 00087 */ 00088 00089 #ifndef __OPAL_T38PROTO_H 00090 #define __OPAL_T38PROTO_H 00091 00092 #ifdef P_USE_PRAGMA 00093 #pragma interface 00094 #endif 00095 00096 00097 #include <opal/mediafmt.h> 00098 00099 00100 class OpalTransport; 00101 class T38_IFPPacket; 00102 class PASN_OctetString; 00103 00104 00105 #define OPAL_T38 "T.38" 00106 00107 00109 00112 class OpalT38Protocol : public PObject 00113 { 00114 PCLASSINFO(OpalT38Protocol, PObject); 00115 public: 00120 OpalT38Protocol(); 00121 00124 ~OpalT38Protocol(); 00126 00131 virtual void Close(); 00132 00137 virtual BOOL Originate(); 00138 00141 virtual BOOL WritePacket( 00142 const T38_IFPPacket & pdu 00143 ); 00144 00147 virtual BOOL WriteIndicator( 00148 unsigned indicator 00149 ); 00150 00153 virtual BOOL WriteMultipleData( 00154 unsigned mode, 00155 PINDEX count, 00156 unsigned * type, 00157 const PBYTEArray * data 00158 ); 00159 00162 virtual BOOL WriteData( 00163 unsigned mode, 00164 unsigned type, 00165 const PBYTEArray & data 00166 ); 00167 00170 virtual BOOL Answer(); 00171 00176 virtual BOOL HandlePacket( 00177 const T38_IFPPacket & pdu 00178 ); 00179 00184 virtual BOOL HandlePacketLost( 00185 unsigned nLost 00186 ); 00187 00191 virtual BOOL OnIndicator( 00192 unsigned indicator 00193 ); 00194 00198 virtual BOOL OnCNG(); 00199 00203 virtual BOOL OnCED(); 00204 00208 virtual BOOL OnPreamble(); 00209 00213 virtual BOOL OnTraining( 00214 unsigned indicator 00215 ); 00216 00221 virtual BOOL OnData( 00222 unsigned mode, 00223 unsigned type, 00224 const PBYTEArray & data 00225 ); 00227 00228 OpalTransport * GetTransport() const { return transport; } 00229 void SetTransport( 00230 OpalTransport * transport, 00231 BOOL autoDelete = TRUE 00232 ); 00233 00234 protected: 00235 BOOL HandleRawIFP( 00236 const PASN_OctetString & pdu 00237 ); 00238 00239 OpalTransport * transport; 00240 BOOL autoDeleteTransport; 00241 00242 BOOL corrigendumASN; 00243 unsigned indicatorRedundancy; 00244 unsigned lowSpeedRedundancy; 00245 unsigned highSpeedRedundancy; 00246 00247 int lastSentSequenceNumber; 00248 PList<PBYTEArray> redundantIFPs; 00249 }; 00250 00251 00252 #endif // __OPAL_T38PROTO_H 00253 00254