# 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  * $Revision: 28287 $
    00028  * $Author: rjongbloed $
    00029  * $Date: 2012-08-31 00:58:42 -0500 (Fri, 31 Aug 2012) $
    00030  */
    00031
    00032 #ifndef OPAL_IAX2_FRAME_H
    00033 #define OPAL_IAX2_FRAME_H
    00034
    00035 #ifndef _PTLIB_H
    00036 #include <ptlib.h>
    00037 #endif
    00038
    00039 #include <opal/buildopts.h>
    00040
    00041 #if OPAL_IAX2
    00042
    00043 #include <iax2/ies.h>
    00044 #include <iax2/remote.h>
    00045
    00046 #include <ptlib/sockets.h>
    00047
    00048 #ifdef P_USE_PRAGMA
    00049 #pragma interface
    00050 #endif
    00051
    00052 class IAX2Frame;
    00053 class IAX2FrameList;
    00054 class IAX2FullFrame;
    00055 class IAX2FullFrameCng;
    00056 class IAX2FullFrameDtmf;
    00057 class IAX2FullFrameHtml;
    00058 class IAX2FullFrameImage;
    00059 class IAX2FullFrameNull;
    00060 class IAX2FullFrameProtocol;
    00061 class IAX2FullFrameSessionControl;
    00062 class IAX2FullFrameText;
    00063 class IAX2FullFrameVideo;
    00064 class IAX2FullFrameVoice;
    00065 class IAX2EndPoint;
    00066 class IAX2Processor;
    00067 class IAX2CallProcessor;
    00068 class IAX2IeList;
    00069 class IAX2MiniFrame;
    00070 class IAX2Transmitter;
    00071
    00072
    00073
    00075 class IAX2Frame :  public PObject
    00076 {
    00077   PCLASSINFO(IAX2Frame, PObject);
    00078  public:
    00080   IAX2Frame(IAX2EndPoint &_endpoint);
    00081
    00083   virtual ~IAX2Frame();
    00084
    00087   PBoolean ReadNetworkPacket(PUDPSocket &sock);
    00088
    00090   virtual PBoolean ProcessNetworkPacket();
    00091
    00093   virtual PBoolean IsFullFrame() { return isFullFrame; }
    00094
    00096   PBoolean IsVideo() const { return isVideo; }
    00097
    00099   PBoolean IsAudio() const { return isAudio; }
    00100
    00104   virtual BYTE *GetMediaDataPointer() { return data.GetPointer(); }
    00105
    00109   virtual PINDEX GetMediaDataSize() { return DataSize();}
    00110
    00112   PINDEX DataSize() { return data.GetSize(); }
    00113
    00115   IAX2Remote & GetRemoteInfo() { return remote; }
    00116
    00118   const BYTE * GetDataPointer() { return data + currentReadIndex; }
    00119
    00126   IAX2Frame * BuildAppropriateFrameType(IAX2Encryption &encryptionInfo);
    00127
    00129   IAX2Frame * BuildAppropriateFrameType();
    00130
    00132   PINDEX   GetUnReadBytes() { return data.GetSize() - currentReadIndex; }
    00133
    00135   virtual PBoolean WriteHeader() { return false; }
    00136
    00139   virtual PBoolean TransmitPacket(PUDPSocket &sock);
    00140
    00142   virtual void PrintOn(ostream & strm) const;
    00143
    00145   static DWORD CalcTimeStamp(const PTimeInterval & callStartTick);
    00146
    00150   virtual void BuildTimeStamp(const PTimeInterval & callStartTick);
    00151
    00153   IAX2EndPoint & GetEndpoint() { return endpoint; }
    00154
    00157   PString IdString() const;
    00158
    00160   DWORD  GetTimeStamp() { return timeStamp; }
    00161
    00163   void SetTimeStamp(DWORD newValue);
    00164
    00166   virtual PBoolean CallMustBeActive() { return true; }
    00167
    00169   enum IAX2FrameType {
    00170     undefType        = 0,
    00171     dtmfType         = 1,
    00172     voiceType        = 2,
    00173     videoType        = 3,
    00174     controlType      = 4,
    00175     nullType         = 5,
    00176     iax2ProtocolType = 6,
    00177     textType         = 7,
    00178     imageType        = 8,
    00179     htmlType         = 9,
    00180     cngType          = 10,
    00181     numFrameTypes    = 11
    00182   };
    00183
    00186   IAX2FrameType GetFrameType() { return frameType; }
    00187
    00191   virtual void InitialiseHeader(IAX2Processor * /*processor*/) { }
    00192
    00195   PBoolean CanRetransmitFrame() const {return canRetransmitFrame; }
    00196
    00199   PString GetConnectionToken() const { return connectionToken; }
    00200
    00203   void SetConnectionToken(PString newToken) { connectionToken = newToken; }
    00204
    00207   void BuildConnectionToken();
    00208
    00211   PBoolean EncryptContents(IAX2Encryption &encData);
    00212
    00214   virtual PINDEX GetEncryptionOffset();
    00215
    00216  protected:
    00217
    00221   PBoolean DecryptContents(IAX2Encryption & encryption);
    00222
    00225   IAX2Remote  remote;
    00226
    00229   IAX2FrameType frameType;
    00230
    00233   PBoolean          Read1Byte(BYTE & res);
    00234
    00237   PBoolean          Read2Bytes(PINDEX & res);
    00238
    00241   PBoolean          Read2Bytes(WORD & res);
    00242
    00245   PBoolean          Read4Bytes(DWORD & res);
    00246
    00249   void          Write1Byte(BYTE newVal);
    00250
    00253   void          Write1Byte(PINDEX newVal);
    00254
    00257   void          Write2Bytes(PINDEX newVal);
    00258
    00261   void          Write4Bytes(unsigned int newVal);
    00262
    00264   void          ZeroAllValues();
    00265
    00267   IAX2EndPoint      & endpoint;
    00268
    00271   PBYTEArray         data;
    00272
    00274   PBoolean               isFullFrame;
    00275
    00277   PBoolean               isVideo;
    00278
    00280   PBoolean               isAudio;
    00281
    00283   PINDEX               currentReadIndex;
    00284
    00286   PINDEX               currentWriteIndex;
    00287
    00289   DWORD                timeStamp;
    00290
    00292   PBoolean               canRetransmitFrame;
    00293
    00298   PString connectionToken;
    00299
    00302   DWORD presetTimeStamp;
    00303 };
    00304
    00306
    00307 class IAX2MiniFrame : public IAX2Frame
    00308 {
    00309   PCLASSINFO(IAX2MiniFrame, IAX2Frame);
    00310  public:
    00313   IAX2MiniFrame(const IAX2Frame & srcFrame);
    00314
    00316   IAX2MiniFrame(IAX2EndPoint & _endpoint);
    00317
    00326   IAX2MiniFrame(IAX2Processor * con, PBYTEArray &sound, PBoolean isAudio, DWORD usersTimeStamp = 0);
    00327
    00329   virtual ~IAX2MiniFrame();
    00330
    00333   virtual PBoolean ProcessNetworkPacket();
    00334
    00336   virtual PBoolean WriteHeader();
    00337
    00339   virtual void PrintOn(ostream & strm) const;
    00340
    00343   virtual BYTE *GetMediaDataPointer();
    00344
    00346   virtual PINDEX GetMediaDataSize();
    00347
    00349   void AlterTimeStamp(PINDEX newValue);
    00350
    00356   virtual void InitialiseHeader(IAX2Processor *processor);
    00357
    00359   virtual PINDEX GetEncryptionOffset();
    00360
    00361  protected:
    00363   void ZeroAllValues();
    00364 };
    00365
    00368
    00369 class IAX2FullFrame : public IAX2Frame
    00370 {
    00371   PCLASSINFO(IAX2FullFrame, IAX2Frame);
    00372  public:
    00375   IAX2FullFrame(const IAX2Frame & srcFrame);
    00376
    00379   IAX2FullFrame(IAX2EndPoint  &_endpoint);
    00380
    00383   virtual ~IAX2FullFrame();
    00384
    00386   PBoolean IsAckFrame() { return isAckFrame; }
    00387
    00389   PBoolean IsPingFrame();
    00390
    00392   PBoolean IsNewFrame();
    00393
    00395   PBoolean IsLagRqFrame();
    00396
    00398   PBoolean IsLagRpFrame();
    00399
    00401   PBoolean IsPongFrame();
    00402
    00404   PBoolean IsAuthReqFrame();
    00405
    00407   PBoolean IsVnakFrame();
    00408
    00410   PBoolean IsRegReqFrame();
    00411
    00413   PBoolean IsRegAuthFrame();
    00414
    00416   PBoolean IsRegAckFrame();
    00417
    00419   PBoolean IsRegRelFrame();
    00420
    00422   PBoolean IsRegRejFrame();
    00423
    00425   PBoolean IsCallTokenFrame();
    00426
    00429   PBoolean FrameIncrementsInSeqNo();
    00430
    00433   virtual PBoolean IsFullFrame() { return true; }
    00434
    00438   PBoolean IsHangupFrame();
    00439
    00441   void ZeroAllValues();
    00442
    00445   virtual PBoolean ProcessNetworkPacket();
    00446
    00449   virtual PBoolean TransmitPacket(PUDPSocket &sock);
    00450
    00452   PString GetFullFrameName() const;
    00453
    00455   virtual PString GetSubClassName() const
    00456     { return PString(" subclass=") + PString(subClass); }
    00457
    00461   void MarkDeleteNow();
    00462
    00467   void MarkVnakSendNow();
    00468
    00471   virtual BYTE *GetMediaDataPointer();
    00472
    00474   virtual PINDEX GetMediaDataSize();
    00475
    00477   PINDEX GetSubClass() const { return subClass; }
    00478
    00480   void SetSubClass(PINDEX newValue) { subClass = newValue;}
    00481
    00485   virtual PBoolean WriteHeader();
    00486
    00489   void ModifyFrameHeaderSequenceNumbers(PINDEX inNo, PINDEX outNo);
    00490
    00495   void ModifyFrameTimeStamp(PINDEX newTimeStamp);
    00496
    00498   virtual PBoolean InformationElementsPresent() { return false; }
    00499
    00502   PBoolean  SendFrameNow() { return sendFrameNow; }
    00503
    00506   PBoolean  DeleteFrameNow() { return deleteFrameNow; }
    00507
    00509   IAX2SequenceNumbers & GetSequenceInfo() { return sequence; }
    00510
    00512   virtual void PrintOn(ostream & strm) const;
    00513
    00515   void MarkAsResent();
    00516
    00519   PBoolean operator *= (IAX2FullFrame & other);
    00520
    00523   enum ConnectionRequired {
    00524     callActive,
    00525     callIrrelevant
    00526   };
    00527
    00529   virtual BYTE GetFullFrameType() { return 0; }
    00530
    00532   virtual PINDEX GetEncryptionOffset() { return 4; }
    00533
    00534  protected:
    00536   virtual PBoolean CallMustBeActive() { return callMustBeActive; }
    00537
    00539   void UnCompressSubClass(BYTE a);
    00540
    00542   int  CompressSubClass();
    00543
    00545   void ClearListFlags();
    00546
    00552   virtual void InitialiseHeader(IAX2Processor *processor);
    00553
    00554 #ifdef DOC_PLUS_PLUS
    00555
    00558   void OnTransmissionTimeout(PTimer &, INT);
    00559 #else
    00560   PDECLARE_NOTIFIER(PTimer, IAX2FullFrame, OnTransmissionTimeout);
    00561 #endif
    00562
    00563   PTimer transmissionTimer;
    00564
    00566   int subClass;
    00567
    00569   PTimeInterval retryDelta;
    00570
    00572   PTimeInterval timeOffset;
    00573
    00575   PINDEX       retries;
    00576
    00578   enum RetryTime {
    00579     minRetryTime = 1000,
    00580     maxRetryTime = 010000,
    00581     maxRetries   = 3
    00582   };
    00583
    00585   IAX2SequenceNumbers sequence;
    00586
    00588   PBoolean         sendFrameNow;
    00589
    00591   PBoolean         deleteFrameNow;
    00592
    00594   PBoolean         packetResent;
    00595
    00597   PBoolean callMustBeActive;
    00598
    00600   PBoolean isAckFrame;
    00601 };
    00602
    00604
    00609 class IAX2FullFrameDtmf : public IAX2FullFrame
    00610 {
    00611   PCLASSINFO(IAX2FullFrameDtmf, IAX2FullFrame);
    00612  public:
    00615   IAX2FullFrameDtmf(const IAX2Frame & srcFrame);
    00616
    00619   IAX2FullFrameDtmf(const IAX2FullFrame & srcFrame);
    00620
    00623   IAX2FullFrameDtmf(IAX2Processor *processor,
    00624                     char  subClassValue
    00625                     );
    00626
    00629   IAX2FullFrameDtmf(IAX2Processor *processor,
    00630                 PString  subClassValue
    00631                 );
    00632
    00633
    00635   virtual PString GetSubClassName() const;
    00636
    00638   enum DtmfSc {
    00639     dtmf0 = 48,
    00640     dtmf1 = 49,
    00641     dtmf2 = 50,
    00642     dtmf3 = 51,
    00643     dtmf4 = 52,
    00644     dtmf5 = 53,
    00645     dtmf6 = 54,
    00646     dtmf7 = 55,
    00647     dtmf8 = 56,
    00648     dtmf9 = 57,
    00649     dtmfA = 65,
    00650     dtmfB = 66,
    00651     dtmfC = 67,
    00652     dtmfD = 68,
    00653     dtmfStar = 42,
    00654     dtmfHash = 35
    00655   };
    00656
    00658   virtual BYTE GetFullFrameType() { return dtmfType; }
    00659
    00660  protected:
    00661 };
    00662
    00664
    00671 class IAX2FullFrameVoice : public IAX2FullFrame
    00672 {
    00673   PCLASSINFO(IAX2FullFrameVoice, IAX2FullFrame);
    00674  public:
    00675
    00678   IAX2FullFrameVoice(const IAX2Frame & srcFrame);
    00679
    00682   IAX2FullFrameVoice(const IAX2FullFrame & srcFrame);
    00683
    00692   IAX2FullFrameVoice(IAX2CallProcessor *processor, PBYTEArray &sound,
    00693                  PINDEX usersTimeStamp = 0);
    00694
    00696   virtual ~IAX2FullFrameVoice();
    00697
    00699   virtual PString GetSubClassName() const;
    00700
    00703   static PString GetSubClassName(unsigned testValue);
    00704
    00708   static PString GetOpalNameOfCodec(PINDEX testValue);
    00709
    00712   static unsigned short OpalNameToIax2Value(const PString opalName);
    00713
    00715   enum AudioSc {
    00716     g7231    = 1,
    00717     gsm      = 2,
    00718     g711ulaw = 4,
    00719     g711alaw = 8,
    00720     mp3      = 0x10,
    00721     adpcm    = 0x20,
    00722     pcm      = 0x40,
    00723     lpc10    = 0x80,
    00724     g729     = 0x100,
    00725     speex    = 0x200,
    00726     ilbc     = 0x400,
    00727     supportedCodecs = 11
    00728   };
    00729
    00731   virtual BYTE GetFullFrameType() { return voiceType; }
    00732 };
    00734
    00739 class IAX2FullFrameVideo : public IAX2FullFrame
    00740 {
    00741   PCLASSINFO(IAX2FullFrameVideo, IAX2FullFrame);
    00742  public:
    00743
    00746   IAX2FullFrameVideo(const IAX2Frame & srcFrame);
    00747
    00750   IAX2FullFrameVideo(const IAX2FullFrame & srcFrame);
    00751
    00753   virtual PString GetSubClassName() const;
    00754
    00756   enum VideoSc {
    00757     jpeg  = 0x10000,
    00758     png   = 0x20000,
    00759     h261  = 0x40000,
    00760     h263  = 0x80000
    00761   };
    00762
    00764   virtual BYTE GetFullFrameType() { return videoType; }
    00765  protected:
    00766 };
    00767
    00769
    00774 class IAX2FullFrameSessionControl : public IAX2FullFrame
    00775 {
    00776   PCLASSINFO(IAX2FullFrameSessionControl, IAX2FullFrame);
    00777  public:
    00778
    00780   enum SessionSc {
    00781     hangup          = 1,
    00782     ring            = 2,
    00783     ringing         = 3,
    00784     answer          = 4,
    00785     busy            = 5,
    00786     tkoffhk         = 6,
    00787     offhook         = 7,
    00788     congestion      = 8,
    00789     flashhook       = 9,
    00790     wink            = 10,
    00791     option          = 11,
    00792     keyRadio        = 12,
    00793     unkeyRadio      = 13,
    00794     callProgress    = 14,
    00795     callProceeding  = 15,
    00796     callOnHold      = 16,
    00797     callHoldRelease = 17,
    00798     stopSounds      = 255
    00799   };
    00800
    00801
    00802
    00805   IAX2FullFrameSessionControl(const IAX2Frame & srcFrame);
    00806
    00809   IAX2FullFrameSessionControl(const IAX2FullFrame & srcFrame);
    00810
    00813   IAX2FullFrameSessionControl(IAX2Processor *processor,
    00814                           PINDEX subClassValue
    00815                           );
    00816
    00819   IAX2FullFrameSessionControl(IAX2Processor *processor,
    00820                           SessionSc subClassValue
    00821                           );
    00822
    00824   virtual ~IAX2FullFrameSessionControl() { }
    00825
    00827   virtual PString GetSubClassName() const;
    00828
    00830   virtual BYTE GetFullFrameType() { return controlType; }
    00831
    00832  protected:
    00833 };
    00834
    00836
    00842 class IAX2FullFrameNull : public IAX2FullFrame
    00843 {
    00844   PCLASSINFO(IAX2FullFrameNull, IAX2FullFrame);
    00845  public:
    00848   IAX2FullFrameNull(IAX2EndPoint & endpoint) : IAX2FullFrame(endpoint)   { }
    00849
    00853   IAX2FullFrameNull(const IAX2Frame & srcFrame);
    00854
    00858   IAX2FullFrameNull(const IAX2FullFrame & srcFrame);
    00859
    00861   virtual PString GetSubClassName() const { return  PString(""); }
    00862
    00864   virtual BYTE GetFullFrameType() { return nullType; }
    00865
    00866  protected:
    00867 };
    00868
    00870
    00876 class IAX2FullFrameProtocol : public IAX2FullFrame
    00877 {
    00878   PCLASSINFO(IAX2FullFrameProtocol, IAX2FullFrame);
    00879  public:
    00880
    00882   enum ProtocolSc {
    00883     cmdNew       =  1,
    00884     cmdPing      =  2,
    00885     cmdPong      =  3,
    00886     cmdAck       =  4,
    00887     cmdHangup    =  5,
    00888     cmdReject    =  6,
    00889     cmdAccept    =  7,
    00890     cmdAuthReq   =  8,
    00891     cmdAuthRep   =  9,
    00892     cmdInval     =  10,
    00893     cmdLagRq     =  11,
    00894     cmdLagRp     =  12,
    00895     cmdRegReq    =  13,
    00896     cmdRegAuth   =  14,
    00897     cmdRegAck    =  15,
    00898     cmdRegRej    =  16,
    00899     cmdRegRel    =  17,
    00900     cmdVnak      =  18,
    00901     cmdDpReq     =  19,
    00902     cmdDpRep     =  20,
    00903     cmdDial      =  21,
    00904     cmdTxreq     =  22,
    00905     cmdTxcnt     =  23,
    00906     cmdTxacc     =  24,
    00907     cmdTxready   =  25,
    00908     cmdTxrel     =  26,
    00909     cmdTxrej     =  27,
    00910     cmdQuelch    =  28,
    00911     cmdUnquelch  =  29,
    00912     cmdPoke      =  30,
    00913     cmdPage      =  31,
    00914     cmdMwi       =  32,
    00915     cmdUnsupport =  33,
    00916     cmdTransfer  =  34,
    00917     cmdProvision =  35,
    00918     cmdFwDownl   =  36,
    00919     cmdFwData    =  37,
    00920     cmdTxMedia   =  38,
    00921     cmdRtKey     =  39,
    00922     cmdCallToken =  40
    00923   };
    00924
    00928   IAX2FullFrameProtocol(const IAX2Frame & srcFrame);
    00929
    00933   IAX2FullFrameProtocol(const IAX2FullFrame & srcFrame);
    00934
    00937   IAX2FullFrameProtocol(IAX2Processor *processor,
    00938                     PINDEX subClassValue,
    00939                     ConnectionRequired needCon = IAX2FullFrame::callActive
    00941                     );
    00942
    00945   IAX2FullFrameProtocol(IAX2Processor *processor,
    00946                     ProtocolSc  subClassValue,
    00947                     ConnectionRequired needCon=IAX2FullFrame::callActive
    00949                     );
    00950
    00956   IAX2FullFrameProtocol(IAX2Processor *processor,
    00957                     ProtocolSc  subClassValue,
    00958                     IAX2FullFrame *inReplyTo,
    00959                     ConnectionRequired needCon = IAX2FullFrame::callActive
    00961                     );
    00962
    00964   virtual ~IAX2FullFrameProtocol();
    00965
    00967   void SetRetransmissionRequired();
    00968
    00970   virtual PBoolean InformationElementsPresent() { return !ieElements.IsEmpty(); }
    00971
    00973   ProtocolSc GetSubClass() const { return (ProtocolSc) subClass; }
    00974
    00976   virtual PString GetSubClassName() const;
    00977
    00979   static PString GetSubClassName(unsigned t);
    00980
    00982   void AppendIe(IAX2Ie *newElement) { ieElements.Append(newElement); }
    00983
    00986   void WriteIeAsBinaryData();
    00987
    00991   void CopyDataFromIeListTo(IAX2IeData &res);
    00992
    00995   void GetRemoteCapability(unsigned int & capability,
    00996                            unsigned int & preferred);
    00997
    01000   virtual BYTE GetFullFrameType() { return iax2ProtocolType; }
    01001
    01003   virtual void PrintOn(ostream & strm) const;
    01004
    01007   PBoolean GetCallTokenIe(IAX2IeCallToken & callToken);
    01008
    01009  protected:
    01010
    01013   PBoolean ReadInformationElements();
    01014
    01015
    01018   IAX2IeList ieElements;
    01019
    01021 #if PTRACING
    01022     friend ostream & operator<<(ostream & o, ProtocolSc t);
    01023 #endif
    01024 };
    01025
    01027
    01032 class IAX2FullFrameText : public IAX2FullFrame
    01033 {
    01034   PCLASSINFO(IAX2FullFrameText, IAX2FullFrame);
    01035  public:
    01036
    01039   IAX2FullFrameText(IAX2Processor *processor,
    01040                 const PString&  textValue
    01041                 );
    01042
    01045   IAX2FullFrameText(const IAX2Frame & srcFrame);
    01046
    01049   IAX2FullFrameText(const IAX2FullFrame & srcFrame);
    01050
    01052   virtual PString GetSubClassName() const;
    01053
    01055   virtual BYTE GetFullFrameType() { return textType; }
    01056
    01058   PString GetTextString() const;
    01059
    01060  protected:
    01061
    01063   PString internalText;
    01064 };
    01066
    01071 class IAX2FullFrameImage : public IAX2FullFrame
    01072 {
    01073   PCLASSINFO(IAX2FullFrameImage, IAX2FullFrame);
    01074  public:
    01075
    01078   IAX2FullFrameImage(const IAX2Frame & srcFrame);
    01079
    01082   IAX2FullFrameImage(const IAX2FullFrame & srcFrame);
    01083
    01085   virtual PString GetSubClassName() const;
    01086
    01088   virtual BYTE GetFullFrameType() { return imageType; }
    01089  protected:
    01090 };
    01091
    01093
    01098 class IAX2FullFrameHtml : public IAX2FullFrame
    01099 {
    01100   PCLASSINFO(IAX2FullFrameHtml, IAX2FullFrame);
    01101  public:
    01102
    01105   IAX2FullFrameHtml(const IAX2Frame & srcFrame);
    01106
    01109   IAX2FullFrameHtml(const IAX2FullFrame & srcFrame);
    01110
    01112   virtual PString GetSubClassName() const;
    01113
    01115   virtual BYTE GetFullFrameType() { return htmlType; }
    01116  protected:
    01117 };
    01118
    01120
    01124 class IAX2FullFrameCng : public IAX2FullFrame
    01125 {
    01126   PCLASSINFO(IAX2FullFrameCng, IAX2FullFrame);
    01127  public:
    01128
    01131   IAX2FullFrameCng(const IAX2Frame & srcFrame);
    01132
    01135   IAX2FullFrameCng(const IAX2FullFrame & srcFrame);
    01136
    01138   virtual PString GetSubClassName() const;
    01139
    01141   virtual BYTE GetFullFrameType() { return cngType; }
    01142  protected:
    01143 };
    01144
    01146
    01153 class IAX2FrameList : public PList<IAX2Frame>
    01154 {
    01155  public:
    01157   void ReportList(PString & answer);
    01158
    01160   IAX2Frame *GetLastFrame();
    01161
    01163   void Initialise();
    01164
    01166   void GrabContents(IAX2FrameList &src);
    01167
    01170   void DeleteMatchingSendFrame(IAX2FullFrame *reply);
    01171
    01175   void SendVnakRequestedFrames(IAX2FullFrameProtocol &src);
    01176
    01178   void AddNewFrame(IAX2Frame *src);
    01179
    01181   void GetResendFramesDeleteOldFrames(IAX2FrameList & framesToSend);
    01182
    01184   void MarkAllAsResent();
    01185
    01186  protected:
    01188   PMutex mutex;
    01189 };
    01190
    01192
    01196 class IAX2ActiveFrameList : public IAX2FrameList
    01197 {
    01198   PCLASSINFO(IAX2ActiveFrameList, IAX2FrameList);
    01199  public:
    01200   IAX2ActiveFrameList() { Initialise(); }
    01201 };
    01203
    01204
    01205 #endif // OPAL_IAX2
    01206
    01207 #endif // OPAL_IAX2_FRAME_H
    01208
    01209 /* The comment below is magic for those who use emacs to edit this file.
    01210  * With the comment below, the tab key does auto indent to 2 spaces.
    01211  *
    01212  * Local Variables:
    01213  * mode:c
    01214  * c-basic-offset:2
    01215  * End:
    01216  */