⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lid.cxx

📁 sloedgy open sip stack source code
💻 CXX
📖 第 1 页 / 共 4 页
字号:
/*
 * lid.cxx
 *
 * Line Interface Device
 *
 * Open Phone Abstraction Library
 *
 * Copyright (c) 1999-2000 Equivalence Pty. 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 H323 Library.
 *
 * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
 *
 * Contributor(s): ______________________________________.
 *
 * $Log: lid.cxx,v $
 * Revision 1.1  2006/06/26 03:03:21  joegenbaclor
 * I have decided to include the latest development realease  of OPAL tagged Deimos Devel 1 (June 8 2006) as inegrated classes to opensipstack to avoid future version conflicts due to the fast pace in OPAL development.   This move is also aimed to reduce the size of projects using OPAL componets such as the soon to be relased OpenSIPPhone.
 *
 * Revision 2.13  2004/10/06 13:03:41  rjongbloed
 * Added "configure" support for known LIDs
 * Changed LID GetName() function to be normalised against the GetAllNames()
 *   return values and fixed the pre-factory registration system.
 * Added a GetDescription() function to do what the previous GetName() did.
 *
 * Revision 2.12  2004/02/19 10:47:05  rjongbloed
 * Merged OpenH323 version 1.13.1 changes.
 *
 * Revision 2.11  2003/03/24 07:18:29  robertj
 * Added registration system for LIDs so can work with various LID types by
 *   name instead of class instance.
 *
 * Revision 2.10  2003/03/17 08:17:47  robertj
 * Removed redundant code to search for media format, use existing function.
 *
 * Revision 2.9  2003/01/07 04:39:53  robertj
 * Updated to OpenH323 v1.11.2
 *
 * Revision 2.8  2002/11/10 11:33:19  robertj
 * Updated to OpenH323 v1.10.3
 *
 * Revision 2.7  2002/09/04 06:01:49  robertj
 * Updated to OpenH323 v1.9.6
 *
 * Revision 2.6  2002/07/01 04:56:33  robertj
 * Updated to OpenH323 v1.9.1
 *
 * Revision 2.5  2002/02/11 09:32:13  robertj
 * Updated to openH323 v1.8.0
 *
 * Revision 2.4  2002/01/14 06:35:58  robertj
 * Updated to OpenH323 v1.7.9
 *
 * Revision 2.3  2001/10/05 00:22:14  robertj
 * Updated to PWLib 1.2.0 and OpenH323 1.7.0
 *
 * Revision 2.2  2001/08/13 05:10:40  robertj
 * Updates from OpenH323 v1.6.0 release.
 *
 * Revision 2.1  2001/08/01 05:21:21  robertj
 * Made OpalMediaFormatList class global to help with documentation.
 *
 * Revision 2.0  2001/07/27 15:48:25  robertj
 * Conversion of OpenH323 to Open Phone Abstraction Library (OPAL)
 *
 * Revision 1.98  2003/08/18 23:56:01  dereksmithies
 * Fix typos in previous commit.
 *
 * Revision 1.97  2003/08/18 22:13:13  dereksmithies
 * Add Singapore Ring Cadence. Thanks to Steve.
 *
 * Revision 1.96  2003/06/03 10:27:42  rjongbloed
 * Added G.729 and G,729B detection from LID.
 *
 * Revision 1.95  2003/04/29 08:30:29  robertj
 * Fixed return type of get wink function.
 *
 * Revision 1.94  2003/04/28 01:47:52  dereks
 * Add ability to set/get wink duration for ixj device.
 *
 * Revision 1.93  2003/03/05 06:26:44  robertj
 * Added function to play a WAV file to LID, thanks Pietro Ravasio
 *
 * Revision 1.92  2003/02/13 23:33:36  dereks
 * Fix reporting of tonenames.
 *
 * Revision 1.91  2003/01/29 23:58:17  dereks
 * Fix typo in United Kingdom tone definition.
 *
 * Revision 1.90  2002/12/02 03:06:26  robertj
 * Fixed over zealous removal of code when NO_AUDIO_CODECS set.
 *
 * Revision 1.89  2002/11/05 04:27:12  robertj
 * Imported RingLine() by array from OPAL.
 *
 * Revision 1.88  2002/10/30 05:54:17  craigs
 * Fixed compatibilty problems with G.723.1 6k3 and 5k3
 *
 * Revision 1.87  2002/08/05 10:03:48  robertj
 * Cosmetic changes to normalise the usage of pragma interface/implementation.
 *
 * Revision 1.86  2002/07/01 02:56:17  dereks
 * Add PTRACE statements to  "IsToneDetected"
 *
 * Revision 1.85  2002/06/27 08:52:57  robertj
 * Fixed typo and naming convention for Cisco G.723.1 annex A capability.
 *
 * Revision 1.84  2002/06/26 05:45:45  robertj
 * Added capability for Cisco IOS non-standard name for G.723.1 Annex A so
 *   can now utilise SID frames with Cisco gateways.
 *
 * Revision 1.83  2002/06/25 08:30:13  robertj
 * Changes to differentiate between stright G.723.1 and G.723.1 Annex A using
 *   the OLC dataType silenceSuppression field so does not send SID frames
 *   to receiver codecs that do not understand them.
 *
 * Revision 1.82  2002/05/09 06:26:34  robertj
 * Added fuction to get the current audio enable state for line in device.
 * Changed IxJ EnableAudio() semantics so is exclusive, no direct switching
 *   from PSTN to POTS and vice versa without disabling the old one first.
 *
 * Revision 1.81  2002/01/23 06:13:56  robertj
 * Added filter function hooks to codec raw data channel.
 *
 * Revision 1.80  2002/01/23 01:58:28  robertj
 * Added function to determine if codecs raw data channel is native format.
 *
 * Revision 1.79  2002/01/13 23:57:04  robertj
 * Added mutex so can change raw data channel while reading/writing from codec.
 *
 * Revision 1.78  2001/12/14 04:33:53  craigs
 * Disabled 5.3k codec due to problems with Quicknet cards
 *
 * Revision 1.77  2001/12/11 04:27:28  craigs
 * Added support for 5.3kbps G723.1
 *
 * Revision 1.76  2001/09/21 02:52:19  robertj
 * Implemented static object for all "known" media formats.
 *
 * Revision 1.75  2001/09/11 01:24:36  robertj
 * Added conditional compilation to remove video and/or audio codecs.
 *
 * Revision 1.74  2001/09/10 03:06:29  robertj
 * Major change to fix problem with error codes being corrupted in a
 *   PChannel when have simultaneous reads and writes in threads.
 *
 * Revision 1.73  2001/08/06 03:08:57  robertj
 * Fission of h323.h to h323ep.h & h323con.h, h323.h now just includes files.
 *
 * Revision 1.72  2001/07/24 02:28:22  robertj
 * Added setting of tone filters for a handful of countries.
 *
 * Revision 1.71  2001/07/20 04:06:18  robertj
 * Removed old Cisco hack code for G.728, they now do it rigth!
 *
 * Revision 1.70  2001/07/19 05:54:30  robertj
 * Updated interface to xJACK drivers to utilise cadence and filter functions
 *   for dial tone, busy tone and ringback tone detection.
 *
 * Revision 1.69  2001/05/30 03:56:57  robertj
 * Fixed initial value of read deblocking offset on stopping codec.
 *
 * Revision 1.68  2001/05/25 07:55:26  robertj
 * Fixed problem with trace output of tone bits, thanks Vjacheslav Andrejev.
 *
 * Revision 1.67  2001/05/25 02:19:53  robertj
 * Fixed problem with codec data reblocking code not being reset when
 *   code is stopped and restarted, thanks Artis Kugevics
 *
 * Revision 1.66  2001/05/22 00:31:43  robertj
 * Changed to allow optional wink detection for line disconnect
 *
 * Revision 1.65  2001/05/14 05:56:28  robertj
 * Added H323 capability registration system so can add capabilities by
 *   string name instead of having to instantiate explicit classes.
 *
 * Revision 1.64  2001/05/11 04:43:43  robertj
 * Added variable names for standard PCM-16 media format name.
 *
 * Revision 1.63  2001/04/03 23:37:48  craigs
 * Added extra logging of country change functions
 *
 * Revision 1.62  2001/03/29 23:43:02  robertj
 * Added ability to get average signal level for both receive and transmit.
 * Changed silence detection to use G.723.1 SID frames as indicator of
 *   silence instead of using the average energy and adaptive threshold.
 *
 * Revision 1.61  2001/03/23 05:38:30  robertj
 * Added PTRACE_IF to output trace if a conditional is TRUE.
 *
 * Revision 1.60  2001/02/09 05:36:38  craigs
 * Added pragma implementation
 *
 * Revision 1.59  2001/01/28 06:29:55  yurik
 * WinCE-port - lid.h exists in SDK so we point to right one
 *
 * Revision 1.58  2001/01/25 07:27:16  robertj
 * Major changes to add more flexible OpalMediaFormat class to normalise
 *   all information about media types, especially codecs.
 *
 * Revision 1.57  2001/01/11 06:24:55  robertj
 * Fixed incorrect value for CNG frame
 *
 * Revision 1.56  2001/01/11 05:39:44  robertj
 * Fixed usage of G.723.1 CNG 1 byte frames.
 *
 * Revision 1.55  2001/01/11 03:51:14  robertj
 * Fixed bug in WriteBlock() flush, use actual frame size for last write.
 *
 * Revision 1.54  2001/01/04 06:39:51  robertj
 * Fixed bug in G.711 mode with xJACK cards if data is not a multiple of 10ms
 *    and some silence is transmitted, closes the logical channel.
 *
 * Revision 1.53  2000/12/17 22:08:20  craigs
 * Changed GetCountryCodeList to return PStringList
 *
 * Revision 1.52  2000/12/11 01:23:32  craigs
 * Added extra routines to allow country string manipulation
 *
 * Revision 1.51  2000/12/04 00:04:21  robertj
 * Changed G.711 "silence" to be 0xff to remove clicks from Quicknet cards,
 *
 * Revision 1.50  2000/11/30 08:48:36  robertj
 * Added functions to enable/disable Voice Activity Detection in LID's
 *
 * Revision 1.49  2000/11/30 03:12:00  robertj
 * Fixed bug in not resetting buffer offset on buffer flush.
 *
 * Revision 1.48  2000/11/29 22:08:31  craigs
 * Fixed problem with using WaitForToneDetect with 0 timeout
 *
 * Revision 1.47  2000/11/27 05:19:27  robertj
 * Fixed MSVC warning
 *
 * Revision 1.46  2000/11/27 00:19:39  robertj
 * Fixed bug in SetRawCodec, conditional around the wrong way
 *
 * Revision 1.45  2000/11/26 23:12:18  craigs
 * Added hook flash detection API
 *
 * Revision 1.44  2000/11/24 10:56:12  robertj
 * Added a raw PCM dta mode for generating/detecting standard tones.
 * Modified the ReadFrame/WriteFrame functions to allow for variable length codecs.
 *
 * Revision 1.43  2000/11/20 03:15:13  craigs
 * Changed tone detection API slightly to allow detection of multiple
 * simultaneous tones
 * Added fax CNG tone to tone list
 *
 * Revision 1.42  2000/11/03 06:25:37  robertj
 * Added flag to IsLinePresent() to force slow test, guarenteeing correct value.
 *
 * Revision 1.41  2000/10/31 03:21:02  robertj
 * Fixed bug that caused G.711 transmitter to continuously think there was silence.
 *
 * Revision 1.40  2000/10/16 09:45:10  robertj
 * Fixed recently introduced bug, caused artifacts when should be silent G.723.1
 *
 * Revision 1.39  2000/10/13 02:24:06  robertj
 * Moved frame reblocking code from LID channel to LID itself and added
 *    ReadBlock/WriteBlock functions to allow non integral frame sizes.
 *
 * Revision 1.38  2000/09/25 22:31:18  craigs
 * Added G.723.1 frame erasure capability
 *
 * Revision 1.37  2000/09/23 07:20:45  robertj
 * Fixed problem with being able to distinguish between sw and hw codecs in LID channel.
 *
 * Revision 1.36  2000/09/22 01:35:51  robertj
 * Added support for handling LID's that only do symmetric codecs.
 *
 * Revision 1.35  2000/09/01 00:15:21  robertj
 * Improved country code selection, can use 2 letter ISO codes or
 *    international dialling prefixes (with leading +) to select country.
 *
 * Revision 1.34  2000/08/31 13:14:40  craigs
 * Added functions to LID
 * More bulletproofing to Linux driver
 *
 * Revision 1.33  2000/08/30 23:24:36  robertj
 * Renamed string version of SetCountrCode() to SetCountryCodeName() to avoid
 *    C++ masking ancestor overloaded function when overriding numeric version.
 *
 * Revision 1.32  2000/07/13 16:03:25  robertj
 * Removed transmission of 1 byte repeat CNG frames in G.723.1 as it crashes other peoples stacks.
 *
 * Revision 1.31  2000/07/12 10:25:37  robertj
 * Renamed all codecs so obvious whether software or hardware.
 *
 * Revision 1.30  2000/07/09 15:23:00  robertj
 * Changed G.728 not to use Cisco hack. Cisco is just wrong!
 * Fixed output of silence in G.711 so works with any sized frame.
 *
 * Revision 1.29  2000/07/02 14:09:49  craigs
 * Fill uLaw and aLaw silence with 0x80 rather than 0x00
 *
 * Revision 1.28  2000/06/19 00:32:22  robertj
 * Changed functionf or adding all lid capabilities to not assume it is to an endpoint.
 *
 * Revision 1.27  2000/06/01 07:52:30  robertj
 * Changed some LID capability code back again so does not unneedfully break existing API.
 *
 * Revision 1.26  2000/05/30 10:19:28  robertj
 * Added function to add capabilities given a LID.
 * Improved LID capabilities so cannot create one that is not explicitly supported.
 *
 * Revision 1.25  2000/05/24 06:43:16  craigs
 * Added routines to get xJack volume
 * Fixed problem with receiving G>723.1 NULL frames
 *
 * Revision 1.24  2000/05/11 03:47:48  craigs
 * Added extra debugging
 *
 * Revision 1.23  2000/05/10 04:05:34  robertj
 * Changed capabilities so has a function to get name of codec, instead of relying on PrintOn.
 *
 * Revision 1.22  2000/05/04 12:56:43  robertj
 * Fixed GNU warning.
 *
 * Revision 1.21  2000/05/04 11:52:35  robertj
 * Added Packets Too Late statistics, requiring major rearrangement of jitter
 *    buffer code, not also changes semantics of codec Write() function slightly.
 *
 * Revision 1.20  2000/05/02 04:32:27  robertj
 * Fixed copyright notice comment.
 *
 * Revision 1.19  2000/04/30 03:57:14  robertj
 * Added PTRACE of read/write frame sizes required by LID.
 *
 * Revision 1.18  2000/04/19 02:04:30  robertj
 * BeOS port changes.
 *
 * Revision 1.17  2000/04/14 17:18:07  robertj
 * Fixed problem with error reporting from LID hardware.
 *
 * Revision 1.16  2000/04/10 17:45:11  robertj
 * Added higher level "DialOut" function for PSTN lines.
 * Added hook flash function.
 *
 * Revision 1.15  2000/04/05 18:04:12  robertj
 * Changed caller ID code for better portability.
 *
 * Revision 1.14  2000/04/03 19:25:14  robertj
 * Optimised G.711 codec to read/write larger chunks of data.
 *
 * Revision 1.13  2000/03/31 19:50:51  robertj
 * Fixed receiver loop being able to deal with RTP packets smaller than expected.
 *
 * Revision 1.12  2000/03/30 19:32:35  robertj
 * Added swab function which seems to be missing on Linux.
 *
 * Revision 1.11  2000/03/30 01:57:16  robertj

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -