transmit.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Inter Asterisk Exchange 2
00005  * 
00006  * Class definition for describing the entity that sends all packets
00007  * for all calls
00008  * 
00009  * Open Phone Abstraction Library (OPAL)
00010  *
00011  * Copyright (c) 2005 Indranet Technologies Ltd.
00012  *
00013  * The contents of this file are subject to the Mozilla Public License
00014  * Version 1.0 (the "License"); you may not use this file except in
00015  * compliance with the License. You may obtain a copy of the License at
00016  * http://www.mozilla.org/MPL/
00017  *
00018  * Software distributed under the License is distributed on an "AS IS"
00019  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00020  * the License for the specific language governing rights and limitations
00021  * under the License.
00022  *
00023  * The Original Code is Open Phone Abstraction Library.
00024  *
00025  * The Initial Developer of the Original Code is Indranet Technologies Ltd.
00026  *
00027  * The author of this code is Derek J Smithies
00028  *
00029  *  $Log: transmit.h,v $
00030  *  Revision 1.2  2005/08/26 03:07:38  dereksmithies
00031  *  Change naming convention, so all class names contain the string "IAX2"
00032  *
00033  *  Revision 1.1  2005/07/30 07:01:32  csoutheren
00034  *  Added implementation of IAX2 (Inter Asterisk Exchange 2) protocol
00035  *  Thanks to Derek Smithies of Indranet Technologies Ltd. for
00036  *  writing and contributing this code
00037  *
00038  *
00039  *
00040  *
00041  */
00042 
00043 #ifndef TRANSMIT_H
00044 #define TRANSMIT_H
00045 
00046 #include <ptlib.h>
00047 #include <ptlib/sockets.h>
00048 
00049 #include <iax2/frame.h>
00050 #include <iax2/iax2ep.h>
00051 
00052 #ifdef P_USE_PRAGMA
00053 #pragma interface
00054 #endif
00055 
00065 class IAX2Transmit : public PThread
00066 { 
00067   PCLASSINFO(IAX2Transmit, PThread);
00068  public:
00071   
00075   IAX2Transmit(IAX2EndPoint & _newEndpoint, PUDPSocket & _newSocket);
00076   
00080   ~IAX2Transmit();
00082   
00085   
00089   void SendFrame(IAX2Frame *newFrame);
00090   
00093   void ProcessLists() { activate.Signal(); }
00094   
00098   void AckReceived();
00099   
00102   virtual void Main();
00103   
00108   void PurgeMatchingFullFrames(IAX2Frame *frame);
00109 
00111   void ReportLists();
00113   
00114  protected:
00115   
00118   void ProcessAckingList();  
00119   
00121   void ProcessSendList();
00122   
00124   IAX2EndPoint &ep;
00125   
00127   PUDPSocket & sock;
00128   
00130   PSyncPoint activate;
00131   
00133   IAX2FrameList  ackingFrames;   
00134   
00136   IAX2FrameList  sendNowFrames;  
00137   
00139   BOOL       keepGoing;
00140 };
00141 
00142 #endif // IAX2_TRANSMIT_H
00143 /* The comment below is magic for those who use emacs to edit this file. */
00144 /* With the comment below, the tab key does auto indent to 4 spaces.     */
00145 
00146 /*
00147  * Local Variables:
00148  * mode:c
00149  * c-file-style:linux
00150  * c-basic-offset:2
00151  * End:
00152  */
00153 

Generated on Mon Sep 25 16:20:11 2006 for OPAL by  doxygen 1.4.7