00001 /* 00002 * 00003 * Inter Asterisk Exchange 2 00004 * 00005 * Open Phone Abstraction Library (OPAL) 00006 * 00007 * Extension of the Opal Media stream, where the media from the IAX2 side is 00008 * linked to the 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: iax2medstrm.h,v $ 00029 * Revision 1.3 2007/03/29 05:15:48 csoutheren 00030 * Pass OpalConnection to OpalMediaSream constructor 00031 * Add ID to OpalMediaStreams so that transcoders can match incoming and outgoing codecs 00032 * 00033 * Revision 1.2 2007/01/11 03:02:15 dereksmithies 00034 * Remove the previous audio buffering code, and switch to using the jitter 00035 * buffer provided in Opal. Reduce the verbosity of the log mesasges. 00036 * 00037 * Revision 1.1 2005/07/30 07:01:32 csoutheren 00038 * Added implementation of IAX2 (Inter Asterisk Exchange 2) protocol 00039 * Thanks to Derek Smithies of Indranet Technologies Ltd. for 00040 * writing and contributing this code 00041 * 00042 * 00043 * 00044 */ 00045 00046 #ifndef __OPAL_IAX2_MEDIASTRM_H 00047 #define __OPAL_IAX2_MEDIASTRM_H 00048 00049 #ifdef P_USE_PRAGMA 00050 #pragma interface 00051 #endif 00052 00053 00054 #include <opal/buildopts.h> 00055 #include <opal/mediafmt.h> 00056 #include <iax2/iax2con.h> 00057 #include <iax2/iax2jitter.h> 00058 00059 class RTP_Session; 00060 class OpalMediaPatch; 00061 class OpalLine; 00062 00063 00067 class OpalIAX2MediaStream : public OpalMediaStream 00068 { 00069 PCLASSINFO(OpalIAX2MediaStream, OpalMediaStream); 00074 OpalIAX2MediaStream( 00075 IAX2Connection &con, 00076 const OpalMediaFormat & mediaFormat, 00077 unsigned sessionID, 00078 BOOL isSource 00079 ); 00081 00082 public: 00089 virtual BOOL Open(); 00090 00096 virtual BOOL Start(); 00097 00102 virtual BOOL Close(); 00103 00109 virtual BOOL ReadPacket( 00110 RTP_DataFrame & packet 00111 ); 00112 00116 virtual BOOL WriteData( 00117 const BYTE * data, 00118 PINDEX length, 00119 PINDEX & written 00120 ); 00121 00126 virtual BOOL IsSynchronous() const; 00128 00129 protected: 00131 IAX2Connection & connection; 00132 00136 PBYTEArray pendingData; 00137 }; 00138 00139 #endif //__OPAL_IAX2_MEDIASTRM_H 00140 00141 /* The comment below is magic for those who use emacs to edit this file. */ 00142 /* With the comment below, the tab key does auto indent to 2 spaces. */ 00143 00144 /* 00145 * Local Variables: 00146 * mode:c 00147 * c-file-style:linux 00148 * c-basic-offset:2 00149 * End: 00150 */ 00151