Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

lid.h

Go to the documentation of this file.
00001 /*
00002  * lid.h
00003  *
00004  * Line Interface Device
00005  *
00006  * Open Phone Abstraction Library
00007  *
00008  * Copyright (c) 1999-2000 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 Open H323 Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Portions of this code were written with the assisance of funding from 
00025  * Quicknet Technologies, Inc. http://www.quicknet.net.
00026  * 
00027  * Contributor(s): ______________________________________.
00028  *
00029  * $Log: lid.h,v $
00030  * Revision 1.56  2003/04/29 08:29:13  robertj
00031  * Cleaned up documentation for new wink duration functions.
00032  *
00033  * Revision 1.55  2003/04/28 01:47:52  dereks
00034  * Add ability to set/get wink duration for ixj device.
00035  *
00036  * Revision 1.54  2003/03/05 06:26:40  robertj
00037  * Added function to play a WAV file to LID, thanks Pietro Ravasio
00038  *
00039  * Revision 1.53  2002/11/05 04:26:48  robertj
00040  * Imported RingLine() by array from OPAL.
00041  *
00042  * Revision 1.52  2002/10/29 00:46:04  dereks
00043  * Fix typo in comments.
00044  *
00045  * Revision 1.51  2002/09/16 01:14:15  robertj
00046  * Added #define so can select if #pragma interface/implementation is used on
00047  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00048  *
00049  * Revision 1.50  2002/09/03 06:19:37  robertj
00050  * Normalised the multi-include header prevention ifdef/define symbol.
00051  *
00052  * Revision 1.49  2002/08/05 10:03:47  robertj
00053  * Cosmetic changes to normalise the usage of pragma interface/implementation.
00054  *
00055  * Revision 1.48  2002/06/27 08:52:53  robertj
00056  * Fixed typo and naming convention for Cisco G.723.1 annex A capability.
00057  *
00058  * Revision 1.47  2002/06/26 05:45:41  robertj
00059  * Added capability for Cisco IOS non-standard name for G.723.1 Annex A so
00060  *   can now utilise SID frames with Cisco gateways.
00061  *
00062  * Revision 1.46  2002/06/25 08:30:08  robertj
00063  * Changes to differentiate between stright G.723.1 and G.723.1 Annex A using
00064  *   the OLC dataType silenceSuppression field so does not send SID frames
00065  *   to receiver codecs that do not understand them.
00066  *
00067  * Revision 1.45  2002/05/09 06:26:30  robertj
00068  * Added fuction to get the current audio enable state for line in device.
00069  * Changed IxJ EnableAudio() semantics so is exclusive, no direct switching
00070  *   from PSTN to POTS and vice versa without disabling the old one first.
00071  *
00072  * Revision 1.44  2002/01/23 01:58:25  robertj
00073  * Added function to determine if codecs raw data channel is native format.
00074  *
00075  * Revision 1.43  2001/07/19 05:54:27  robertj
00076  * Updated interface to xJACK drivers to utilise cadence and filter functions
00077  *   for dial tone, busy tone and ringback tone detection.
00078  *
00079  * Revision 1.42  2001/05/22 00:31:41  robertj
00080  * Changed to allow optional wink detection for line disconnect
00081  *
00082  * Revision 1.41  2001/03/29 23:42:34  robertj
00083  * Added ability to get average signal level for both receive and transmit.
00084  * Changed silence detection to use G.723.1 SID frames as indicator of
00085  *   silence instead of using the average energy and adaptive threshold.
00086  *
00087  * Revision 1.40  2001/02/13 05:02:39  craigs
00088  * Extended PlayDTMF to allow generation of additional simple tones
00089  *
00090  * Revision 1.39  2001/02/09 05:16:24  robertj
00091  * Added #pragma interface for GNU C++.
00092  *
00093  * Revision 1.38  2001/01/25 07:27:14  robertj
00094  * Major changes to add more flexible OpalMediaFormat class to normalise
00095  *   all information about media types, especially codecs.
00096  *
00097  * Revision 1.37  2001/01/24 05:34:49  robertj
00098  * Altered volume control range to be percentage, ie 100 is max volume.
00099  *
00100  * Revision 1.36  2001/01/11 05:39:44  robertj
00101  * Fixed usage of G.723.1 CNG 1 byte frames.
00102  *
00103  * Revision 1.35  2000/12/19 06:38:57  robertj
00104  * Fixed missing virtual on IsTonePlaying() function.
00105  *
00106  * Revision 1.34  2000/12/17 22:08:20  craigs
00107  * Changed GetCountryCodeList to return PStringList
00108  *
00109  * Revision 1.33  2000/12/11 01:23:32  craigs
00110  * Added extra routines to allow country string manipulation
00111  *
00112  * Revision 1.32  2000/11/30 08:48:35  robertj
00113  * Added functions to enable/disable Voice Activity Detection in LID's
00114  *
00115  * Revision 1.31  2000/11/26 23:12:18  craigs
00116  * Added hook flash detection API
00117  *
00118  * Revision 1.30  2000/11/24 10:46:12  robertj
00119  * Added a raw PCM dta mode for generating/detecting standard tones.
00120  * Modified the ReadFrame/WriteFrame functions to allow for variable length codecs.
00121  *
00122  * Revision 1.29  2000/11/20 03:15:13  craigs
00123  * Changed tone detection API slightly to allow detection of multiple
00124  * simultaneous tones
00125  * Added fax CNG tone to tone list
00126  *
00127  * Revision 1.28  2000/11/06 02:00:18  eokerson
00128  * Added support for AGC on ixj devices under Linux.
00129  *
00130  * Revision 1.27  2000/11/03 06:22:48  robertj
00131  * Added flag to IsLinePresent() to force slow test, guarenteeing correct value.
00132  *
00133  * Revision 1.26  2000/10/13 02:24:06  robertj
00134  * Moved frame reblocking code from LID channel to LID itself and added
00135  *    ReadBlock/WriteBlock functions to allow non integral frame sizes.
00136  *
00137  * Revision 1.25  2000/09/25 22:31:19  craigs
00138  * Added G.723.1 frame erasure capability
00139  *
00140  * Revision 1.24  2000/09/23 07:20:28  robertj
00141  * Fixed problem with being able to distinguish between sw and hw codecs in LID channel.
00142  *
00143  * Revision 1.23  2000/09/22 01:35:03  robertj
00144  * Added support for handling LID's that only do symmetric codecs.
00145  *
00146  * Revision 1.22  2000/08/31 13:14:40  craigs
00147  * Added functions to LID
00148  * More bulletproofing to Linux driver
00149  *
00150  * Revision 1.21  2000/08/30 23:24:24  robertj
00151  * Renamed string version of SetCountrCode() to SetCountryCodeName() to avoid
00152  *    C++ masking ancestor overloaded function when overriding numeric version.
00153  *
00154  * Revision 1.20  2000/08/18 04:17:48  robertj
00155  * Added Auto setting to AEC enum.
00156  *
00157  * Revision 1.19  2000/06/19 00:32:13  robertj
00158  * Changed functionf or adding all lid capabilities to not assume it is to an endpoint.
00159  *
00160  * Revision 1.18  2000/06/01 07:52:19  robertj
00161  * Changed some LID capability code back again so does not unneedfully break existing API.
00162  *
00163  * Revision 1.17  2000/05/30 10:19:17  robertj
00164  * Added function to add capabilities given a LID.
00165  * Improved LID capabilities so cannot create one that is not explicitly supported.
00166  *
00167  * Revision 1.16  2000/05/24 06:42:18  craigs
00168  * Added calls to get volume settings
00169  *
00170  * Revision 1.15  2000/05/10 04:05:26  robertj
00171  * Changed capabilities so has a function to get name of codec, instead of relying on PrintOn.
00172  *
00173  * Revision 1.14  2000/05/02 04:32:24  robertj
00174  * Fixed copyright notice comment.
00175  *
00176  * Revision 1.13  2000/04/14 17:18:25  robertj
00177  * Fixed problem with error reporting from LID hardware.
00178  *
00179  * Revision 1.12  2000/04/10 17:44:52  robertj
00180  * Added higher level "DialOut" function for PSTN lines.
00181  * Added hook flash function.
00182  *
00183  * Revision 1.11  2000/04/05 18:04:12  robertj
00184  * Changed caller ID code for better portability.
00185  *
00186  * Revision 1.10  2000/03/30 23:10:50  robertj
00187  * Fixed error in comments regarding GetFramerate() function.
00188  *
00189  * Revision 1.9  2000/03/29 20:54:19  robertj
00190  * Added function on LID to get available codecs.
00191  * Changed codec to use number of frames rather than number of bytes.
00192  *
00193  * Revision 1.8  2000/03/23 23:36:48  robertj
00194  * Added more calling tone detection functionality.
00195  *
00196  * Revision 1.7  2000/03/23 02:43:15  robertj
00197  * Fixed default DTMF timing.
00198  *
00199  * Revision 1.6  2000/03/22 17:18:49  robertj
00200  * Changed default DTMF tone string times.
00201  *
00202  * Revision 1.5  2000/03/21 03:06:48  robertj
00203  * Changes to make RTP TX of exact numbers of frames in some codecs.
00204  *
00205  * Revision 1.4  2000/01/13 12:39:29  robertj
00206  * Added string based country codes to LID.
00207  *
00208  * Revision 1.3  2000/01/13 04:03:45  robertj
00209  * Added video transmission
00210  *
00211  * Revision 1.2  2000/01/07 08:28:09  robertj
00212  * Additions and changes to line interface device base class.
00213  *
00214  * Revision 1.1  1999/12/23 23:02:35  robertj
00215  * File reorganision for separating RTP from H.323 and creation of LID for VPB support.
00216  *
00217  */
00218 
00219 #ifndef __OPAL_LID_H
00220 #define __OPAL_LID_H
00221 
00222 #ifdef P_USE_PRAGMA
00223 #pragma interface
00224 #endif
00225 
00226 
00227 #include "codecs.h"
00228 #include "h323caps.h"
00229 
00230 
00232 
00236 class OpalLineInterfaceDevice : public PObject
00237 {
00238   PCLASSINFO(OpalLineInterfaceDevice, PObject);
00239 
00240   public:
00243     OpalLineInterfaceDevice();
00244 
00247     virtual BOOL Open(
00248       const PString & device      
00249     ) = 0;
00250 
00253     virtual BOOL IsOpen() const;
00254 
00257     virtual BOOL Close();
00258 
00264     virtual PString GetName() const = 0;
00265 
00268     virtual unsigned GetLineCount() = 0;
00269 
00276     virtual BOOL IsLineTerminal(
00277       unsigned line   
00278     );
00279 
00280 
00283     virtual BOOL IsLinePresent(
00284       unsigned line,      
00285       BOOL force = FALSE  
00286     );
00287 
00288 
00294     virtual BOOL IsLineOffHook(
00295       unsigned line   
00296     ) = 0;
00297 
00303     virtual BOOL SetLineOffHook(
00304       unsigned line,        
00305       BOOL newState = TRUE  
00306     ) = 0;
00307 
00311     virtual BOOL SetLineOnHook(
00312       unsigned line        
00313     ) { return SetLineOffHook(line, FALSE); }
00314 
00318     virtual BOOL HookFlash(
00319       unsigned line,              
00320       unsigned flashTime = 200    
00321     );
00322 
00325     virtual BOOL HasHookFlash(unsigned line);
00326 
00327 
00338     virtual BOOL IsLineRinging(
00339       unsigned line,          
00340       DWORD * cadence = NULL  
00341     );
00342 
00353     virtual BOOL RingLine(
00354       unsigned line,    
00355       DWORD cadence     
00356     );
00357 
00372     virtual BOOL RingLine(
00373       unsigned line,     
00374       PINDEX nCadence,   
00375       unsigned * pattern 
00376     );
00377 
00378 
00382     virtual BOOL IsLineDisconnected(
00383       unsigned line,   
00384       BOOL checkForWink = TRUE
00385     );
00386 
00387 
00390     virtual BOOL SetLineToLineDirect(
00391       unsigned line1,   
00392       unsigned line2,   
00393       BOOL connect      
00394     );
00395 
00398     virtual BOOL IsLineToLineDirect(
00399       unsigned line1,   
00400       unsigned line2    
00401     );
00402 
00403 
00406     virtual OpalMediaFormat::List GetMediaFormats() const = 0;
00407 
00410     virtual BOOL SetReadFormat(
00411       unsigned line,    
00412       const OpalMediaFormat & mediaFormat   
00413     ) = 0;
00414 
00417     virtual BOOL SetWriteFormat(
00418       unsigned line,    
00419       const OpalMediaFormat & mediaFormat   
00420     ) = 0;
00421 
00424     virtual OpalMediaFormat GetReadFormat(
00425       unsigned line    
00426     ) = 0;
00427 
00430     virtual OpalMediaFormat GetWriteFormat(
00431       unsigned line    
00432     ) = 0;
00433 
00442     virtual BOOL SetReadCodec(
00443       unsigned line,    
00444       RTP_DataFrame::PayloadTypes codec   
00445     );
00446 
00452     virtual BOOL SetWriteCodec(
00453       unsigned line,    
00454       RTP_DataFrame::PayloadTypes codec   
00455     );
00456 
00467     virtual BOOL SetRawCodec(
00468       unsigned line    
00469     );
00470 
00473     virtual BOOL StopReadCodec(
00474       unsigned line   
00475     );
00476 
00479     virtual BOOL StopWriteCodec(
00480       unsigned line   
00481     );
00482 
00485     virtual BOOL StopRawCodec(
00486       unsigned line   
00487     );
00488 
00493     virtual BOOL SetReadFrameSize(
00494       unsigned line,    
00495       PINDEX frameSize  
00496     );
00497 
00502     virtual BOOL SetWriteFrameSize(
00503       unsigned line,    
00504       PINDEX frameSize  
00505     );
00506 
00510     virtual PINDEX GetReadFrameSize(
00511       unsigned line   
00512     ) = 0;
00513 
00517     virtual PINDEX GetWriteFrameSize(
00518       unsigned line   
00519     ) = 0;
00520 
00523     virtual BOOL ReadFrame(
00524       unsigned line,    
00525       void * buf,       
00526       PINDEX & count    
00527     ) = 0;
00528 
00531     virtual BOOL WriteFrame(
00532       unsigned line,    
00533       const void * buf, 
00534       PINDEX count,     
00535       PINDEX & written  
00536     ) = 0;
00537 
00541     virtual BOOL ReadBlock(
00542       unsigned line,    
00543       void * buf,   
00544       PINDEX count  
00545     );
00546 
00549     virtual BOOL WriteBlock(
00550       unsigned line,    
00551       const void * buf, 
00552       PINDEX count      
00553     );
00554 
00555 
00558     virtual unsigned GetAverageSignalLevel(
00559       unsigned line,  
00560       BOOL playback   
00561     );
00562 
00563 
00566     virtual BOOL EnableAudio(
00567       unsigned line,      
00568       BOOL enable = TRUE
00569     );
00570 
00573     BOOL DisableAudio(
00574       unsigned line   
00575     ) { return EnableAudio(line, FALSE); }
00576 
00579     virtual BOOL IsAudioEnabled(
00580       unsigned line      
00581     );
00582 
00583 
00584     enum {
00585       MaxVolume = 100
00586     };
00587 
00592     virtual BOOL SetRecordVolume(
00593       unsigned line,    
00594       unsigned volume   
00595     );
00596 
00601     virtual BOOL SetPlayVolume(
00602       unsigned line,    
00603       unsigned volume   
00604     );
00605 
00610     virtual BOOL GetRecordVolume(
00611       unsigned line,      
00612       unsigned & volume   
00613     );
00614 
00619     virtual BOOL GetPlayVolume(
00620       unsigned line,      
00621       unsigned & volume   
00622     );
00623 
00624 
00625     enum AECLevels {
00626       AECOff,
00627       AECLow,
00628       AECMedium,
00629       AECHigh,
00630       AECAuto,
00631       AECAGC,
00632       AECError
00633     };
00634 
00638     virtual AECLevels GetAEC(
00639       unsigned line    
00640     );
00641 
00645     virtual BOOL SetAEC(
00646       unsigned line,    
00647       AECLevels level   
00648     );
00649 
00653     virtual unsigned GetWinkDuration(
00654       unsigned line    
00655     );
00656 
00660     virtual BOOL SetWinkDuration(
00661       unsigned line,        
00662       unsigned winkDuration 
00663     );
00664 
00668     virtual BOOL GetVAD(
00669       unsigned line    
00670     );
00671 
00675     virtual BOOL SetVAD(
00676       unsigned line,    
00677       BOOL enable       
00678     );
00679 
00680 
00688     virtual BOOL GetCallerID(
00689       unsigned line,      
00690       PString & idString, 
00691       BOOL full = FALSE   
00692     );
00693 
00702     virtual BOOL SetCallerID(
00703       unsigned line,            
00704       const PString & idString  
00705     );
00706 
00715     virtual BOOL SendCallerIDOnCallWaiting(
00716       unsigned line,            
00717       const PString & idString  
00718     );
00719 
00722     virtual BOOL SendVisualMessageWaitingIndicator(
00723       unsigned line,            
00724       BOOL on
00725     );
00726 
00727 
00728     enum {
00729       DefaultDTMFOnTime = 180,
00730       DefaultDTMFOffTime = 120
00731     };
00732 
00736     virtual BOOL PlayDTMF(
00737       unsigned line,            
00738       const char * digits,      
00739       DWORD onTime = DefaultDTMFOnTime,  
00740       DWORD offTime = DefaultDTMFOffTime 
00741     );
00742 
00752     virtual char ReadDTMF(
00753       unsigned line   
00754     );
00755 
00760     virtual BOOL GetRemoveDTMF(
00761       unsigned line   
00762     );
00763 
00768     virtual BOOL SetRemoveDTMF(
00769       unsigned line,     
00770       BOOL removeTones   
00771     );
00772 
00773 
00774     enum CallProgressTones {
00775       NoTone    = 0x00,   // indicates no tones
00776       DialTone  = 0x01,   // Dial tone
00777       RingTone  = 0x02,   // Ring indication tone
00778       BusyTone  = 0x04,   // Line engaged tone
00779       ClearTone = 0x08,   // Call failed/cleared tone (often same as busy tone)
00780       CNGTone   = 0x10,   // Fax CNG tone
00781       AllTones  = 0x1f
00782     };
00783 
00786     virtual unsigned IsToneDetected(
00787       unsigned line   
00788     );
00789 
00792     virtual unsigned WaitForToneDetect(
00793       unsigned line,          
00794       unsigned timeout = 3000 
00795     );
00796 
00799     virtual BOOL WaitForTone(
00800       unsigned line,          
00801       CallProgressTones tone, 
00802       unsigned timeout = 3000 
00803     );
00804 
00822     virtual BOOL SetToneFilter(
00823       unsigned line,              
00824       CallProgressTones tone,     
00825       const PString & description 
00826     );
00827 
00830     virtual BOOL SetToneFilterParameters(
00831       unsigned line,            
00832       CallProgressTones tone,   
00833       unsigned lowFrequency,    
00834       unsigned highFrequency,   
00835       PINDEX numCadences,       
00836       const unsigned * onTimes, 
00837       const unsigned * offTimes 
00838     );
00839 
00842     virtual BOOL PlayTone(
00843       unsigned line,          
00844       CallProgressTones tone  
00845     );
00846 
00849     virtual BOOL IsTonePlaying(
00850       unsigned line   
00851     );
00852 
00855     virtual BOOL StopTone(
00856       unsigned line   
00857     );
00858 
00861     virtual BOOL PlayAudio(
00862       unsigned line,            
00863       const PString & filename  
00864     );
00865     
00868     virtual BOOL StopAudio(
00869       unsigned line   
00870     );
00871 
00872 
00888     virtual CallProgressTones DialOut(
00889       unsigned line,                
00890       const PString & number,       
00891       BOOL requireTones = FALSE     
00892     );
00893 
00894 
00895     enum T35CountryCodes {
00896       Japan, Albania, Algeria, AmericanSamoa, Germany, Anguilla, AntiguaAndBarbuda,
00897       Argentina, Ascension, Australia, Austria, Bahamas, Bahrain, Bangladesh,
00898       Barbados, Belgium, Belize, Benin, Bermudas, Bhutan, Bolivia, Botswana,
00899       Brazil, BritishAntarcticTerritory, BritishIndianOceanTerritory, 
00900       BritishVirginIslands, BruneiDarussalam, Bulgaria, Myanmar, Burundi,
00901       Byelorussia, Cameroon, Canada, CapeVerde, CaymanIslands,
00902       CentralAfricanRepublic, Chad, Chile, China, Colombia, Comoros, Congo,
00903       CookIslands, CostaRica, Cuba, Cyprus, Czechoslovakia, Cambodia,
00904       DemocraticPeoplesRepublicOfKorea, Denmark, Djibouti, DominicanRepublic,
00905       Dominica, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Ethiopia,
00906       FalklandIslands, Fiji, Finland, France, FrenchPolynesia,
00907       FrenchSouthernAndAntarcticLands, Gabon, Gambia, Germany2, Angola, Ghana,
00908       Gibraltar, Greece, Grenada, Guam, Guatemala, Guernsey, Guinea, GuineaBissau,
00909       Guayana, Haiti, Honduras, Hongkong, Hungary, Iceland, India, Indonesia,
00910       Iran, Iraq, Ireland, Israel, Italy, CotedIvoire, Jamaica, Afghanistan,
00911       Jersey, Jordan, Kenya, Kiribati, KoreaRepublic, Kuwait, Lao, Lebanon,
00912       Lesotho, Liberia, Libya, Liechtenstein, Luxemborg, Macao, Madagascar,
00913       Malaysia, Malawi, Maldives, Mali, Malta, Mauritania, Mauritius, Mexico,
00914       Monaco, Mongolia, Montserrat, Morocco, Mozambique, Nauru, Nepal,
00915       Netherlands, NetherlandsAntilles, NewCaledonia, NewZealand, Nicaragua,
00916       Niger, Nigeria, Norway, Oman, Pakistan, Panama, PapuaNewGuinea, Paraguay,
00917       Peru, Philippines, Poland, Portugal, PuertoRico, Qatar, Romania, Rwanda,
00918       SaintKittsAndNevis, SaintCroix, SaintHelenaAndAscension, SaintLucia,
00919       SanMarino, SaintThomas, SaoTomeAndPrincipe, SaintVicentAndTheGrenadines,
00920       SaudiArabia, Senegal, Seychelles, SierraLeone, Singapore, SolomonIslands,
00921       Somalia, SouthAfrica, Spain, SriLanka, Sudan, Suriname, Swaziland, Sweden,
00922       Switzerland, Syria, Tanzania, Thailand, Togo, Tonga, TrinidadAndTobago,
00923       Tunisia, Turkey, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine,
00924       UnitedArabEmirates, UnitedKingdom, UnitedStates, BurkinaFaso, Uruguay,
00925       USSR, Vanuatu, VaticanCityState, Venezuela, VietNam, WallisAndFutuna,
00926       WesternSamoa, Yemen, Yemen2, Yugoslavia, Zaire, Zambia, Zimbabwe,
00927       NumCountryCodes,
00928       UnknownCountry = -1
00929     };
00930 
00933     T35CountryCodes GetCountryCode() const { return countryCode; }
00934 
00937     PString GetCountryCodeName() const;
00938 
00941     static PString GetCountryCodeName(T35CountryCodes code);
00942     static T35CountryCodes GetCountryCode(const PString & name);
00943 
00949     virtual BOOL SetCountryCode(
00950       T35CountryCodes country   
00951     );
00952 
00955     virtual BOOL SetCountryCodeName(
00956       const PString & countryName   
00957     );
00958 
00961     virtual PStringList GetCountryCodeNameList() const;
00962 
00963 
00966     int GetErrorNumber() const { return osError; }
00967 
00970     PString GetErrorText() const;
00971 
00972     virtual void PrintOn(
00973       ostream & strm
00974     ) const;
00975 
00976   protected:
00977     int             os_handle;
00978     int             osError;
00979     T35CountryCodes countryCode;
00980     PBYTEArray      readDeblockingBuffer, writeDeblockingBuffer;
00981     PINDEX          readDeblockingOffset, writeDeblockingOffset;
00982 
00983 #if PTRACING
00984     friend ostream & operator<<(ostream & o, CallProgressTones t);
00985 #endif
00986 };
00987 
00988 
00991 class OpalLineChannel : public PChannel
00992 {
00993   PCLASSINFO(OpalLineChannel, PChannel);
00994 
00995   public:
00998     OpalLineChannel(
00999       OpalLineInterfaceDevice & device, 
01000       unsigned line,                    
01001       const H323AudioCodec & codec      
01002     );
01003     ~OpalLineChannel();
01004 
01007     PString GetName() const;
01008 
01011     BOOL Close();
01012 
01025     virtual BOOL Read(
01026       void * buf,   
01027       PINDEX len    
01028     );
01029 
01041     virtual BOOL Write(
01042       const void * buf, 
01043       PINDEX len        
01044     );
01045 
01046 
01049     OpalLineInterfaceDevice & GetDevice() const { return device; }
01050 
01053     unsigned GetLineNumber() const { return lineNumber; }
01054 
01055 
01056   protected:
01057     OpalLineInterfaceDevice &   device;
01058     unsigned                    lineNumber;
01059     BOOL                        reading;
01060     BOOL                        useDeblocking;
01061 };
01062 
01063 
01064 
01065 
01066 
01069 class H323_LIDCapability : public H323AudioCapability
01070 {
01071   PCLASSINFO(H323_LIDCapability, H323AudioCapability);
01072 
01073   public:
01078     H323_LIDCapability(
01079       const OpalMediaFormat & mediaFormat   
01080     );
01082 
01087     Comparison Compare(const PObject & obj) const;
01088 
01091     virtual PObject * Clone() const;
01092 
01095     virtual PString GetFormatName() const;
01097 
01105     virtual unsigned GetSubType() const;
01107 
01112     virtual H323Codec * CreateCodec(
01113       H323Codec::Direction direction  
01114     ) const;
01115 
01118     BOOL IsValid() const;
01119 
01122     static void AddAllCapabilities(
01123       const OpalLineInterfaceDevice & device, 
01124       H323Capabilities & capabilities,        
01125       PINDEX descriptorNum,   
01126       PINDEX simultaneous     
01127     );
01129 
01139     virtual BOOL OnSendingPDU(
01140       H245_AudioCapability & pdu,  
01141       unsigned packetSize          
01142     ) const;
01143 
01151     virtual BOOL OnReceivedPDU(
01152       const H245_AudioCapability & pdu,  
01153       unsigned & packetSize              
01154     );
01156 
01157   protected:
01158     OpalMediaFormat mediaFormat;
01159     PINDEX codecTableIndex;
01160 };
01161 
01162 
01165 class H323_CiscoG7231aLIDCapability : public H323NonStandardAudioCapability
01166 {
01167   PCLASSINFO(H323_CiscoG7231aLIDCapability, H323NonStandardAudioCapability);
01168 
01169   public:
01174     H323_CiscoG7231aLIDCapability();
01176 
01181     virtual PObject * Clone() const;
01183 
01188     virtual H323Codec * CreateCodec(
01189       H323Codec::Direction direction  
01190     ) const;
01192 
01197     virtual PString GetFormatName() const;
01199 };
01200 
01201 
01205 class H323_LIDCodec : public H323AudioCodec
01206 {
01207   PCLASSINFO(H323_LIDCodec, H323AudioCodec);
01208 
01209   public:
01212     H323_LIDCodec(
01213       const char * mediaFormat,   
01214       Direction direction,        
01215       unsigned numFrames,         
01216       PINDEX codecTableIndex      
01217     );
01218 
01235     virtual BOOL Read(
01236       BYTE * buffer,            
01237       unsigned & length,        
01238       RTP_DataFrame & rtpFrame  
01239     );
01240 
01253     virtual BOOL Write(
01254       const BYTE * buffer,          
01255       unsigned length,              
01256       const RTP_DataFrame & frame,  
01257       unsigned & written            
01258     );
01259 
01266     virtual BOOL IsRawDataChannelNative() const;
01267 
01274     virtual BOOL DetectSilence();
01275 
01280     virtual unsigned GetAverageSignalLevel();
01281 
01282 
01283     PINDEX GetCodecTableIndex() const { return codecTableIndex; }
01284 
01285   protected:
01286     PINDEX codecTableIndex;
01287     unsigned packetSize;
01288     unsigned missedCount;
01289     BYTE     lastSID[4];
01290     BOOL     lastFrameWasSignal;
01291 };
01292 
01293 
01294 #endif // __OPAL_LID_H
01295 
01296 
01297 // End of File ///////////////////////////////////////////////////////////////

Generated on Sat Mar 5 14:59:10 2005 for OpenH323 by  doxygen 1.4.1