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  * $Revision: 21283 $
00030  * $Author: rjongbloed $
00031  * $Date: 2008-10-11 07:10:58 +0000 (Sat, 11 Oct 2008) $
00032  */
00033 
00034 #ifndef OPAL_IAX2_TRANSMIT_H
00035 #define OPAL_IAX2_TRANSMIT_H
00036 
00037 #ifndef _PTLIB_H
00038 #include <ptlib.h>
00039 #endif
00040 
00041 #include <opal/buildopts.h>
00042 
00043 #if OPAL_IAX2
00044 
00045 #include <ptlib/sockets.h>
00046 
00047 #include <iax2/frame.h>
00048 #include <iax2/iax2ep.h>
00049 
00050 #ifdef P_USE_PRAGMA
00051 #pragma interface
00052 #endif
00053 
00063 class IAX2Transmit : public PThread
00064 { 
00065   PCLASSINFO(IAX2Transmit, PThread);
00066  public:
00069   
00073   IAX2Transmit(IAX2EndPoint & _newEndpoint, PUDPSocket & _newSocket);
00074   
00078   ~IAX2Transmit();
00080   
00083   
00085   virtual void Terminate();
00086 
00090   void SendFrame(IAX2Frame *newFrame);
00091   
00094   void ProcessLists() { activate.Signal(); }
00095   
00099   void AckReceived();
00100   
00103   virtual void Main();
00104   
00109   void PurgeMatchingFullFrames(IAX2Frame *frame);
00110 
00114   void SendVnakRequestedFrames(IAX2FullFrameProtocol &src);
00115 
00117   void ReportLists(PString & answer, bool getFullReport=false);
00119   
00120  protected:
00121   
00124   void ProcessAckingList();  
00125   
00127   void ProcessSendList();
00128   
00130   IAX2EndPoint &ep;
00131   
00133   PUDPSocket & sock;
00134   
00136   PSyncPoint activate;
00137   
00142   IAX2ActiveFrameList  ackingFrames;   
00143   
00145   IAX2ActiveFrameList  sendNowFrames;  
00146   
00148   PBoolean       keepGoing;
00149 };
00150 
00151 
00152 #endif // OPAL_IAX2
00153 
00154 #endif // OPAL_IAX2_TRANSMIT_H
00155 
00156 /* The comment below is magic for those who use emacs to edit this file. */
00157 /* With the comment below, the tab key does auto indent to 4 spaces.     */
00158 
00159 /*
00160  * Local Variables:
00161  * mode:c
00162  * c-basic-offset:2
00163  * End:
00164  */

Generated on Mon Feb 23 02:01:40 2009 for OPAL by  doxygen 1.5.1