OPAL
Version 3.18.8
|
#include <lidpluginmgr.h>
Public Member Functions | |
OpalPluginLID (const PluginLID_Definition &definition) | |
~OpalPluginLID () | |
virtual PBoolean | Open (const PString &device) |
virtual PBoolean | Close () |
virtual PString | GetDeviceType () const |
virtual PString | GetDeviceName () const |
virtual PStringArray | GetAllNames () const |
virtual PString | GetDescription () const |
virtual unsigned | GetLineCount () const |
virtual PBoolean | IsLineTerminal (unsigned line) |
virtual PBoolean | IsLinePresent (unsigned line, PBoolean force=false) |
virtual PBoolean | IsLineOffHook (unsigned line) |
virtual PBoolean | SetLineOffHook (unsigned line, PBoolean newState=true) |
virtual PBoolean | HookFlash (unsigned line, unsigned flashTime=200) |
virtual PBoolean | HasHookFlash (unsigned line) |
virtual PBoolean | IsLineRinging (unsigned line, DWORD *cadence=NULL) |
virtual PBoolean | RingLine (unsigned line, PINDEX nCadence, const unsigned *pattern=NULL, unsigned frequency=400) |
virtual PBoolean | SetLineConnected (unsigned line) |
virtual PBoolean | IsLineConnected (unsigned line) |
virtual PBoolean | IsLineDisconnected (unsigned line, PBoolean checkForWink=true) |
virtual PBoolean | SetLineToLineDirect (unsigned line1, unsigned line2, PBoolean connect) |
virtual PBoolean | IsLineToLineDirect (unsigned line1, unsigned line2) |
virtual OpalMediaFormatList | GetMediaFormats () const |
virtual PBoolean | SetReadFormat (unsigned line, const OpalMediaFormat &mediaFormat) |
virtual PBoolean | SetWriteFormat (unsigned line, const OpalMediaFormat &mediaFormat) |
virtual OpalMediaFormat | GetReadFormat (unsigned line) |
virtual OpalMediaFormat | GetWriteFormat (unsigned line) |
virtual PBoolean | StopReading (unsigned line) |
virtual PBoolean | StopWriting (unsigned line) |
virtual PBoolean | SetReadFrameSize (unsigned line, PINDEX frameSize) |
virtual PBoolean | SetWriteFrameSize (unsigned line, PINDEX frameSize) |
virtual PINDEX | GetReadFrameSize (unsigned line) |
virtual PINDEX | GetWriteFrameSize (unsigned line) |
virtual PBoolean | ReadFrame (unsigned line, void *buf, PINDEX &count) |
virtual PBoolean | WriteFrame (unsigned line, const void *buf, PINDEX count, PINDEX &written) |
virtual unsigned | GetAverageSignalLevel (unsigned line, PBoolean playback) |
virtual PBoolean | EnableAudio (unsigned line, PBoolean enable=true) |
virtual PBoolean | IsAudioEnabled (unsigned line) const |
virtual PBoolean | SetRecordVolume (unsigned line, unsigned volume) |
virtual PBoolean | SetPlayVolume (unsigned line, unsigned volume) |
virtual PBoolean | GetRecordVolume (unsigned line, unsigned &volume) |
virtual PBoolean | GetPlayVolume (unsigned line, unsigned &volume) |
virtual AECLevels | GetAEC (unsigned line) const |
virtual PBoolean | SetAEC (unsigned line, AECLevels level) |
virtual PBoolean | GetVAD (unsigned line) const |
virtual PBoolean | SetVAD (unsigned line, PBoolean enable) |
virtual PBoolean | GetCallerID (unsigned line, PString &idString, PBoolean full=false) |
virtual PBoolean | SetCallerID (unsigned line, const PString &idString) |
virtual PBoolean | SendVisualMessageWaitingIndicator (unsigned line, PBoolean on) |
virtual PBoolean | PlayDTMF (unsigned line, const char *digits, DWORD onTime=DefaultDTMFOnTime, DWORD offTime=DefaultDTMFOffTime) |
virtual char | ReadDTMF (unsigned line) |
virtual PBoolean | GetRemoveDTMF (unsigned line) |
virtual PBoolean | SetRemoveDTMF (unsigned line, PBoolean removeTones) |
virtual CallProgressTones | IsToneDetected (unsigned line) |
virtual CallProgressTones | WaitForToneDetect (unsigned line, unsigned timeout=3000) |
virtual PBoolean | WaitForTone (unsigned line, CallProgressTones tone, unsigned timeout=3000) |
virtual bool | SetToneParameters (unsigned line, CallProgressTones tone, unsigned frequency1, unsigned frequency2, ToneMixingModes mode, PINDEX numCadences, const unsigned *onTimes, const unsigned *offTimes) |
virtual PBoolean | PlayTone (unsigned line, CallProgressTones tone) |
virtual PBoolean | IsTonePlaying (unsigned line) |
virtual PBoolean | StopTone (unsigned line) |
virtual CallProgressTones | DialOut (unsigned line, const PString &number, const DialParams ¶ms=DialParams()) |
virtual unsigned | GetWinkDuration (unsigned line) |
virtual PBoolean | SetWinkDuration (unsigned line, unsigned winkDuration) |
virtual PBoolean | SetCountryCode (T35CountryCodes country) |
virtual PStringList | GetCountryCodeNameList () const |
![]() | |
OpalLineInterfaceDevice () | |
virtual PBoolean | IsOpen () const |
virtual PBoolean | SetLineOnHook (unsigned line) |
virtual bool | UsesRTP () const |
virtual PBoolean | ReadBlock (unsigned line, void *buf, PINDEX count) |
virtual PBoolean | WriteBlock (unsigned line, const void *buf, PINDEX count) |
PBoolean | DisableAudio (unsigned line) |
virtual bool | SetToneDescription (unsigned line, CallProgressTones tone, const PString &description) |
T35CountryCodes | GetCountryCode () const |
PString | GetCountryCodeName () const |
virtual PBoolean | SetCountryCodeName (const PString &countryName) |
virtual PBoolean | PlayAudio (unsigned line, const PString &filename) |
virtual PBoolean | StopAudio (unsigned line) |
virtual PBoolean | RecordAudioStart (unsigned line, const PString &filename) |
virtual PBoolean | RecordAudioStop (unsigned line) |
int | GetErrorNumber () const |
PString | GetErrorText () const |
virtual void | PrintOn (ostream &strm) const |
Protected Member Functions | |
PDECLARE_NOTIFIER (PThread, OpalPluginLID, TonePlayer) | |
bool | StartTonePlayerThread (int tone) |
void | StopTonePlayerThread () |
Protected Attributes | |
const PluginLID_Definition & | m_definition |
void * | m_context |
PString | m_deviceName |
PSoundChannel | m_recorder |
PSoundChannel | m_player |
PThread * | m_tonePlayer |
PSyncPoint | m_stopTone |
bool | m_lockOutTones |
![]() | |
int | m_osHandle |
int | m_osError |
T35CountryCodes | m_countryCode |
PBYTEArray | m_readDeblockingBuffer |
PBYTEArray | m_writeDeblockingBuffer |
PINDEX | m_readDeblockingOffset |
PINDEX | m_writeDeblockingOffset |
std::vector< bool > | m_LineAudioEnabled |
PString | m_callProgressTones [NumTones] |
OpalPluginLID::OpalPluginLID | ( | const PluginLID_Definition & | definition | ) |
OpalPluginLID::~OpalPluginLID | ( | ) |
|
virtual |
Close the line interface device.
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Dial a number on network line. The takes the line off hook, waits for dial tone, and transmits the specified number as DTMF tones.
If the requireTones flag is true the call is aborted of the call progress tones are not detected. Otherwise the call proceeds with short delays while it tries to detect the call progress tones.
The return code indicates the following: DialTone No dial tone detected RingTone Dial was successful BusyTone The remote phone was busy ClearTone Dial failed (usually means rang out) NoTone There was an internal error making the call
line | Number of line |
number | Number to dial |
params | Optional parameters for dial out. |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Enable audio for the line.
line | Number of line |
enable | Flag for enable/disable audio on line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get acoustic echo cancellation. Note, not all devices may support this function.
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get all the possible devices that can be opened.
Implements OpalLineInterfaceDevice.
|
virtual |
Get average signal level in last frame.
line | Number of line |
playback | Get average playback or record level. |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
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 fields separated by tab characters ('\t'), the first three are always the Calling Line Identity (CLI or calling number), the date and the Calling Line Name field. Other fields may follow and are the of the form name=value. The values are LID dependent.
A false is returned if there is no Caller ID information available, e.g. if no ring has occurred.
line | Number of line |
idString | ID string returned |
full | Get full information in idString |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get the list of countries actually supported by the device
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get the description of the 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".
Implements OpalLineInterfaceDevice.
|
virtual |
Get the device name, as used to open the device. Note the format of this name should be as is returned from GetAllName() and must be able to be used in a subsequent Open() call.
Implements OpalLineInterfaceDevice.
|
virtual |
Get the device type identifier. This is as is used in the factory registration.
Implements OpalLineInterfaceDevice.
|
virtual |
Get the total number of lines supported by this device.
Implements OpalLineInterfaceDevice.
|
virtual |
Get the media formats this device is capable of using.
Implements OpalLineInterfaceDevice.
|
virtual |
Set volume level for playing. A value of 100 is the maximum volume possible for the hardware. A value of 0 is the minimum volume possible for the hardware.
line | Number of line |
volume | Volume level from 0 to 100% |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get the media format (codec) for reading on the specified line.
line | Number of line |
Implements OpalLineInterfaceDevice.
|
virtual |
Get the read frame size in bytes. All calls to ReadFrame() will return this number of bytes.
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get volume level for recording. A value of 100 is the maximum volume possible for the hardware. A value of 0 is the minimum volume possible for the hardware.
line | Number of line |
volume | Volume level from 0 to 100% |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get DTMF removal mode. When set in this mode the DTMF tones detected are removed from the encoded data stream as returned by ReadFrame().
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get voice activity detection. Note, not all devices, or selected codecs, may support this function.
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get wink detect minimum duration. This is the signal used by telcos to end PSTN call.
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Get the media format (codec) for writing on the specified line.
line | Number of line |
Implements OpalLineInterfaceDevice.
|
virtual |
Get the write frame size in bytes. All calls to WriteFrame() must be this number of bytes.
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Return true if a hook flash has been detected
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set the hook state off then straight back on again. This will only operate if the line is currently off hook.
line | Number of line |
flashTime | Time for hook flash in milliseconds |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Determine if audio for the line is enabled.
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Determine if remote has answered call on line. This uses the hardware (and country) dependent means for determining if the remote end of a PSTN connection has answered. Typically this is a "polarity reversal" but other techniques may be used.
For a POTS port this is equivalent to IsLineOffHook().
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Determine if line has been disconnected from a call. This uses the hardware (and country) dependent means for determining if the remote end of a PSTN connection has hung up.
For a POTS port this is equivalent to !IsLineOffHook().
line | Number of line |
checkForWink | Check for remote hang up signal |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
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.
line | Number of line |
Implements OpalLineInterfaceDevice.
|
virtual |
Determine if a physical line is present on the logical line.
line | Number of line |
force | Force test, do not optimise |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
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.
line | Number of line |
cadence | Cadence of incoming ring |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
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.
line | Number of line |
Implements OpalLineInterfaceDevice.
|
virtual |
Determine if the two lines are directly connected.
line1 | Number of first line |
line2 | Number of second line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
See if any tone is detected.
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Determine if a tone is still playing
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Open the line interface device.
device | Device identifier name. |
Implements OpalLineInterfaceDevice.
|
protected |
|
virtual |
Play a DTMF digit. Any characters that are not in the set 0-9, A-D, * or # will be ignored.
line | Number of line |
digits | DTMF digits to be played |
onTime | Number of milliseconds to play each DTMF digit |
offTime | Number of milliseconds between digits |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Play a tone.
line | Number of line |
tone | Tone to be played |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
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. Characters E through P indicate the following tones:
E = 800 F = 1000 G = 1250 H = 950 I = 1100 J = 1400 K = 1500 L = 1600 M = 1800 N = 2100 O = 1300 P = 2450
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Low level read of a frame from the device.
line | Number of line |
buf | Pointer to a block of memory to receive data. |
count | Number of bytes read, <= GetReadFrameSize() |
Implements OpalLineInterfaceDevice.
|
virtual |
Begin ringing local phone set with specified cadence. If nCadence 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.
The ring pattern is an array of millisecond times for on and off parts of the cadence. Thus the Australian ring cadence would be represented by the array unsigned AusRing[] = { 400, 200, 400, 2000 }
line | Number of line |
nCadence | Number of entries in cadence array |
pattern | Ring pattern times |
frequency | Frequency of ring (if relevant) |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Send a Visual Message Waiting Indicator
line | Number of line |
on | Flag for VMWI on/off |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set acoustic echo cancellation. Note, not all devices may support this function.
line | Number of line |
level | AEC level |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set Caller ID information. The idString must be as a minimum a number fields for the Calling Line Identity.
The full data of the caller ID string consists fields separated by tab characters ('\t'), the first three are always the Calling Line Identity (CLI or calling number), the date and the Calling Line Name field. Other fields may follow and are the of the form name=value. The values are LID dependent.
If the date field is missing (e.g. 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.
if the line is on hook then this information is sent when the next RingLine() function is called to start a ring cycle. Note that if the Ring cycle had already been started then this function may return false.
If the line is off hook, then a Caller ID on Message Waiting is sent, if supported by the LID, otherwise false is returned.
line | Number of line |
idString | ID string to use |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set the country code set for the device. This may change the line analogue coefficients, ring detect, call disconnect detect and call progress tones to fit the countries telephone network.
country | COuntry code for device |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Indicate to the POTS handset that the call is connected. This uses the hardware (and country) dependent means to indicate to the remote end of a POTS connection that we have answerd. Typically this is a "polarity reversal" but other techniques may be used.
The "connected" state remains in force till the remote disconnects the call, though hanging up.
Returns true if successful, always returns false for PSTN lines.
line | Number of line |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
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.
line | Number of line |
newState | New state to set |
Implements OpalLineInterfaceDevice.
|
virtual |
Directly connect the two lines.
line1 | Number of first line |
line2 | Number of second line |
connect | Flag for connect/disconnect |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set volume level for playing. A value of 100 is the maximum volume possible for the hardware. A value of 0 is the minimum volume possible for the hardware.
line | Number of line |
volume | Volume level from 0 to 100% |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set the media format (codec) for reading on the specified line.
line | Number of line |
mediaFormat | Codec type |
Implements OpalLineInterfaceDevice.
|
virtual |
Set the read frame size in bytes. Note that a LID may ignore this value so always use GetReadFrameSize() for I/O.
line | Number of line |
frameSize | New frame size |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set volume level for recording. A value of 100 is the maximum volume possible for the hardware. A value of 0 is the minimum volume possible for the hardware.
line | Number of line |
volume | Volume level from 0 to 100% |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set DTMF removal mode. When set in this mode the DTMF tones detected are removed from the encoded data stream as returned by ReadFrame().
line | Number of line |
removeTones | Flag for removing DTMF tones. |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set a tones filter information.
line | Number of line |
tone | Tone filter to change |
frequency1 | Usually low frequency |
frequency2 | Usually high frequency |
mode | Mode for how freqencies are mixed, -1 is |
numCadences | Number of cadence times |
onTimes | Cadence ON times |
offTimes | Cadence OFF times |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set voice activity detection. Note, not all devices, or selected codecs, may support this function.
line | Number of line |
enable | Flag for enabling VAD |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set wink detect minimum duration. This is the signal used by telcos to end PSTN call.
line | Number of line |
winkDuration | New minimum duration |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Set the media format (codec) for writing on the specified line.
line | Number of line |
mediaFormat | Codec type |
Implements OpalLineInterfaceDevice.
|
virtual |
Set the write frame size in bytes. Note that a LID may ignore this value so always use GetReadFrameSize() for I/O.
line | Number of line |
frameSize | New frame size |
Reimplemented from OpalLineInterfaceDevice.
|
protected |
|
virtual |
|
virtual |
|
protected |
|
virtual |
|
virtual |
See if a specific tone is detected.
line | Number of line |
tone | Tone to wait for |
timeout | Milliseconds to wait for |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
See if any tone is detected.
line | Number of line |
timeout | Milliseconds to wait for |
Reimplemented from OpalLineInterfaceDevice.
|
virtual |
Low level write frame to the device.
line | Number of line |
buf | Pointer to a block of memory to write. |
count | Number of bytes to write, <= GetWriteFrameSize() |
written | Number of bytes written, <= GetWriteFrameSize() |
Implements OpalLineInterfaceDevice.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |