00001 /* 00002 * opalvxml.h 00003 * 00004 * Header file for IVR code 00005 * 00006 * A H.323 IVR application. 00007 * 00008 * Copyright (C) 2002 Equivalence Pty. Ltd. 00009 * 00010 * The contents of this file are subject to the Mozilla Public License 00011 * Version 1.0 (the "License"); you may not use this file except in 00012 * compliance with the License. You may obtain a copy of the License at 00013 * http://www.mozilla.org/MPL/ 00014 * 00015 * Software distributed under the License is distributed on an "AS IS" 00016 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00017 * the License for the specific language governing rights and limitations 00018 * under the License. 00019 * 00020 * The Original Code is Portable Windows Library. 00021 * 00022 * The Initial Developer of the Original Code is Equivalence Pty. Ltd. 00023 * 00024 * Contributor(s): ______________________________________. 00025 * 00026 * $Log: opalvxml.h,v $ 00027 * Revision 1.16 2004/07/15 11:20:37 rjongbloed 00028 * Migrated changes from crs_vxnml_devel branch into main trunk 00029 * 00030 * Revision 1.15.6.1 2004/07/07 07:10:11 csoutheren 00031 * Changed to use new factory based PWAVFile 00032 * Removed redundant blocking/unblocking when using G.723.1 00033 * 00034 * Revision 1.15 2002/09/16 01:14:15 robertj 00035 * Added #define so can select if #pragma interface/implementation is used on 00036 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00037 * 00038 * Revision 1.14 2002/08/27 02:21:07 craigs 00039 * Added silence detection capability to fake G.723.1codec 00040 * 00041 * Revision 1.13 2002/08/15 08:22:25 craigs 00042 * Added P_EXPAT test back in 00043 * 00044 * Revision 1.12 2002/08/15 04:55:26 robertj 00045 * Fixed shutdown problems with closing vxml session, leaks a thread. 00046 * Fixed potential problems with indirect channel Close() function. 00047 * 00048 * Revision 1.11 2002/08/06 06:00:38 craigs 00049 * Removed ifdef test for EXPLATFLAG 00050 * 00051 * Revision 1.10 2002/08/06 05:11:24 craigs 00052 * Moved most of stuff to ptclib 00053 * 00054 * Revision 1.9 2002/08/05 09:43:30 robertj 00055 * Added pragma interface/implementation 00056 * Moved virtual into .cxx file 00057 * 00058 * Revision 1.8 2002/07/29 15:13:51 craigs 00059 * Added autodelete option to PlayFile 00060 * 00061 * Revision 1.7 2002/07/18 04:17:12 robertj 00062 * Moved virtuals to source and changed name of G.723.1 file capability 00063 * 00064 * Revision 1.6 2002/07/10 13:16:19 craigs 00065 * Moved some VXML classes from Opal back into PTCLib 00066 * Added ability to repeat outputted data 00067 * 00068 * Revision 1.5 2002/07/09 08:27:23 craigs 00069 * Added GetMediaFormat to channels 00070 * 00071 * Revision 1.4 2002/07/03 01:53:58 craigs 00072 * Added newline to the end of the file for Linux 00073 * 00074 * Revision 1.3 2002/07/02 06:32:04 craigs 00075 * Added recording functions 00076 * 00077 * Revision 1.2 2002/06/28 02:42:54 craigs 00078 * Fixed problem with G.723.1 file codec not identified as native format 00079 * 00080 * Revision 1.1 2002/06/27 05:44:39 craigs 00081 * Initial version 00082 * 00083 * Revision 1.2 2002/06/26 09:05:28 csoutheren 00084 * Added ability to utter various "sayas" types within prompts 00085 * 00086 * Revision 1.1 2002/06/26 01:13:53 csoutheren 00087 * Disassociated VXML and Opal/OpenH323 specific elements 00088 * 00089 * 00090 */ 00091 00092 #ifndef _OpenIVR_OPALVXML_H 00093 #define _OpenIVR_OPALVXML_H 00094 00095 #ifdef P_USE_PRAGMA 00096 #pragma interface 00097 #endif 00098 00099 #include <ptclib/vxml.h> 00100 #include <opalwavfile.h> 00101 #include <ptclib/delaychan.h> 00102 #include <h323caps.h> 00103 #include <h245.h> 00104 #include <h323con.h> 00105 00107 00108 class G7231_File_Codec : public H323AudioCodec 00109 { 00110 PCLASSINFO(G7231_File_Codec, H323AudioCodec); 00111 00112 public: 00113 G7231_File_Codec(Direction dir); 00114 00115 unsigned GetBandwidth() const; 00116 static int GetFrameLen(int val); 00117 00118 BOOL Read(BYTE * buffer, unsigned & length, RTP_DataFrame &); 00119 BOOL Write(const BYTE * buffer, unsigned length, const RTP_DataFrame & rtp, unsigned & frames); 00120 00121 BOOL IsRawDataChannelNative() const; 00122 00123 unsigned GetAverageSignalLevel(); 00124 00125 protected: 00126 int lastFrameLen; 00127 }; 00128 00129 00130 class G7231_File_Capability : public H323AudioCapability 00131 { 00132 PCLASSINFO(G7231_File_Capability, H323AudioCapability) 00133 00134 public: 00135 G7231_File_Capability(); 00136 00137 unsigned GetSubType() const; 00138 PString GetFormatName() const; 00139 00140 H323Codec * CreateCodec(H323Codec::Direction direction) const; 00141 00142 BOOL OnSendingPDU(H245_AudioCapability & cap, unsigned packetSize) const; 00143 BOOL OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize); 00144 PObject * Clone() const; 00145 }; 00146 00147 00149 00150 00151 #if P_EXPAT 00152 00153 class PTextToSpeech; 00154 00155 class OpalVXMLSession : public PVXMLSession 00156 { 00157 PCLASSINFO(OpalVXMLSession, PVXMLSession); 00158 public: 00159 OpalVXMLSession(H323Connection * _conn, PTextToSpeech * tts = NULL, BOOL autoDelete = FALSE); 00160 BOOL Close(); 00161 00162 protected: 00163 H323Connection * conn; 00164 }; 00165 00166 #endif 00167 00168 #endif 00169