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

📄 lid.h

📁 radius协议源码÷The Radius Stack will connect to a Radius Server. This stack implementation is built upo
💻 H
📖 第 1 页 / 共 2 页
字号:
/* * lid.h * * 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. * * Portions of this code were written with the assisance of funding from  * Quicknet Technologies, Inc. http://www.quicknet.net. *  * Contributor(s): ______________________________________. * * $Log: lid.h,v $ * Revision 1.19  2000/06/19 00:32:13  robertj * Changed functionf or adding all lid capabilities to not assume it is to an endpoint. * * Revision 1.18  2000/06/01 07:52:19  robertj * Changed some LID capability code back again so does not unneedfully break existing API. * * Revision 1.17  2000/05/30 10:19:17  robertj * Added function to add capabilities given a LID. * Improved LID capabilities so cannot create one that is not explicitly supported. * * Revision 1.16  2000/05/24 06:42:18  craigs * Added calls to get volume settings * * Revision 1.15  2000/05/10 04:05:26  robertj * Changed capabilities so has a function to get name of codec, instead of relying on PrintOn. * * Revision 1.14  2000/05/02 04:32:24  robertj * Fixed copyright notice comment. * * Revision 1.13  2000/04/14 17:18:25  robertj * Fixed problem with error reporting from LID hardware. * * Revision 1.12  2000/04/10 17:44:52  robertj * Added higher level "DialOut" function for PSTN lines. * Added hook flash function. * * Revision 1.11  2000/04/05 18:04:12  robertj * Changed caller ID code for better portability. * * Revision 1.10  2000/03/30 23:10:50  robertj * Fixed error in comments regarding GetFramerate() function. * * Revision 1.9  2000/03/29 20:54:19  robertj * Added function on LID to get available codecs. * Changed codec to use number of frames rather than number of bytes. * * Revision 1.8  2000/03/23 23:36:48  robertj * Added more calling tone detection functionality. * * Revision 1.7  2000/03/23 02:43:15  robertj * Fixed default DTMF timing. * * Revision 1.6  2000/03/22 17:18:49  robertj * Changed default DTMF tone string times. * * Revision 1.5  2000/03/21 03:06:48  robertj * Changes to make RTP TX of exact numbers of frames in some codecs. * * Revision 1.4  2000/01/13 12:39:29  robertj * Added string based country codes to LID. * * Revision 1.3  2000/01/13 04:03:45  robertj * Added video transmission * * Revision 1.2  2000/01/07 08:28:09  robertj * Additions and changes to line interface device base class. * * Revision 1.1  1999/12/23 23:02:35  robertj * File reorganision for separating RTP from H.323 and creation of LID for VPB support. * */#ifndef __LID_H#define __LID_H#include "rtp.h"#include "codecs.h"#include "h323caps.h"/** Line Interface Device abstraction.    Note all functions in this device abstraction are assumed to be thread atomic. */class OpalLineInterfaceDevice : public PObject{  PCLASSINFO(OpalLineInterfaceDevice, PObject);  public:    /**Construct a new line interface device.      */    OpalLineInterfaceDevice();    /**Open the line interface device.      */    virtual BOOL Open(      const PString & device      /// Device identifier name.    ) = 0;    /**Determine if the line interface device is open.      */    virtual BOOL IsOpen() const;    /**Close the line interface device.      */    virtual BOOL Close();    /**Determine the type of line interface device.       This is a string indication of the card type for user interface       display purposes or device specific control. The device should be       as detailed as possible eg "Quicknet LineJACK".      */    virtual PString GetName() const = 0;    /**Get the total number of lines supported by this device.      */    virtual unsigned GetLineCount() = 0;    /**Get the type of the line.       A "terminal" line is one where a call may terminate. For example a POTS       line with a standard telephone handset on it would be a terminal line.       The alternative is a "network" line, that is one connected to switched       network eg the standard PSTN.      */    virtual BOOL IsLineTerminal(      unsigned line   /// Number of line    );    /**Determine if a physical line is present on the logical line.      */    virtual BOOL IsLinePresent(      unsigned line   /// Number of line    );    /**Determine if line is currently off hook.       This function implies that the state is debounced and that a return       value of TRUE indicates that the phone is really off hook. That is       hook flashes and winks are masked out.      */    virtual BOOL IsLineOffHook(      unsigned line   /// Number of line    ) = 0;    /**Set the hook state of the line.       Note that not be possible on a given line, for example a POTS line with       a standard telephone handset. The hook state is determined by external       hardware and cannot be changed by the software.      */    virtual BOOL SetLineOffHook(      unsigned line,        /// Number of line      BOOL newState = TRUE  /// New state to set    ) = 0;    /**Set the hook state of the line.       This is the complement of SetLineOffHook().      */    virtual BOOL SetLineOnHook(      unsigned line        /// Number of line    ) { return SetLineOffHook(line, FALSE); }    /**Set the hook state off then straight back on again.       This will only operate if the line is currently off hook.      */    virtual BOOL HookFlash(      unsigned line,              /// Number of line      unsigned flashTime = 200    /// Time for hook flash in milliseconds    );    /**Determine if line is ringing.       This function implies that the state is "debounced" and that a return       value of TRUE indicates that the phone is still ringing and it is not       simply a pause in the ring cadence.       If cadence is not NULL then it is set with the bit pattern for the       incoming ringing. Note that in this case the funtion may take a full       sequence to return. If it is NULL it can be assumed that the function       will return quickly.      */    virtual BOOL IsLineRinging(      unsigned line,          /// Number of line      DWORD * cadence = NULL  /// Cadence of incoming ring    );    /**Begin ringing local phone set with specified cadence.       If cadence is zero then stops ringing.       Note that not be possible on a given line, for example on a PSTN line       the ring state is determined by external hardware and cannot be       changed by the software.       Also note that the cadence may be ignored by particular hardware driver       so that only the zero or non-zero values are significant.      */    virtual BOOL RingLine(      unsigned line,    /// Number of line      DWORD cadence     /// Cadence bit map for ring pattern    );    /**Determine if line has been disconnected from a call.       This uses the hardware (and country) dependent means for determining      */    virtual BOOL IsLineDisconnected(      unsigned line   /// Number of line    );    /**Directly connect the two lines.      */    virtual BOOL SetLineToLineDirect(      unsigned line1,   /// Number of first line      unsigned line2,   /// Number of second line      BOOL connect      /// Flag for connect/disconnect    );    /**Determine if the two lines are directly connected.      */    virtual BOOL IsLineToLineDirect(      unsigned line1,   /// Number of first line      unsigned line2    /// Number of second line    );    /**Get the data formats this device is capable of using.       The default behaviour returns a single entry for Linear 16 PCM.      */    virtual PIntArray GetPayloadTypes() const;    /**Set the line codec for reading.      */    virtual BOOL SetReadCodec(      unsigned line,    /// Number of line      RTP_DataFrame::PayloadTypes codec   /// Codec type    );    /**Set the line  codec for writing.      */    virtual BOOL SetWriteCodec(      unsigned line,    /// Number of line      RTP_DataFrame::PayloadTypes codec   /// Codec type    );    /**Stop the read codec.      */    virtual BOOL StopReadCodec(      unsigned line   /// Number of line    );    /**Stop the write codec.      */    virtual BOOL StopWriteCodec(      unsigned line   /// Number of line    );    /**Set the read frame size in bytes.       Note that a LID may ignore this value so always use GetReadFrameSize()       for I/O.      */    virtual BOOL SetReadFrameSize(      unsigned line,    /// Number of line      PINDEX frameSize  /// New frame size    );    /**Set the write frame size in bytes.       Note that a LID may ignore this value so always use GetReadFrameSize()       for I/O.      */    virtual PINDEX SetWriteFrameSize(      unsigned line,    /// Number of line      PINDEX frameSize  /// New frame size    );    /**Get the read frame size in bytes.       All calls to ReadFrame() will return this number of bytes.      */    virtual PINDEX GetReadFrameSize(      unsigned line   /// Number of line    ) = 0;    /**Get the write frame size in bytes.       All calls to WriteFrame() must be this number of bytes.      */    virtual PINDEX GetWriteFrameSize(      unsigned line   /// Number of line    ) = 0;    /**Low level read of a frame from the device.     */    virtual BOOL ReadFrame(      unsigned line,    /// Number of line      void * buf   /// Pointer to a block of memory to receive the read bytes.    ) = 0;    /**Low level write frame to the device.     */    virtual BOOL WriteFrame(      unsigned line,    /// Number of line      const void * buf /// Pointer to a block of memory to write.    ) = 0;    /**Get average signal level in last frame.      */    virtual unsigned GetAverageSignalLevel(      unsigned line   /// Number of line    );    /**Enable audio for the line.      */    virtual BOOL EnableAudio(      unsigned line,      /// Number of line      BOOL enable = TRUE    );    /**Disable audio for the line.      */    BOOL DisableAudio(      unsigned line   /// Number of line    ) { return EnableAudio(line, FALSE); }    enum {      MaxVolume = 0x100    };    /**Set volume level for recording.      */    virtual BOOL SetRecordVolume(      unsigned line,    /// Number of line      unsigned volume   /// Volume level from 0 to 0x100    );    /**Set volume level for playing.      */    virtual BOOL SetPlayVolume(      unsigned line,    /// Number of line      unsigned volume   /// Volume level from 0 to 0x100    );    /**Get volume level for recording.      */    virtual BOOL GetRecordVolume(      unsigned line,      /// Number of line      unsigned & volume   /// Volume level from 0 to 0x100    );    /**Set volume level for playing.      */    virtual BOOL GetPlayVolume(      unsigned line,      /// Number of line      unsigned & volume   /// Volume level from 0 to 0x100    );    enum AECLevels {      AECOff,      AECLow,      AECMedium,      AECHigh,      AECError    };    /**Set acoustic echo cancellation.      */    virtual AECLevels GetAEC(      unsigned line    /// Number of line    );    /**Set acoustic echo cancellation.      */    virtual BOOL SetAEC(      unsigned line,    /// Number of line      AECLevels level  /// AEC level    );    /**Get Caller ID from the last incoming ring.       The idString parameter is either simply the "number" field of the caller       ID data, or if full is TRUE, all of the fields in the caller ID data.       The full data of the caller ID string consists of the number field, the       time/date and the name field separated by tabs ('\t').      */    virtual BOOL GetCallerID(      unsigned line,      /// Number of line      PString & idString, /// ID string returned      BOOL full = FALSE   /// Get full information in idString    );    /**Set Caller ID for use in next RingLine() call.       The full data of the caller ID string consists of the number field, the       time/date and the name field separated by tabs ('\t').       If the date field is missing (two consecutive tabs) then the current       time and date is used. Using an empty string will clear the caller ID       so that no caller ID is sent on the next RingLine() call.      */    virtual BOOL SetCallerID(      unsigned line,            /// Number of line      const PString & idString  /// ID string to use    );    enum {      DefaultDTMFOnTime = 180,      DefaultDTMFOffTime = 120    };    /**Play a DTMF digit.       Any characters that are not in the set 0-9, A-D, * or # will be ignored.      */    virtual BOOL PlayDTMF(      unsigned line,            /// Number of line      const char * digits,      /// DTMF digits to be played      DWORD onTime = DefaultDTMFOnTime,  /// Number of milliseconds to play each DTMF digit      DWORD offTime = DefaultDTMFOffTime /// Number of milliseconds between digits    );    /**Read a DTMF digit detected.       This may be characters from the set 0-9, A-D, * or #. A null ('\0')       character indicates that there are no tones in the queue.      */

⌨️ 快捷键说明

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