receiver.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Inter Asterisk Exchange 2
00005  * 
00006  * The entity which receives all packets for all calls.
00007  * 
00008  * Open Phone Abstraction Library (OPAL)
00009  *
00010  * Copyright (c) 2005 Indranet Technologies Ltd.
00011  *
00012  * The contents of this file are subject to the Mozilla Public License
00013  * Version 1.0 (the "License"); you may not use this file except in
00014  * compliance with the License. You may obtain a copy of the License at
00015  * http://www.mozilla.org/MPL/
00016  *
00017  * Software distributed under the License is distributed on an "AS IS"
00018  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00019  * the License for the specific language governing rights and limitations
00020  * under the License.
00021  *
00022  * The Original Code is Open Phone Abstraction Library.
00023  *
00024  * The Initial Developer of the Original Code is Indranet Technologies Ltd.
00025  *
00026  * The author of this code is Derek J Smithies
00027  *
00028  *  $Log: receiver.h,v $
00029  *  Revision 1.2  2005/08/26 03:07:38  dereksmithies
00030  *  Change naming convention, so all class names contain the string "IAX2"
00031  *
00032  *  Revision 1.1  2005/07/30 07:01:32  csoutheren
00033  *  Added implementation of IAX2 (Inter Asterisk Exchange 2) protocol
00034  *  Thanks to Derek Smithies of Indranet Technologies Ltd. for
00035  *  writing and contributing this code
00036  *
00037  *
00038  *
00039  *
00040  *
00041  */
00042 
00043 #ifndef RECEIVER_H
00044 #define RECEIVER_H
00045 
00046 #include <ptlib.h>
00047 #include <ptlib/sockets.h>
00048 
00049 #ifdef P_USE_PRAGMA
00050 #pragma interface
00051 #endif
00052 
00053 class IAX2EndPoint;
00054 class IAX2Frame;
00055 class IAX2FrameList;
00056 class IAX2PacketIdList;
00057 
00058 #include <iax2/frame.h>
00059 
00063 class IAX2Receiver : public PThread
00064 { 
00065   PCLASSINFO(IAX2Receiver, PThread);
00066  public:
00070   IAX2Receiver(IAX2EndPoint & _newEndpoint, PUDPSocket & _newSocket);
00071   
00073   ~IAX2Receiver();
00075   
00078   /*The method which the receiver thread invokes*/
00079   virtual void Main();
00080   
00082   BOOL ReadNetworkSocket();
00083   
00092   void AddNewReceivedFrame(IAX2Frame *newFrame);
00094  protected:
00096   IAX2EndPoint &endpoint;
00097   
00099   PUDPSocket & sock;
00100   
00103   IAX2FrameList      fromNetworkFrames;
00104   
00106   BOOL           keepGoing;
00107 };
00108 
00109 #endif // RECEIVER_H
00110 /* The comment below is magic for those who use emacs to edit this file. */
00111 /* With the comment below, the tab key does auto indent to 4 spaces.     */
00112 
00113 /*
00114  * Local Variables:
00115  * mode:c
00116  * c-file-style:linux
00117  * c-basic-offset:2
00118  * End:
00119  */
00120 

Generated on Mon Sep 25 16:20:10 2006 for OPAL by  doxygen 1.4.7