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.6  2007/04/19 06:17:21  csoutheren
00031  *  Fixes for precompiled headers with gcc
00032  *
00033  *  Revision 1.5  2007/01/23 02:08:25  dereksmithies
00034  *  Handle Vnak frames correctly. handle iseqno and oseqno correctly.
00035  *
00036  *  Revision 1.4  2007/01/09 03:32:23  dereksmithies
00037  *  Tidy up and improve the close down process - make it more robust.
00038  *  Alter level of several PTRACE statements. Add Terminate() method to transmitter and receiver.
00039  *
00040  *  Revision 1.3  2006/06/16 01:47:08  dereksmithies
00041  *  Get the OnHold features of IAX2 to work correctly.
00042  *  Thanks to Stephen Cook, (sitiveni@gmail.com) for this work.
00043  *
00044  *  Revision 1.2  2005/08/26 03:07:38  dereksmithies
00045  *  Change naming convention, so all class names contain the string "IAX2"
00046  *
00047  *  Revision 1.1  2005/07/30 07:01:32  csoutheren
00048  *  Added implementation of IAX2 (Inter Asterisk Exchange 2) protocol
00049  *  Thanks to Derek Smithies of Indranet Technologies Ltd. for
00050  *  writing and contributing this code
00051  *
00052  *
00053  *
00054  *
00055  */
00056 
00057 #ifndef TRANSMIT_H
00058 #define TRANSMIT_H
00059 
00060 #ifndef _PTLIB_H
00061 #include <ptlib.h>
00062 #endif
00063 
00064 #include <opal/buildopts.h>
00065 
00066 #include <ptlib/sockets.h>
00067 
00068 #include <iax2/frame.h>
00069 #include <iax2/iax2ep.h>
00070 
00071 #ifdef P_USE_PRAGMA
00072 #pragma interface
00073 #endif
00074 
00084 class IAX2Transmit : public PThread
00085 { 
00086   PCLASSINFO(IAX2Transmit, PThread);
00087  public:
00090   
00094   IAX2Transmit(IAX2EndPoint & _newEndpoint, PUDPSocket & _newSocket);
00095   
00099   ~IAX2Transmit();
00101   
00104   
00106   virtual void Terminate();
00107 
00111   void SendFrame(IAX2Frame *newFrame);
00112   
00115   void ProcessLists() { activate.Signal(); }
00116   
00120   void AckReceived();
00121   
00124   virtual void Main();
00125   
00130   void PurgeMatchingFullFrames(IAX2Frame *frame);
00131 
00135   void SendVnakRequestedFrames(IAX2FullFrameProtocol &src);
00136 
00138   void ReportLists(PString & answer, bool getFullReport=false);
00140   
00141  protected:
00142   
00145   void ProcessAckingList();  
00146   
00148   void ProcessSendList();
00149   
00151   IAX2EndPoint &ep;
00152   
00154   PUDPSocket & sock;
00155   
00157   PSyncPoint activate;
00158   
00163   IAX2ActiveFrameList  ackingFrames;   
00164   
00166   IAX2ActiveFrameList  sendNowFrames;  
00167   
00169   PBoolean       keepGoing;
00170 };
00171 
00172 #endif // IAX2_TRANSMIT_H
00173 /* The comment below is magic for those who use emacs to edit this file. */
00174 /* With the comment below, the tab key does auto indent to 4 spaces.     */
00175 
00176 /*
00177  * Local Variables:
00178  * mode:c
00179  * c-basic-offset:2
00180  * End:
00181  */
00182 

Generated on Mon Sep 22 12:24:55 2008 for OPAL by  doxygen 1.5.1