OPAL  Version 3.18.8
receiver.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Inter Asterisk Exchange 2
5  *
6  * The entity which receives all packets for all calls.
7  *
8  * Open Phone Abstraction Library (OPAL)
9  *
10  * Copyright (c) 2005 Indranet Technologies Ltd.
11  *
12  * The contents of this file are subject to the Mozilla Public License
13  * Version 1.0 (the "License"); you may not use this file except in
14  * compliance with the License. You may obtain a copy of the License at
15  * http://www.mozilla.org/MPL/
16  *
17  * Software distributed under the License is distributed on an "AS IS"
18  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
19  * the License for the specific language governing rights and limitations
20  * under the License.
21  *
22  * The Original Code is Open Phone Abstraction Library.
23  *
24  * The Initial Developer of the Original Code is Indranet Technologies Ltd.
25  *
26  * The author of this code is Derek J Smithies
27  */
28 
29 #ifndef OPAL_IAX2_RECEIVER_H
30 #define OPAL_IAX2_RECEIVER_H
31 
32 #ifndef _PTLIB_H
33 #include <ptlib.h>
34 #endif
35 
36 #include <opal_config.h>
37 
38 #if OPAL_IAX2
39 
40 #include <ptlib/sockets.h>
41 
42 #ifdef P_USE_PRAGMA
43 #pragma interface
44 #endif
45 
46 class IAX2EndPoint;
47 class IAX2Frame;
48 class IAX2FrameList;
49 class IAX2PacketIdList;
50 
51 #include <iax2/frame.h>
52 
56 class IAX2Receiver : public PThread
57 {
58  PCLASSINFO(IAX2Receiver, PThread);
59  public:
63  IAX2Receiver(IAX2EndPoint & _newEndpoint, PUDPSocket & _newSocket);
64 
66  ~IAX2Receiver();
68 
71  /*The method which the receiver thread invokes*/
72  virtual void Main();
73 
78  virtual void Terminate();
79 
81  PBoolean ReadNetworkSocket();
82 
91  void AddNewReceivedFrame(IAX2Frame *newFrame);
92 
94  PINDEX GetSize() { return fromNetworkFrames.GetSize(); }
95 
97  protected:
100 
102  PUDPSocket & sock;
103 
107 
109  PBoolean keepGoing;
110 };
111 
112 
113 #endif // OPAL_IAX2
114 
115 #endif // OPAL_IAX2_RECEIVER_H
116 
117 /* The comment below is magic for those who use emacs to edit this file.
118  * With the comment below, the tab key does auto indent to 2 spaces.
119  *
120  * Local Variables:
121  * mode:c
122  * c-basic-offset:2
123  * End:
124  */
Definition: frame.h:1149
PUDPSocket & sock
Definition: receiver.h:102
Definition: iax2ep.h:100
PBoolean ReadNetworkSocket()
virtual void Terminate()
IAX2Receiver(IAX2EndPoint &_newEndpoint, PUDPSocket &_newSocket)
PINDEX GetSize()
Definition: receiver.h:94
void AddNewReceivedFrame(IAX2Frame *newFrame)
PBoolean keepGoing
Definition: receiver.h:109
IAX2FrameList fromNetworkFrames
Definition: receiver.h:106
Definition: frame.h:71
IAX2EndPoint & endpoint
Definition: receiver.h:99
Definition: receiver.h:56
virtual void Main()
Definition: remote.h:194