Line Interface Device abstraction.
![]() | OpalLineInterfaceDevice () Construct a new line interface device |
![]() | Open ( const PString & device ) Open the line interface device. |
![]() | IsOpen () const Determine if the line interface device is open |
![]() | Close () Close the line interface device |
![]() | GetName () const Determine the type of line interface device. |
![]() | GetLineCount () Get the total number of lines supported by this device |
![]() | IsLineTerminal ( unsigned line ) Get the type of the line. |
![]() | IsLinePresent ( unsigned line, BOOL force = FALSE ) Determine if a physical line is present on the logical line. |
![]() | IsLineOffHook ( unsigned line ) Determine if line is currently off hook. |
![]() | SetLineOffHook ( unsigned line, BOOL newState = TRUE ) Set the hook state of the line. |
![]() | SetLineOnHook ( unsigned line ) Set the hook state of the line. |
![]() | HookFlash ( unsigned line, unsigned flashTime = 200 ) Set the hook state off then straight back on again. |
![]() | HasHookFlash (unsigned line) Return TRUE if a hook flash has been detected |
![]() | IsLineRinging ( unsigned line, DWORD * cadence = NULL ) Determine if line is ringing. |
![]() | RingLine ( unsigned line, DWORD cadence ) Begin ringing local phone set with specified cadence. |
![]() | IsLineDisconnected ( unsigned line, BOOL checkForWink = TRUE ) Determine if line has been disconnected from a call. |
![]() | SetLineToLineDirect ( unsigned line1, unsigned line2, BOOL connect ) Directly connect the two lines. |
![]() | IsLineToLineDirect ( unsigned line1, unsigned line2 ) Determine if the two lines are directly connected. |
![]() | GetMediaFormats () const Get the media formats this device is capable of using |
![]() | SetReadFormat ( unsigned line, const OpalMediaFormat & mediaFormat ) Set the media format (codec) for reading on the specified line. |
![]() | SetWriteFormat ( unsigned line, const OpalMediaFormat & mediaFormat ) Set the media format (codec) for writing on the specified line. |
![]() | GetReadFormat ( unsigned line ) Get the media format (codec) for reading on the specified line. |
![]() | GetWriteFormat ( unsigned line ) Get the media format (codec) for writing on the specified line. |
![]() | SetReadCodec ( unsigned line, RTP_DataFrame::PayloadTypes codec ) Set the line codec for reading. |
![]() | SetWriteCodec ( unsigned line, RTP_DataFrame::PayloadTypes codec ) Set the line codec for writing. |
![]() | SetRawCodec ( unsigned line ) Set the line codec for reading/writing raw PCM data. |
![]() | StopReadCodec ( unsigned line ) Stop the read codec. |
![]() | StopWriteCodec ( unsigned line ) Stop the write codec. |
![]() | StopRawCodec ( unsigned line ) Stop the raw PCM mode codec. |
![]() | SetReadFrameSize ( unsigned line, PINDEX frameSize ) Set the read frame size in bytes. |
![]() | SetWriteFrameSize ( unsigned line, PINDEX frameSize ) Set the write frame size in bytes. |
![]() | GetReadFrameSize ( unsigned line ) Get the read frame size in bytes. |
![]() | GetWriteFrameSize ( unsigned line ) Get the write frame size in bytes. |
![]() | ReadFrame ( unsigned line, void * buf, PINDEX & count ) Low level read of a frame from the device. |
![]() | WriteFrame ( unsigned line, const void * buf, PINDEX count, PINDEX & written ) Low level write frame to the device. |
![]() | ReadBlock ( unsigned line, void * buf, PINDEX count ) High level read of audio data from the device. |
![]() | WriteBlock ( unsigned line, const void * buf, PINDEX count ) High level write audio data to the device. |
![]() | GetAverageSignalLevel ( unsigned line, BOOL playback ) Get average signal level in last frame. |
![]() | EnableAudio ( unsigned line, BOOL enable = TRUE ) Enable audio for the line. |
![]() | DisableAudio ( unsigned line ) Disable audio for the line. |
![]() | SetRecordVolume ( unsigned line, unsigned volume ) Set volume level for recording. |
![]() | SetPlayVolume ( unsigned line, unsigned volume ) Set volume level for playing. |
![]() | GetRecordVolume ( unsigned line, unsigned & volume ) Get volume level for recording. |
![]() | GetPlayVolume ( unsigned line, unsigned & volume ) Set volume level for playing. |
![]() | GetAEC ( unsigned line ) Get acoustic echo cancellation. |
![]() | SetAEC ( unsigned line, AECLevels level ) Set acoustic echo cancellation. |
![]() | GetVAD ( unsigned line ) Get voice activity detection. |
![]() | SetVAD ( unsigned line, BOOL enable ) Set voice activity detection. |
![]() | GetCallerID ( unsigned line, PString & idString, BOOL full = FALSE ) Get Caller ID from the last incoming ring. |
![]() | SetCallerID ( unsigned line, const PString & idString ) Set Caller ID for use in next RingLine() call. |
![]() | SendCallerIDOnCallWaiting ( unsigned line, const PString & idString ) Send a Caller ID on call waiting command The full data of the caller ID string consists of the number field, the time/date and the name field separated by tabs ('\t'). |
![]() | SendVisualMessageWaitingIndicator ( unsigned line, BOOL on ) Send a Visual Message Waiting Indicator |
![]() | PlayDTMF ( unsigned line, const char * digits, DWORD onTime = DefaultDTMFOnTime, DWORD offTime = DefaultDTMFOffTime ) Play a DTMF digit. |
![]() | ReadDTMF ( unsigned line ) Read a DTMF digit detected. |
![]() | GetRemoveDTMF ( unsigned line ) Get DTMF removal mode. |
![]() | SetRemoveDTMF ( unsigned line, BOOL removeTones ) Set DTMF removal mode. |
![]() | IsToneDetected ( unsigned line ) See if any tone is detected. |
![]() | WaitForToneDetect ( unsigned line, unsigned timeout = 3000 ) See if any tone is detected. |
![]() | WaitForTone ( unsigned line, CallProgressTones tone, unsigned timeout = 3000 ) See if a specific tone is detected. |
![]() | SetToneFilter ( unsigned line, CallProgressTones tone, const PString & description ) Set a tones filter information. |
![]() | SetToneFilterParameters ( unsigned line, CallProgressTones tone, unsigned lowFrequency, unsigned highFrequency, PINDEX numCadences, const unsigned * onTimes, const unsigned * offTimes ) Set a tones filter information. |
![]() | PlayTone ( unsigned line, CallProgressTones tone ) Play a tone. |
![]() | IsTonePlaying ( unsigned line ) Determine if a tone is still playing |
![]() | StopTone ( unsigned line ) Stop playing a tone. |
![]() | DialOut ( unsigned line, const PString & number, BOOL requireTones = FALSE ) Dial a number on network line. |
![]() | GetCountryCode () const Get the country code set for the device |
![]() | GetCountryCodeName () const Get the country code set for the device as a string |
![]() | GetCountryCodeName (T35CountryCodes code) Get the country code set for the device as a string |
![]() | SetCountryCode ( T35CountryCodes country ) Set the country code set for the device. |
![]() | SetCountryCodeName ( const PString & countryName ) Set the country code set for the device. |
![]() | GetCountryCodeNameList () const Get the list of countries actually supported by the device |
![]() | GetErrorNumber () const Return number for last error |
![]() | GetErrorText () const Return text for last error |
Line Interface Device abstraction. Note all functions in this device abstraction are assumed to be thread atomic.
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.
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 default behaviour now finds the first OpalMediaFormat with the
payload type and uses that.
The default behaviour simply does a SetReadCodec and SetWriteCodec for
PCM 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').
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.
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.
E = 800 F = 1000 G = 1250 H = 950 I = 1100 J = 1400
K = 1500 L = 1600 M = 1800 N = 2100 O = 1300 P = 2450
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
virtual BOOL Open( const PString & device )
virtual BOOL IsOpen() const
virtual BOOL Close()
virtual PString GetName() const
virtual unsigned GetLineCount()
virtual BOOL IsLineTerminal( unsigned line )
virtual BOOL IsLinePresent( unsigned line, BOOL force = FALSE )
force - Force test, do not optimisevirtual BOOL IsLineOffHook( unsigned line )
virtual BOOL SetLineOffHook( unsigned line, BOOL newState = TRUE )
newState - New state to setvirtual BOOL SetLineOnHook( unsigned line )
virtual BOOL HookFlash( unsigned line, unsigned flashTime = 200 )
flashTime - Time for hook flash in millisecondsvirtual BOOL HasHookFlash(unsigned line)
virtual BOOL IsLineRinging( unsigned line, DWORD * cadence = NULL )
cadence - Cadence of incoming ringvirtual BOOL RingLine( unsigned line, DWORD cadence )
cadence - Cadence bit map for ring patternvirtual BOOL IsLineDisconnected( unsigned line, BOOL checkForWink = TRUE )
virtual BOOL SetLineToLineDirect( unsigned line1, unsigned line2, BOOL connect )
line2 - Number of second line
connect - Flag for connect/disconnectvirtual BOOL IsLineToLineDirect( unsigned line1, unsigned line2 )
line2 - Number of second linevirtual OpalMediaFormat::List GetMediaFormats() const
virtual BOOL SetReadFormat( unsigned line, const OpalMediaFormat & mediaFormat )
mediaFormat - Codec typevirtual BOOL SetWriteFormat( unsigned line, const OpalMediaFormat & mediaFormat )
mediaFormat - Codec typevirtual OpalMediaFormat GetReadFormat( unsigned line )
virtual OpalMediaFormat GetWriteFormat( unsigned line )
virtual BOOL SetReadCodec( unsigned line, RTP_DataFrame::PayloadTypes codec )
codec - Codec typevirtual BOOL SetWriteCodec( unsigned line, RTP_DataFrame::PayloadTypes codec )
codec - Codec typevirtual BOOL SetRawCodec( unsigned line )
virtual BOOL StopReadCodec( unsigned line )
virtual BOOL StopWriteCodec( unsigned line )
virtual BOOL StopRawCodec( unsigned line )
virtual BOOL SetReadFrameSize( unsigned line, PINDEX frameSize )
frameSize - New frame sizevirtual BOOL SetWriteFrameSize( unsigned line, PINDEX frameSize )
frameSize - New frame sizevirtual PINDEX GetReadFrameSize( unsigned line )
virtual PINDEX GetWriteFrameSize( unsigned line )
virtual BOOL ReadFrame( unsigned line, void * buf, PINDEX & count )
buf - Pointer to a block of memory to receive data.
count - Number of bytes read, <= GetReadFrameSize()virtual BOOL WriteFrame( unsigned line, const void * buf, PINDEX count, PINDEX & written )
buf - Pointer to a block of memory to write.
count - Number of bytes to write, <= GetWriteFrameSize()
written - Number of bytes written, <= GetWriteFrameSize()virtual BOOL ReadBlock( unsigned line, void * buf, PINDEX count )
buf - Pointer to a block of memory to receive the read bytes.
count - Count of bytes to read.virtual BOOL WriteBlock( unsigned line, const void * buf, PINDEX count )
buf - Pointer to a block of memory to write.
count - Count of bytes to write.virtual unsigned GetAverageSignalLevel( unsigned line, BOOL playback )
playback - Get average playback or record level.virtual BOOL EnableAudio( unsigned line, BOOL enable = TRUE )
BOOL DisableAudio( unsigned line )
virtual BOOL SetRecordVolume( unsigned line, unsigned volume )
volume - Volume level from 0 to 100%virtual BOOL SetPlayVolume( unsigned line, unsigned volume )
volume - Volume level from 0 to 100%virtual BOOL GetRecordVolume( unsigned line, unsigned & volume )
volume - Volume level from 0 to 100%virtual BOOL GetPlayVolume( unsigned line, unsigned & volume )
volume - Volume level from 0 to 100%virtual AECLevels GetAEC( unsigned line )
virtual BOOL SetAEC( unsigned line, AECLevels level )
level - AEC levelvirtual BOOL GetVAD( unsigned line )
virtual BOOL SetVAD( unsigned line, BOOL enable )
enable - Flag for enabling VADvirtual BOOL GetCallerID( unsigned line, PString & idString, BOOL full = FALSE )
idString - ID string returned
full - Get full information in idStringvirtual BOOL SetCallerID( unsigned line, const PString & idString )
idString - ID string to usevirtual BOOL SendCallerIDOnCallWaiting( unsigned line, const PString & idString )
idString - ID string to usevirtual BOOL SendVisualMessageWaitingIndicator( unsigned line, BOOL on )
virtual BOOL PlayDTMF( unsigned line, const char * digits, DWORD onTime = DefaultDTMFOnTime, DWORD offTime = DefaultDTMFOffTime )
digits - DTMF digits to be played
onTime - Number of milliseconds to play each DTMF digit
offTime - Number of milliseconds between digitsvirtual char ReadDTMF( unsigned line )
virtual BOOL GetRemoveDTMF( unsigned line )
virtual BOOL SetRemoveDTMF( unsigned line, BOOL removeTones )
removeTones - Flag for removing DTMF tones.virtual unsigned IsToneDetected( unsigned line )
virtual unsigned WaitForToneDetect( unsigned line, unsigned timeout = 3000 )
timeout - Milliseconds to wait forvirtual BOOL WaitForTone( unsigned line, CallProgressTones tone, unsigned timeout = 3000 )
tone - Tone to wait for
timeout - Milliseconds to wait forvirtual BOOL SetToneFilter( unsigned line, CallProgressTones tone, const PString & description )
tone - Tone filter to change
description - Description of filter parametersvirtual BOOL SetToneFilterParameters( unsigned line, CallProgressTones tone, unsigned lowFrequency, unsigned highFrequency, PINDEX numCadences, const unsigned * onTimes, const unsigned * offTimes )
tone - Tone filter to change
lowFrequency - Low frequency
highFrequency - High frequency
numCadences - Number of cadence times
onTimes - Cadence ON times
offTimes - Cadence OFF timesvirtual BOOL PlayTone( unsigned line, CallProgressTones tone )
tone - Tone to be playedvirtual BOOL IsTonePlaying( unsigned line )
virtual BOOL StopTone( unsigned line )
virtual CallProgressTones DialOut( unsigned line, const PString & number, BOOL requireTones = FALSE )
number - Number to dial
requireTones - Require dial/ring tone to be detectedT35CountryCodes GetCountryCode() const
PString GetCountryCodeName() const
static PString GetCountryCodeName(T35CountryCodes code)
virtual BOOL SetCountryCode( T35CountryCodes country )
virtual BOOL SetCountryCodeName( const PString & countryName )
virtual PStringList GetCountryCodeNameList() const
Alphabetic index HTML hierarchy of classes or Java