OPAL  Version 3.14.3
transmit.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Inter Asterisk Exchange 2
5  *
6  * Class definition for describing the entity that sends all packets
7  * for all calls
8  *
9  * Open Phone Abstraction Library (OPAL)
10  *
11  * Copyright (c) 2005 Indranet Technologies Ltd.
12  *
13  * The contents of this file are subject to the Mozilla Public License
14  * Version 1.0 (the "License"); you may not use this file except in
15  * compliance with the License. You may obtain a copy of the License at
16  * http://www.mozilla.org/MPL/
17  *
18  * Software distributed under the License is distributed on an "AS IS"
19  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
20  * the License for the specific language governing rights and limitations
21  * under the License.
22  *
23  * The Original Code is Open Phone Abstraction Library.
24  *
25  * The Initial Developer of the Original Code is Indranet Technologies Ltd.
26  *
27  * The author of this code is Derek J Smithies
28  *
29  * $Revision: 29536 $
30  * $Author: rjongbloed $
31  * $Date: 2013-04-19 18:55:15 +1000 (Fri, 19 Apr 2013) $
32  */
33 
34 #ifndef OPAL_IAX2_TRANSMIT_H
35 #define OPAL_IAX2_TRANSMIT_H
36 
37 #ifndef _PTLIB_H
38 #include <ptlib.h>
39 #endif
40 
41 #include <opal_config.h>
42 
43 #if OPAL_IAX2
44 
45 #include <ptlib/sockets.h>
46 
47 #include <iax2/frame.h>
48 #include <iax2/iax2ep.h>
49 
50 #ifdef P_USE_PRAGMA
51 #pragma interface
52 #endif
53 
63 class IAX2Transmit : public PThread
64 {
65  PCLASSINFO(IAX2Transmit, PThread);
66  public:
69 
73  IAX2Transmit(IAX2EndPoint & _newEndpoint, PUDPSocket & _newSocket);
74 
78  ~IAX2Transmit();
80 
83 
85  virtual void Terminate();
86 
90  void SendFrame(IAX2Frame *newFrame);
91 
94  void ProcessLists() { activate.Signal(); }
95 
99  void AckReceived();
100 
103  virtual void Main();
104 
109  void PurgeMatchingFullFrames(IAX2Frame *frame);
110 
115 
117  void ReportLists(PString & answer, bool getFullReport=false);
119 
120  protected:
121 
124  void ProcessAckingList();
125 
127  void ProcessSendList();
128 
131 
133  PUDPSocket & sock;
134 
136  PSyncPoint activate;
137 
143 
146 
148  PBoolean keepGoing;
149 };
150 
151 
152 #endif // OPAL_IAX2
153 
154 #endif // OPAL_IAX2_TRANSMIT_H
155 
156 /* The comment below is magic for those who use emacs to edit this file.
157  * With the comment below, the tab key does auto indent to 2 spaces.
158  *
159  * Local Variables:
160  * mode:c
161  * c-basic-offset:2
162  * End:
163  */