receiver.h
Go to the documentation of this file.
/*
*
*
* Inter Asterisk Exchange 2
*
* The entity which receives all packets for all calls.
*
* Open Phone Abstraction Library (OPAL)
*
* Copyright (c) 2005 Indranet Technologies Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Open Phone Abstraction Library.
*
* The Initial Developer of the Original Code is Indranet Technologies Ltd.
*
* The author of this code is Derek J Smithies
*
* $Revision: 24606 $
* $Author: dereksmithies $
* $Date: 2010-07-28 22:51:05 -0500 (Wed, 28 Jul 2010) $
*/
#ifndef OPAL_IAX2_RECEIVER_H
#define OPAL_IAX2_RECEIVER_H
#ifndef _PTLIB_H
#include <ptlib.h>
#endif
#include <opal/buildopts.h>
#if OPAL_IAX2
#include <ptlib/sockets.h>
#ifdef P_USE_PRAGMA
#pragma interface
#endif
class IAX2EndPoint;
class IAX2Frame;
class IAX2FrameList;
class IAX2PacketIdList;
#include <iax2/frame.h>
class IAX2Receiver : public PThread
{
PCLASSINFO(IAX2Receiver, PThread);
public:
IAX2Receiver(IAX2EndPoint & _newEndpoint, PUDPSocket & _newSocket);
~IAX2Receiver();
/*The method which the receiver thread invokes*/
virtual void Main();
virtual void Terminate();
PBoolean ReadNetworkSocket();
void AddNewReceivedFrame(IAX2Frame *newFrame);
PINDEX GetSize() { return fromNetworkFrames.GetSize(); }
protected:
IAX2EndPoint &endpoint;
PUDPSocket & sock;
IAX2FrameList fromNetworkFrames;
PBoolean keepGoing;
};
#endif // OPAL_IAX2
#endif // OPAL_IAX2_RECEIVER_H
/* The comment below is magic for those who use emacs to edit this file.
* With the comment below, the tab key does auto indent to 2 spaces.
*
* Local Variables:
* mode:c
* c-basic-offset:2
* End:
*/
IAX2FrameList
Definition: frame.h:1168
IAX2Receiver::sock
PUDPSocket & sock
Definition: receiver.h:106
IAX2EndPoint
Definition: iax2ep.h:104
buildopts.h
IAX2Receiver::ReadNetworkSocket
PBoolean ReadNetworkSocket()
IAX2Receiver::Terminate
virtual void Terminate()
IAX2Receiver::IAX2Receiver
IAX2Receiver(IAX2EndPoint &_newEndpoint, PUDPSocket &_newSocket)
frame.h
IAX2Receiver::GetSize
PINDEX GetSize()
Definition: receiver.h:98
IAX2Receiver::AddNewReceivedFrame
void AddNewReceivedFrame(IAX2Frame *newFrame)
IAX2Receiver::keepGoing
PBoolean keepGoing
Definition: receiver.h:113
IAX2Receiver::fromNetworkFrames
IAX2FrameList fromNetworkFrames
Definition: receiver.h:110
IAX2Frame
Definition: frame.h:75
IAX2Receiver::endpoint
IAX2EndPoint & endpoint
Definition: receiver.h:103
IAX2Receiver
Definition: receiver.h:60
IAX2FrameList::GetSize
virtual PINDEX GetSize()
Definition: frame.h:1205
IAX2Receiver::Main
virtual void Main()
IAX2Receiver::~IAX2Receiver
~IAX2Receiver()
IAX2PacketIdList
Definition: remote.h:201