frame.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * Inter Asterisk Exchange 2
00004  * 
00005  * Open Phone Abstraction Library (OPAL)
00006  *
00007  * Define the classes that carry information over the ethernet.
00008  *
00009  * Copyright (c) 2005 Indranet Technologies Ltd.
00010  *
00011  * The contents of this file are subject to the Mozilla Public License
00012  * Version 1.0 (the "License"); you may not use this file except in
00013  * compliance with the License. You may obtain a copy of the License at
00014  * http://www.mozilla.org/MPL/
00015  *
00016  * Software distributed under the License is distributed on an "AS IS"
00017  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00018  * the License for the specific language governing rights and limitations
00019  * under the License.
00020  *
00021  * The Original Code is Open Phone Abstraction Library.
00022  *
00023  * The Initial Developer of the Original Code is Indranet Technologies Ltd.
00024  *
00025  * The author of this code is Derek J Smithies
00026  *
00027  *  $Log: frame.h,v $
00028  *  Revision 1.6  2005/08/26 03:07:38  dereksmithies
00029  *  Change naming convention, so all class names contain the string "IAX2"
00030  *
00031  *  Revision 1.5  2005/08/25 03:26:06  dereksmithies
00032  *  Add patch from Adrian Sietsma to correctly set the packet timestamps under windows.
00033  *  Many thanks.
00034  *
00035  *  Revision 1.4  2005/08/24 04:56:25  dereksmithies
00036  *  Add code from Adrian Sietsma to send FullFrameTexts and FullFrameDtmfs to
00037  *  the remote end.  Many Thanks.
00038  *
00039  *  Revision 1.3  2005/08/24 01:38:38  dereksmithies
00040  *  Add encryption, iax2 style. Numerous tidy ups. Use the label iax2, not iax
00041  *
00042  *  Revision 1.2  2005/08/04 08:14:17  rjongbloed
00043  *  Fixed Windows build under DevStudio 2003 of IAX2 code
00044  *
00045  *  Revision 1.1  2005/07/30 07:01:32  csoutheren
00046  *  Added implementation of IAX2 (Inter Asterisk Exchange 2) protocol
00047  *  Thanks to Derek Smithies of Indranet Technologies Ltd. for
00048  *  writing and contributing this code
00049  *
00050  *
00051  *
00052  *
00053  */
00054 
00055 #ifndef FRAME_H
00056 #define FRAME_H
00057 
00058 
00059 class IAX2Frame;
00060 class IAX2FrameList;
00061 class IAX2FullFrame;
00062 class IAX2FullFrameCng;
00063 class IAX2FullFrameDtmf;
00064 class IAX2FullFrameHtml;
00065 class IAX2FullFrameImage;
00066 class IAX2FullFrameNull;
00067 class IAX2FullFrameProtocol;
00068 class IAX2FullFrameSessionControl;
00069 class IAX2FullFrameText;
00070 class IAX2FullFrameVideo;
00071 class IAX2FullFrameVoice;
00072 class IAX2EndPoint;
00073 class IAX2Processor;
00074 class IAX2IeList;
00075 class IAX2MiniFrame;
00076 class IAX2Transmitter;
00077 
00078 #include <iax2/ies.h>
00079 #include <iax2/remote.h>
00080 #include <ptlib.h>
00081 #include <ptlib/sockets.h>
00082 
00083 #ifdef P_USE_PRAGMA
00084 #pragma interface
00085 #endif
00086 
00087 
00088 
00090 class IAX2Frame :  public PObject
00091 {
00092   PCLASSINFO(IAX2Frame, PObject);
00093  public:
00095   IAX2Frame(IAX2EndPoint &_endpoint);
00096   
00098   virtual ~IAX2Frame();
00099   
00102   BOOL ReadNetworkPacket(PUDPSocket &sock);
00103   
00105   virtual BOOL ProcessNetworkPacket();
00106   
00108   virtual BOOL IsFullFrame();
00109   
00111   BOOL IsVideo() const;
00112   
00114   BOOL IsAudio() const;
00115 
00119   virtual BYTE *GetMediaDataPointer() { return data.GetPointer(); }
00120   
00124   virtual PINDEX GetMediaDataSize() { return DataSize();}
00125   
00127   PINDEX DataSize() { return data.GetSize(); }
00128   
00130   IAX2Remote & GetRemoteInfo() { return remote; }
00131   
00133   const BYTE * GetDataPointer() { return data + currentReadIndex; }
00134   
00141   IAX2Frame * BuildAppropriateFrameType(IAX2Encryption &encryptionInfo);
00142 
00144   IAX2Frame * BuildAppropriateFrameType();
00145 
00147   PINDEX   GetUnReadBytes() { return data.GetSize() - currentReadIndex; }
00148   
00150   virtual BOOL WriteHeader() { return FALSE; }
00151   
00154   virtual BOOL TransmitPacket(PUDPSocket &sock);
00155   
00157   virtual void PrintOn(ostream & strm) const;
00158   
00160   static DWORD CalcTimeStamp(const PTimeInterval & callStartTick);
00161 
00165   virtual void BuildTimeStamp(const PTimeInterval & callStartTick);
00166   
00168   IAX2EndPoint & GetEndpoint() { return endpoint; }
00169   
00171   PString IdString() const { return PString("FR-ID#") + PString(frameIndex); }
00172   
00173   
00175   DWORD  GetTimeStamp() { return timeStamp; }
00176   
00178   virtual BOOL CallMustBeActive() { return TRUE; }     
00179   
00181   enum IAX2FrameType {
00182     undefType        = 0,     
00183     dtmfType         = 1,     
00184     voiceType        = 2,     
00185     videoType        = 3,     
00186     controlType      = 4,     
00187     nullType         = 5,     
00188     iax2ProtocolType = 6,     
00189     textType         = 7,     
00190     imageType        = 8,     
00191     htmlType         = 9,     
00192     cngType          = 10,    
00193     numFrameTypes    = 11     
00194   };
00195   
00198   IAX2FrameType GetFrameType() { return frameType; }
00199     
00203   virtual void InitialiseHeader(IAX2Processor * /*processor*/) { }
00204   
00206   BOOL CanRetransmitFrame() const {return canRetransmitFrame; } 
00207   
00209   PString GetConnectionToken() const { return connectionToken; }
00210 
00213   void SetConnectionToken(PString newToken) { connectionToken = newToken; } 
00214 
00217   void BuildConnectionTokenId();
00218 
00221   BOOL EncryptContents(IAX2Encryption &encData);
00222 
00224   virtual PINDEX GetEncryptionOffset();
00225 
00226  protected:
00227 
00231   BOOL DecryptContents(IAX2Encryption & encryption);
00232 
00234   IAX2Remote  remote;
00235   
00237   IAX2FrameType frameType;
00238   
00240   BOOL          Read1Byte(BYTE & res);
00241   
00243   BOOL          Read2Bytes(PINDEX & res);
00244   
00246   BOOL          Read2Bytes(WORD & res);
00247   
00249   BOOL          Read4Bytes(DWORD & res);
00250   
00252   void          Write1Byte(BYTE newVal);
00253   
00255   void          Write1Byte(PINDEX newVal);
00256   
00258   void          Write2Bytes(PINDEX newVal);
00259   
00261   void          Write4Bytes(unsigned int newVal);
00262   
00264   void          ZeroAllValues();
00265   
00267   IAX2EndPoint      & endpoint;
00268   
00270   PBYTEArray         data;
00271   
00273   BOOL               isFullFrame;
00274   
00276   BOOL               isVideo;
00277   
00279   BOOL               isAudio;
00280   
00282   PINDEX               currentReadIndex;  
00283   
00285   PINDEX               currentWriteIndex;  
00286   
00288   DWORD                timeStamp;  
00289   
00291   int                frameIndex;
00292   
00294   BOOL               canRetransmitFrame;
00295 
00300   PString            connectionToken;
00301 
00304   PINDEX presetTimeStamp;
00305 };
00306 
00308 
00309 class IAX2MiniFrame : public IAX2Frame
00310 {
00311   PCLASSINFO(IAX2MiniFrame, IAX2Frame);
00312  public:
00315   IAX2MiniFrame(IAX2Frame & srcFrame);
00316   
00318   IAX2MiniFrame(IAX2EndPoint & _endpoint); 
00319   
00327   IAX2MiniFrame(IAX2Processor * con, PBYTEArray &sound, BOOL isAudio, PINDEX usersTimeStamp = 0);
00328 
00330   virtual ~IAX2MiniFrame();
00331   
00333   virtual BOOL ProcessNetworkPacket();
00334   
00336   virtual BOOL WriteHeader();
00337   
00339   virtual void PrintOn(ostream & strm) const;
00340   
00342   virtual BYTE *GetMediaDataPointer();
00343   
00345   virtual PINDEX GetMediaDataSize();
00346   
00348   void AlterTimeStamp(PINDEX newValue);
00349   
00355   virtual void InitialiseHeader(IAX2Processor *processor);
00356   
00358   virtual PINDEX GetEncryptionOffset();
00359 
00360  protected:
00362   void ZeroAllValues();
00363 };
00364 
00366 
00367 class IAX2FullFrame : public IAX2Frame
00368 {
00369   PCLASSINFO(IAX2FullFrame, IAX2Frame);
00370  public:
00373   IAX2FullFrame(IAX2Frame & srcFrame);
00374   
00377   IAX2FullFrame(IAX2EndPoint  &_endpoint);
00378   
00381   virtual ~IAX2FullFrame();
00382   
00384   BOOL IsAckFrame() { return isAckFrame; }
00385   
00387   BOOL IsPingFrame();
00388 
00390   BOOL IsNewFrame();
00391 
00393   BOOL IsLagRqFrame();
00394 
00396   BOOL IsLagRpFrame();
00397 
00399   BOOL IsPongFrame();
00400 
00402   BOOL IsAuthReqFrame();
00403 
00405   BOOL IsVNakFrame();
00406 
00408   BOOL FrameIncrementsInSeqNo();
00409 
00411   virtual BOOL IsFullFrame() { return TRUE; }  
00412   
00414   void ZeroAllValues();
00415   
00417   virtual BOOL ProcessNetworkPacket();
00418   
00421   virtual BOOL TransmitPacket(PUDPSocket &sock);
00422   
00424   PString GetFullFrameName() const;
00425   
00427   virtual PString GetSubClassName() const
00428     { return PString(" subclass=") + PString(subClass); }
00429   
00432   void MarkDeleteNow();
00433   
00435   virtual BYTE *GetMediaDataPointer();
00436   
00438   virtual PINDEX GetMediaDataSize();
00439   
00441   PINDEX GetSubClass() const { return subClass; }
00442   
00444   void SetSubClass(int newValue) { subClass = newValue;}
00445   
00449   virtual BOOL WriteHeader();
00450   
00452   void ModifyFrameHeaderSequenceNumbers(PINDEX inNo, PINDEX outNo);
00453 
00458   void ModifyFrameTimeStamp(PINDEX newTimeStamp);
00459 
00461   virtual BOOL InformationElementsPresent() { return FALSE; }  
00462   
00464   BOOL  SendFrameNow() { return sendFrameNow; }
00465   
00467   BOOL  DeleteFrameNow() { return deleteFrameNow; }
00468   
00470   IAX2SequenceNumbers & GetSequenceInfo() { return sequence; }
00471   
00473   virtual void PrintOn(ostream & strm) const;
00474   
00476   void MarkAsResent();
00477   
00480   BOOL operator *= (IAX2FullFrame & other);
00481   
00484   enum ConnectionRequired {
00485     callActive,      
00486     callIrrelevant   
00487   };
00488   
00490   virtual BYTE GetFullFrameType() { return 0; }
00491 
00493   virtual PINDEX GetEncryptionOffset() { return 4; }
00494   
00495  protected:
00497   virtual BOOL CallMustBeActive() { return callMustBeActive; }
00498   
00500   void UnCompressSubClass(BYTE a);
00501   
00503   int  CompressSubClass();
00504   
00506   void ClearListFlags();
00507   
00513   virtual void InitialiseHeader(IAX2Processor *processor);
00514   
00515 #ifdef DOC_PLUS_PLUS
00516 
00519   void OnTransmissionTimeout(PTimer &, INT);
00520 #else
00521   PDECLARE_NOTIFIER(PTimer, IAX2FullFrame, OnTransmissionTimeout);
00522 #endif
00523 
00524   PTimer transmissionTimer;
00525   
00527   PINDEX subClass;
00528   
00530   PTimeInterval retryDelta;     
00531   
00533   PTimeInterval timeOffset;     
00534   
00536   PINDEX       retries;        
00537   
00539   enum RetryTime {
00540     minRetryTime = 500,    
00541     maxRetryTime = 010000, 
00542     maxRetries   = 10,     
00543   };
00544   
00546   IAX2SequenceNumbers sequence;
00547   
00549   BOOL         sendFrameNow;   
00550   
00552   BOOL         deleteFrameNow; 
00553   
00555   BOOL         packetResent;   
00556   
00558   BOOL callMustBeActive;
00559   
00561   BOOL isAckFrame;  
00562 };
00563 
00565 
00570 class IAX2FullFrameDtmf : public IAX2FullFrame
00571 {
00572   PCLASSINFO(IAX2FullFrameDtmf, IAX2FullFrame);
00573  public:
00576   IAX2FullFrameDtmf(IAX2Frame & srcFrame);
00577 
00580   IAX2FullFrameDtmf(IAX2FullFrame & srcFrame);
00581   
00584   IAX2FullFrameDtmf(IAX2Processor *processor, 
00585                     char  subClassValue       
00586                     );
00587   
00590   IAX2FullFrameDtmf(IAX2Processor *processor, 
00591                 PString  subClassValue    
00592                 );
00593   
00594   
00596   virtual PString GetSubClassName() const; 
00597   
00599   enum DtmfSc {
00600     dtmf0 = 48,     
00601     dtmf1 = 49,     
00602     dtmf2 = 50,     
00603     dtmf3 = 51,     
00604     dtmf4 = 52,     
00605     dtmf5 = 53,     
00606     dtmf6 = 54,     
00607     dtmf7 = 55,     
00608     dtmf8 = 56,     
00609     dtmf9 = 57,     
00610     dtmfA = 65,     
00611     dtmfB = 66,     
00612     dtmfC = 67,     
00613     dtmfD = 68,     
00614     dtmfStar = 42,  
00615     dtmfHash = 35   
00616   };
00617   
00619   virtual BYTE GetFullFrameType() { return dtmfType; }
00620   
00621  protected:
00622 };
00623 
00625 
00632 class IAX2FullFrameVoice : public IAX2FullFrame
00633 {
00634   PCLASSINFO(IAX2FullFrameVoice, IAX2FullFrame);
00635  public:
00636   
00639   IAX2FullFrameVoice(IAX2Frame & srcFrame);
00640   
00643   IAX2FullFrameVoice(IAX2FullFrame & srcFrame);
00644   
00653   IAX2FullFrameVoice(IAX2Processor *processor, PBYTEArray &sound, 
00654                  PINDEX usersTimeStamp = 0);
00655   
00657   virtual ~IAX2FullFrameVoice();
00658 
00660   virtual PString GetSubClassName() const;
00661   
00664   static PString GetSubClassName(unsigned short testValue)
00665      { return GetSubClassName((unsigned int) testValue); }
00666 
00669   static PString GetSubClassName(unsigned int testValue);
00670   
00674   static PString GetOpalNameOfCodec(PINDEX testValue);
00675   
00677   static PString GetSubClassName(int testValue) 
00678     { return GetSubClassName((unsigned short) testValue); }
00679   
00682   static unsigned short OpalNameToIax2Value(const PString opalName);
00683 
00685   enum AudioSc {
00686     g7231    = 1,         
00687     gsm      = 2,         
00688     g711ulaw = 4,         
00689     g711alaw = 8,         
00690     mp3      = 0x10,      
00691     adpcm    = 0x20,      
00692     pcm      = 0x40,      
00693     lpc10    = 0x80,      
00694     g729     = 0x100,     
00695     speex    = 0x200,     
00696     ilbc     = 0x400,     
00697     supportedCodecs = 11  
00698   };
00699   
00701   virtual BYTE GetFullFrameType() { return voiceType; }
00702 };
00704 
00709 class IAX2FullFrameVideo : public IAX2FullFrame
00710 {
00711   PCLASSINFO(IAX2FullFrameVideo, IAX2FullFrame);
00712  public:
00713   
00716   IAX2FullFrameVideo(IAX2Frame & srcFrame);
00717   
00720   IAX2FullFrameVideo(IAX2FullFrame & srcFrame);
00721   
00723   virtual PString GetSubClassName() const;
00724   
00726   enum VideoSc {
00727     jpeg  = 0x10000,   
00728     png   = 0x20000,   
00729     h261  = 0x40000,   
00730     h263  = 0x80000    
00731   };
00732   
00734   virtual BYTE GetFullFrameType() { return videoType; }
00735  protected:
00736 };
00737 
00739 
00744 class IAX2FullFrameSessionControl : public IAX2FullFrame
00745 {
00746   PCLASSINFO(IAX2FullFrameSessionControl, IAX2FullFrame);
00747  public:
00748   
00750   enum SessionSc {
00751     hangup          = 1,     
00752     ring            = 2,     
00753     ringing         = 3,     
00754     answer          = 4,     
00755     busy            = 5,     
00756     tkoffhk         = 6,     
00757     offhook         = 7,     
00758     congestion      = 8,     
00759     flashhook       = 9,     
00760     wink            = 10,    
00761     option          = 11,    
00762     keyRadio        = 12,    
00763     unkeyRadio      = 13,    
00764     callProgress    = 14,    
00765     callProceeding  = 15,    
00766     callOnHold      = 16,    
00767     callHoldRelease = 17,    
00768     stopSounds      = 255    
00769   };
00770   
00771   
00772   
00775   IAX2FullFrameSessionControl(IAX2Frame & srcFrame);
00776   
00779   IAX2FullFrameSessionControl(IAX2FullFrame & srcFrame);
00780   
00783   IAX2FullFrameSessionControl(IAX2Processor *processor, 
00784                           PINDEX subClassValue
00785                           );
00786   
00789   IAX2FullFrameSessionControl(IAX2Processor *processor,     
00790                           SessionSc subClassValue 
00791                           );
00792   
00794   virtual ~IAX2FullFrameSessionControl() { }
00795 
00797   virtual PString GetSubClassName() const;
00798   
00800   virtual BYTE GetFullFrameType() { return controlType; }
00801   
00802  protected:
00803 };
00804 
00806 
00812 class IAX2FullFrameNull : public IAX2FullFrame
00813 {
00814   PCLASSINFO(IAX2FullFrameNull, IAX2FullFrame);
00815  public:
00818   IAX2FullFrameNull(IAX2EndPoint & endpoint) : IAX2FullFrame(endpoint)   { }
00819   
00823   IAX2FullFrameNull(IAX2Frame & srcFrame);
00824   
00828   IAX2FullFrameNull(IAX2FullFrame & srcFrame);
00829   
00831   virtual PString GetSubClassName() const { return  PString(""); }
00832   
00834   virtual BYTE GetFullFrameType() { return nullType; }
00835   
00836  protected:
00837 };
00838 
00840 
00846 class IAX2FullFrameProtocol : public IAX2FullFrame
00847 {
00848   PCLASSINFO(IAX2FullFrameProtocol, IAX2FullFrame);
00849  public:
00850   
00852   enum ProtocolSc {
00853     cmdNew       =  1,       
00854     cmdPing      =  2,       
00855     cmdPong      =  3,       
00856     cmdAck       =  4,       
00857     cmdHangup    =  5,       
00858     cmdReject    =  6,       
00859     cmdAccept    =  7,       
00860     cmdAuthReq   =  8,       
00861     cmdAuthRep   =  9,       
00862     cmdInval     =  10,      
00863     cmdLagRq     =  11,      
00864     cmdLagRp     =  12,      
00865     cmdRegReq    =  13,      
00866     cmdRegAuth   =  14,      
00867     cmdRegAck    =  15,      
00868     cmdRegRej    =  16,      
00869     cmdRegRel    =  17,      
00870     cmdVnak      =  18,      
00871     cmdDpReq     =  19,      
00872     cmdDpRep     =  20,      
00873     cmdDial      =  21,      
00874     cmdTxreq     =  22,      
00875     cmdTxcnt     =  23,      
00876     cmdTxacc     =  24,      
00877     cmdTxready   =  25,      
00878     cmdTxrel     =  26,      
00879     cmdTxrej     =  27,      
00880     cmdQuelch    =  28,      
00881     cmdUnquelch  =  29,      
00882     cmdPoke      =  30,      
00883     cmdPage      =  31,      
00884     cmdMwi       =  32,      
00885     cmdUnsupport =  33,      
00886     cmdTransfer  =  34,      
00887     cmdProvision =  35,      
00888     cmdFwDownl   =  36,      
00889     cmdFwData    =  37       
00890   };
00891   
00895   IAX2FullFrameProtocol(IAX2Frame & srcFrame);
00896   
00900   IAX2FullFrameProtocol(IAX2FullFrame & srcFrame);
00901   
00904   IAX2FullFrameProtocol(IAX2Processor *processor,         
00905                     PINDEX subClassValue,            
00906                     ConnectionRequired needCon = IAX2FullFrame::callActive
00908                     );
00909   
00912   IAX2FullFrameProtocol(IAX2Processor *processor,         
00913                     ProtocolSc  subClassValue,       
00914                     ConnectionRequired needCon=IAX2FullFrame::callActive 
00916                     );
00917   
00923   IAX2FullFrameProtocol(IAX2Processor *processor,         
00924                     ProtocolSc  subClassValue,       
00925                     IAX2FullFrame *inReplyTo,            
00926                     ConnectionRequired needCon = IAX2FullFrame::callActive
00928                     );
00929   
00931   virtual ~IAX2FullFrameProtocol();
00932   
00934   void SetRetransmissionRequired();
00935   
00937   virtual BOOL InformationElementsPresent() { return !ieElements.IsEmpty(); }
00938   
00940   virtual PString GetSubClassName() const; 
00941   
00944   IAX2Ie *GetIeAt(PINDEX i) {      return ieElements.GetIeAt(i); }
00945   
00947   void AppendIe(IAX2Ie *newElement) { ieElements.AppendIe(newElement); }
00948   
00951   void WriteIeAsBinaryData();
00952   
00956   void CopyDataFromIeListTo(IAX2IeData &res);
00957   
00960   void GetRemoteCapability(unsigned int & capability, unsigned int & preferred);
00961 
00963   virtual BYTE GetFullFrameType() { return iax2ProtocolType; }
00964   
00965  protected:
00966   
00969   BOOL ReadInformationElements();
00970   
00972   IAX2IeList ieElements;
00973 };
00974 
00976 
00981 class IAX2FullFrameText : public IAX2FullFrame
00982 {
00983   PCLASSINFO(IAX2FullFrameText, IAX2FullFrame);
00984  public:
00985 
00988   IAX2FullFrameText(IAX2Processor *processor,       
00989                 const PString&  textValue
00990                 );
00991   
00994   IAX2FullFrameText(IAX2Frame & srcFrame);
00995   
00998   IAX2FullFrameText(IAX2FullFrame & srcFrame);
00999   
01001   virtual PString GetSubClassName() const;
01002   
01004   virtual BYTE GetFullFrameType() { return textType; }
01005 
01007   PString GetTextString() const;
01008 
01009  protected:
01010 
01012   PString internalText;
01013 };
01015 
01020 class IAX2FullFrameImage : public IAX2FullFrame
01021 {
01022   PCLASSINFO(IAX2FullFrameImage, IAX2FullFrame);
01023  public:
01024   
01027   IAX2FullFrameImage(IAX2Frame & srcFrame);
01028   
01031   IAX2FullFrameImage(IAX2FullFrame & srcFrame);
01032   
01034   virtual PString GetSubClassName() const;
01035   
01037   virtual BYTE GetFullFrameType() { return imageType; }
01038  protected:
01039 };
01040 
01042 
01047 class IAX2FullFrameHtml : public IAX2FullFrame
01048 {
01049   PCLASSINFO(IAX2FullFrameHtml, IAX2FullFrame);
01050  public:
01051   
01054   IAX2FullFrameHtml(IAX2Frame & srcFrame);
01055   
01058   IAX2FullFrameHtml(IAX2FullFrame & srcFrame);
01059   
01061   virtual PString GetSubClassName() const;
01062   
01064   virtual BYTE GetFullFrameType() { return htmlType; }
01065  protected:
01066 };
01067 
01069 
01073 class IAX2FullFrameCng : public IAX2FullFrame
01074 {
01075   PCLASSINFO(IAX2FullFrameCng, IAX2FullFrame);
01076  public:
01077   
01080   IAX2FullFrameCng(IAX2Frame & srcFrame);
01081   
01084   IAX2FullFrameCng(IAX2FullFrame & srcFrame);
01085   
01087   virtual PString GetSubClassName() const;
01088   
01090   virtual BYTE GetFullFrameType() { return cngType; }
01091  protected:
01092 };
01093 
01095 
01096 PDECLARE_LIST (IAX2FrameList, IAX2Frame *)
01097 #ifdef DOC_PLUS_PLUS     //This makes emacs bracket matching code happy.
01098 
01104 class IAX2FrameList : public IAX2Frame *  
01105 {
01106 #endif
01107  public:
01108   ~IAX2FrameList();
01109   
01111   void ReportList();
01112   
01114   IAX2Frame *GetLastFrame();
01115   
01117   void Initialise() {  DisallowDeleteObjects(); }
01118     
01120   BOOL Empty() { return GetSize() == 0; }
01121   
01123   void GrabContents(IAX2FrameList &src);
01124   
01127   void DeleteMatchingSendFrame(IAX2FullFrame *reply);
01128   
01130   void AddNewFrame(IAX2Frame *src);
01131   
01133   void GetResendFramesDeleteOldFrames(IAX2FrameList & framesToSend);
01134   
01136   virtual PINDEX GetSize() { PWaitAndSignal m(mutex); return PAbstractList::GetSize(); }
01137   
01139   void MarkAllAsResent();
01140   
01141  protected:
01143   virtual PINDEX GetEntries() { return PAbstractList::GetSize(); }
01144   
01146   PMutex mutex;
01147 };
01148 
01149 
01151 
01152 
01153 #endif // FRAME_H
01154 /* The comment below is magic for those who use emacs to edit this file. */
01155 /* With the comment below, the tab key does auto indent to 4 spaces.     */
01156 
01157 /*
01158  * Local Variables:
01159  * mode:c
01160  * c-file-style:linux
01161  * c-basic-offset:2
01162  * End:
01163  */
01164 
01165 
01166 

Generated on Mon Sep 25 16:19:33 2006 for OPAL by  doxygen 1.4.7