OPAL  Version 3.18.8
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 
30 #ifndef OPAL_IAX2_TRANSMIT_H
31 #define OPAL_IAX2_TRANSMIT_H
32 
33 #ifndef _PTLIB_H
34 #include <ptlib.h>
35 #endif
36 
37 #include <opal_config.h>
38 
39 #if OPAL_IAX2
40 
41 #include <ptlib/sockets.h>
42 
43 #include <iax2/frame.h>
44 #include <iax2/iax2ep.h>
45 
46 #ifdef P_USE_PRAGMA
47 #pragma interface
48 #endif
49 
59 class IAX2Transmit : public PThread
60 {
61  PCLASSINFO(IAX2Transmit, PThread);
62  public:
65 
69  IAX2Transmit(IAX2EndPoint & _newEndpoint, PUDPSocket & _newSocket);
70 
74  ~IAX2Transmit();
76 
79 
81  virtual void Terminate();
82 
86  void SendFrame(IAX2Frame *newFrame);
87 
90  void ProcessLists() { activate.Signal(); }
91 
95  void AckReceived();
96 
99  virtual void Main();
100 
105  void PurgeMatchingFullFrames(IAX2Frame *frame);
106 
111 
113  void ReportLists(PString & answer, bool getFullReport=false);
115 
116  protected:
117 
120  void ProcessAckingList();
121 
123  void ProcessSendList();
124 
127 
129  PUDPSocket & sock;
130 
132  PSyncPoint activate;
133 
139 
142 
144  PBoolean keepGoing;
145 };
146 
147 
148 #endif // OPAL_IAX2
149 
150 #endif // OPAL_IAX2_TRANSMIT_H
151 
152 /* The comment below is magic for those who use emacs to edit this file.
153  * With the comment below, the tab key does auto indent to 2 spaces.
154  *
155  * Local Variables:
156  * mode:c
157  * c-basic-offset:2
158  * End:
159  */
Definition: iax2ep.h:100
void AckReceived()
IAX2ActiveFrameList sendNowFrames
Definition: transmit.h:141
void PurgeMatchingFullFrames(IAX2Frame *frame)
Definition: transmit.h:59
void ProcessLists()
Definition: transmit.h:90
virtual void Main()
virtual void Terminate()
IAX2ActiveFrameList ackingFrames
Definition: transmit.h:138
PBoolean keepGoing
Definition: transmit.h:144
Definition: frame.h:872
PSyncPoint activate
Definition: transmit.h:132
IAX2EndPoint & ep
Definition: transmit.h:126
void SendFrame(IAX2Frame *newFrame)
PUDPSocket & sock
Definition: transmit.h:129
Definition: frame.h:1192
void ProcessAckingList()
void SendVnakRequestedFrames(IAX2FullFrameProtocol &src)
Definition: frame.h:71
void ReportLists(PString &answer, bool getFullReport=false)
IAX2Transmit(IAX2EndPoint &_newEndpoint, PUDPSocket &_newSocket)
void ProcessSendList()