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 <ptlib/sockets.h> 00065 00066 #include <iax2/frame.h> 00067 #include <iax2/iax2ep.h> 00068 00069 #ifdef P_USE_PRAGMA 00070 #pragma interface 00071 #endif 00072 00082 class IAX2Transmit : public PThread 00083 { 00084 PCLASSINFO(IAX2Transmit, PThread); 00085 public: 00088 00092 IAX2Transmit(IAX2EndPoint & _newEndpoint, PUDPSocket & _newSocket); 00093 00097 ~IAX2Transmit(); 00099 00102 00104 virtual void Terminate(); 00105 00109 void SendFrame(IAX2Frame *newFrame); 00110 00113 void ProcessLists() { activate.Signal(); } 00114 00118 void AckReceived(); 00119 00122 virtual void Main(); 00123 00128 void PurgeMatchingFullFrames(IAX2Frame *frame); 00129 00133 void SendVnakRequestedFrames(IAX2FullFrameProtocol &src); 00134 00136 void ReportLists(); 00138 00139 protected: 00140 00143 void ProcessAckingList(); 00144 00146 void ProcessSendList(); 00147 00149 IAX2EndPoint &ep; 00150 00152 PUDPSocket & sock; 00153 00155 PSyncPoint activate; 00156 00158 IAX2FrameList ackingFrames; 00159 00161 IAX2FrameList sendNowFrames; 00162 00164 BOOL keepGoing; 00165 }; 00166 00167 #endif // IAX2_TRANSMIT_H 00168 /* The comment below is magic for those who use emacs to edit this file. */ 00169 /* With the comment below, the tab key does auto indent to 4 spaces. */ 00170 00171 /* 00172 * Local Variables: 00173 * mode:c 00174 * c-file-style:linux 00175 * c-basic-offset:2 00176 * End: 00177 */ 00178