class OpalIxJDevice

This class describes the xJack line interface device

Inheritance:


Public Methods

[more] OpalIxJDevice ()
Create a new, closed, device for a xJack card
[more] ~OpalIxJDevice ()
Destroy line interface device.
[more]virtual BOOL Open ( const PString & device )
Open the xJack device.
[more]virtual BOOL Close ()
Close the xJack device
[more]virtual PString GetName () const
Get the device name
[more]virtual unsigned GetLineCount ()
Get the total number of lines supported by this device
[more]virtual BOOL IsLineTerminal ( unsigned line )
Get the type of the line.
[more]virtual BOOL IsLinePresent ( unsigned line, BOOL force = FALSE )
Determine if a physical line is present on the logical line.
[more]virtual BOOL IsLineOffHook ( unsigned line )
Determine if line is currently off hook.
[more]virtual BOOL SetLineOffHook ( unsigned line, BOOL newState = TRUE )
Set the state of the line.
[more]virtual BOOL IsLineRinging ( unsigned line, DWORD* cadence = NULL )
Determine if line is ringing.
[more]virtual BOOL RingLine ( unsigned line, DWORD cadence )
Begin ringing local phone set with specified cadence.
[more]virtual BOOL RingLine ( unsigned line, PINDEX nCadence, unsigned* pattern )
Begin ringing local phone set with specified cadence.
[more]virtual BOOL IsLineDisconnected ( unsigned line, BOOL checkForWink = TRUE )
Determine if line has been disconnected from a call.
[more]BOOL SetLineToLineDirect ( unsigned line1, unsigned line2, BOOL connect )
Directly connect the two lines.
[more]BOOL IsLineToLineDirect ( unsigned line1, unsigned line2 )
Determine if the two lines are directly connected.
[more]virtual OpalMediaFormat::List GetMediaFormats () const
Get the media formats this device is capable of using
[more]virtual BOOL SetReadFormat ( unsigned line, const OpalMediaFormat & mediaFormat )
Set the xJack codec for reading.
[more]virtual BOOL SetWriteFormat ( unsigned line, const OpalMediaFormat & mediaFormat )
Set the xJack codec for writing.
[more]virtual OpalMediaFormat GetReadFormat ( unsigned line )
Get the media format (codec) for reading on the specified line.
[more]virtual OpalMediaFormat GetWriteFormat ( unsigned line )
Get the media format (codec) for writing on the specified line.
[more]virtual BOOL SetRawCodec ( unsigned line )
Set the line codec for reading/writing raw PCM data.
[more]virtual BOOL StopRawCodec ( unsigned line )
Stop the raw PCM mode codec.
[more]virtual BOOL StopReadCodec ( unsigned line )
Stop the read codec.
[more]virtual BOOL StopWriteCodec ( unsigned line )
Stop the write codec.
[more]virtual PINDEX GetReadFrameSize ( unsigned line )
Get the read frame size in bytes.
[more]virtual PINDEX GetWriteFrameSize ( unsigned line )
Get the write frame size in bytes.
[more]virtual BOOL ReadFrame ( unsigned line, void* buf, PINDEX & count )
Low level read of a frame from the device.
[more]virtual BOOL WriteFrame ( unsigned line, const void* buf, PINDEX count, PINDEX & written )
Low level write frame to the device.
[more]virtual unsigned GetAverageSignalLevel ( unsigned line, BOOL playback )
Get average signal level in last frame.
[more]virtual BOOL EnableAudio ( unsigned line, BOOL enable = TRUE )
Enable audio for the line.
[more]virtual BOOL IsAudioEnabled ( unsigned line )
Determine if audio for the line is enabled.
[more]virtual BOOL SetRecordVolume ( unsigned line, unsigned volume )
Set volume level for recording.
[more]virtual BOOL SetPlayVolume ( unsigned line, unsigned volume )
Set volume level for playing.
[more]virtual BOOL GetRecordVolume ( unsigned line, unsigned & volume )
Get volume level for recording.
[more]virtual BOOL GetPlayVolume ( unsigned line, unsigned & volume )
Set volume level for playing.
[more]AECLevels GetAEC ( unsigned line )
Get acoustic echo cancellation.
[more]BOOL SetAEC ( unsigned line, AECLevels level )
Set acoustic echo cancellation.
[more]unsigned GetWinkDuration ( unsigned line )
Get wink detect minimum duration.
[more]BOOL SetWinkDuration ( unsigned line, unsigned winkDuration )
Set wink detect minimum duration.
[more]virtual BOOL GetVAD ( unsigned line )
Get voice activity detection.
[more]virtual BOOL SetVAD ( unsigned line, BOOL enable )
Set voice activity detection.
[more]virtual BOOL GetCallerID ( unsigned line, PString & idString, BOOL full = FALSE )
Get Caller ID from the last incoming ring.
[more]virtual BOOL SetCallerID ( unsigned line, const PString & idString )
Set Caller ID for use in next RingLine() call.
[more]virtual BOOL SendCallerIDOnCallWaiting ( unsigned line, const PString & idString )
Send Caller ID during call
[more]virtual BOOL SendVisualMessageWaitingIndicator ( unsigned line, BOOL on )
Send a Visual Message Waiting Indicator
[more]virtual BOOL PlayDTMF ( unsigned line, const char* digits, DWORD onTime = DefaultDTMFOnTime, DWORD offTime = DefaultDTMFOffTime )
Play a DTMF digit.
[more]virtual char ReadDTMF ( unsigned line )
Read a DTMF digit detected.
[more]virtual BOOL GetRemoveDTMF ( unsigned line )
Get DTMF removal mode.
[more]virtual BOOL SetRemoveDTMF ( unsigned line, BOOL removeTones )
Set DTMF removal mode.
[more]virtual unsigned IsToneDetected ( unsigned line )
See if a tone is detected.
[more]virtual BOOL SetToneFilterParameters ( unsigned line, CallProgressTones tone, unsigned lowFrequency, unsigned highFrequency, PINDEX numCadences, const unsigned* onTimes, const unsigned* offTimes )
Set a tones filter parameters.
[more]virtual BOOL PlayTone ( unsigned line, CallProgressTones tone )
Play a tone.
[more]virtual BOOL IsTonePlaying ( unsigned line )
Determine if a tone is still playing
[more]virtual BOOL StopTone ( unsigned line )
Stop playing a tone.
[more]virtual BOOL HasHookFlash (unsigned line)
Return TRUE if a hook flash has been detected
[more]virtual BOOL SetCountryCode ( T35CountryCodes country )
Set the country code set for the device.
[more]virtual DWORD GetSerialNumber ()
Get the serial number for the xJACK card
[more]DWORD GetCardType () const
Get the serial number for the xJACK card
[more]static PStringArray GetDeviceNames ()
Get all the xJack devices


Inherited from OpalLineInterfaceDevice:

Public Methods

ovirtual BOOL IsOpen() const
ovirtual BOOL SetLineOnHook( unsigned line )
ovirtual BOOL HookFlash( unsigned line, unsigned flashTime = 200 )
ovirtual BOOL SetReadCodec( unsigned line, RTP_DataFrame::PayloadTypes codec )
ovirtual BOOL SetWriteCodec( unsigned line, RTP_DataFrame::PayloadTypes codec )
ovirtual BOOL SetReadFrameSize( unsigned line, PINDEX frameSize )
ovirtual BOOL SetWriteFrameSize( unsigned line, PINDEX frameSize )
ovirtual BOOL ReadBlock( unsigned line, void* buf, PINDEX count )
ovirtual BOOL WriteBlock( unsigned line, const void* buf, PINDEX count )
oBOOL DisableAudio( unsigned line )
ovirtual unsigned WaitForToneDetect( unsigned line, unsigned timeout = 3000 )
ovirtual BOOL WaitForTone( unsigned line, CallProgressTones tone, unsigned timeout = 3000 )
ovirtual BOOL SetToneFilter( unsigned line, CallProgressTones tone, const PString & description )
ovirtual BOOL PlayAudio( unsigned line, const PString & filename )
ovirtual BOOL StopAudio( unsigned line )
ovirtual CallProgressTones DialOut( unsigned line, const PString & number, BOOL requireTones = FALSE )
oT35CountryCodes GetCountryCode() const
oPString GetCountryCodeName() const
ostatic PString GetCountryCodeName(T35CountryCodes code)
ovirtual BOOL SetCountryCodeName( const PString & countryName )
ovirtual PStringList GetCountryCodeNameList() const
oint GetErrorNumber() const
oPString GetErrorText() const


Documentation

This class describes the xJack line interface device
o OpalIxJDevice()
Create a new, closed, device for a xJack card

o ~OpalIxJDevice()
Destroy line interface device. This calls Close() on the device.

ovirtual BOOL Open( const PString & device )
Open the xJack device.
Parameters:
device - Device identifier name.

ovirtual BOOL Close()
Close the xJack device

ovirtual PString GetName() const
Get the device name

ovirtual unsigned GetLineCount()
Get the total number of lines supported by this device

ovirtual BOOL IsLineTerminal( unsigned line )
Get the type of the line.
Parameters:
line - Number of line

ovirtual BOOL IsLinePresent( unsigned line, BOOL force = FALSE )
Determine if a physical line is present on the logical line.
Parameters:
line - Number of line
force - Force test, do not optimise

ovirtual BOOL IsLineOffHook( unsigned line )
Determine if line is currently off hook. This returns TRUE if GetLineState() is a state that implies the line is off hook (eg OffHook or LineBusy).
Parameters:
line - Number of line

ovirtual BOOL SetLineOffHook( unsigned line, BOOL newState = TRUE )
Set the state of the line. Note that not be possible on a given line.
Parameters:
line - Number of line
newState - New state to set

ovirtual BOOL IsLineRinging( unsigned line, DWORD* cadence = NULL )
Determine if line is ringing.
Parameters:
line - Number of line
cadence - Cadence of incoming ring

ovirtual BOOL RingLine( unsigned line, DWORD cadence )
Begin ringing local phone set with specified cadence. If cadence is zero then stops ringing.
Parameters:
line - Number of line
cadence - Cadence bit map for ring pattern

ovirtual BOOL RingLine( unsigned line, PINDEX nCadence, unsigned* pattern )
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 }

Parameters:
line - Number of line
nCadence - Number of entries in cadence array
pattern - Ring pattern times

ovirtual BOOL IsLineDisconnected( unsigned line, BOOL checkForWink = TRUE )
Determine if line has been disconnected from a call.
Parameters:
line - Number of line

oBOOL SetLineToLineDirect( unsigned line1, unsigned line2, BOOL connect )
Directly connect the two lines.
Parameters:
line1 - Number of first line
line2 - Number of second line
connect - Flag for connect/disconnect

oBOOL IsLineToLineDirect( unsigned line1, unsigned line2 )
Determine if the two lines are directly connected.
Parameters:
line1 - Number of first line
line2 - Number of second line

ovirtual OpalMediaFormat::List GetMediaFormats() const
Get the media formats this device is capable of using

ovirtual BOOL SetReadFormat( unsigned line, const OpalMediaFormat & mediaFormat )
Set the xJack codec for reading.
Parameters:
line - Number of line
mediaFormat - Codec type

ovirtual BOOL SetWriteFormat( unsigned line, const OpalMediaFormat & mediaFormat )
Set the xJack codec for writing.
Parameters:
line - Number of line
mediaFormat - Codec type

ovirtual OpalMediaFormat GetReadFormat( unsigned line )
Get the media format (codec) for reading on the specified line.
Parameters:
line - Number of line

ovirtual OpalMediaFormat GetWriteFormat( unsigned line )
Get the media format (codec) for writing on the specified line.
Parameters:
line - Number of line

ovirtual BOOL SetRawCodec( unsigned line )
Set the line codec for reading/writing raw PCM data. A descendent may use this to do anything special to the device before beginning special PCM output. For example disabling AEC and set volume levels to standard values. This can then be used for generating standard tones using PCM if the driver is not capable of generating or detecting them directly.

The default behaviour simply does a SetReadCodec and SetWriteCodec for PCM data.

Parameters:
line - Number of line

ovirtual BOOL StopRawCodec( unsigned line )
Stop the raw PCM mode codec.
Parameters:
line - Number of line

ovirtual BOOL StopReadCodec( unsigned line )
Stop the read codec.
Parameters:
line - Number of line

ovirtual BOOL StopWriteCodec( unsigned line )
Stop the write codec.
Parameters:
line - Number of line

ovirtual PINDEX GetReadFrameSize( unsigned line )
Get the read frame size in bytes. All calls to ReadFrame() will return this number of bytes.
Parameters:
line - Number of line

ovirtual PINDEX GetWriteFrameSize( unsigned line )
Get the write frame size in bytes. All calls to WriteFrame() must be this number of bytes.
Parameters:
line - Number of line

ovirtual BOOL ReadFrame( unsigned line, void* buf, PINDEX & count )
Low level read of a frame from the device.
Parameters:
line - Number of line
buf - Pointer to a block of memory to receive data.
count - Number of bytes read, <= GetReadFrameSize()

ovirtual BOOL WriteFrame( unsigned line, const void* buf, PINDEX count, PINDEX & written )
Low level write frame to the device.
Parameters:
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()

ovirtual unsigned GetAverageSignalLevel( unsigned line, BOOL playback )
Get average signal level in last frame.
Parameters:
line - Number of line
playback - Get average playback or record level.

ovirtual BOOL EnableAudio( unsigned line, BOOL enable = TRUE )
Enable audio for the line.
Parameters:
line - Number of line

ovirtual BOOL IsAudioEnabled( unsigned line )
Determine if audio for the line is enabled.
Parameters:
line - Number of line

ovirtual BOOL SetRecordVolume( unsigned line, unsigned volume )
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.
Parameters:
line - Number of line
volume - Volume level from 0 to 100%

ovirtual BOOL SetPlayVolume( unsigned line, unsigned volume )
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.
Parameters:
line - Number of line
volume - Volume level from 0 to 100%

ovirtual BOOL GetRecordVolume( unsigned line, unsigned & volume )
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.
Parameters:
line - Number of line
volume - Volume level from 0 to 100%

ovirtual BOOL GetPlayVolume( unsigned line, unsigned & volume )
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.
Parameters:
line - Number of line
volume - Volume level from 0 to 100%

oAECLevels GetAEC( unsigned line )
Get acoustic echo cancellation.
Parameters:
line - Number of line

oBOOL SetAEC( unsigned line, AECLevels level )
Set acoustic echo cancellation.
Parameters:
line - Number of line
level - AEC level

ounsigned GetWinkDuration( unsigned line )
Get wink detect minimum duration. This is the signal used by telcos to end PSTN call.
Parameters:
line - Number of line

oBOOL SetWinkDuration( unsigned line, unsigned winkDuration )
Set wink detect minimum duration. This is the signal used by telcos to end PSTN call.
Parameters:
line - Number of line
winkDuration - New minimum duration

ovirtual BOOL GetVAD( unsigned line )
Get voice activity detection. Note, not all devices, or selected codecs, may support this function.
Parameters:
line - Number of line

ovirtual BOOL SetVAD( unsigned line, BOOL enable )
Set voice activity detection. Note, not all devices, or selected codecs, may support this function.
Parameters:
line - Number of line
enable - Flag for enabling VAD

ovirtual BOOL GetCallerID( unsigned line, PString & idString, BOOL full = FALSE )
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').

Parameters:
line - Number of line
idString - ID string returned
full - Get full information in idString

ovirtual BOOL SetCallerID( unsigned line, const PString & 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.

Parameters:
line - Number of line
idString - ID string to use

ovirtual BOOL SendCallerIDOnCallWaiting( unsigned line, const PString & idString )
Send Caller ID during call
Parameters:
line - Number of line
idString - ID string to use

ovirtual BOOL SendVisualMessageWaitingIndicator( unsigned line, BOOL on )
Send a Visual Message Waiting Indicator
Parameters:
line - Number of line

ovirtual BOOL PlayDTMF( unsigned line, const char* digits, DWORD onTime = DefaultDTMFOnTime, DWORD offTime = DefaultDTMFOffTime )
Play a DTMF digit. Any characters that are not in the set 0-9, A-D, * or  will be ignored.
Parameters:
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

ovirtual char ReadDTMF( unsigned line )
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.

Parameters:
line - Number of line

ovirtual BOOL GetRemoveDTMF( unsigned line )
Get DTMF removal mode. When set in this mode the DTMF tones detected are removed from the encoded data stream as returned by ReadFrame().
Parameters:
line - Number of line

ovirtual BOOL SetRemoveDTMF( unsigned line, BOOL removeTones )
Set DTMF removal mode. When set in this mode the DTMF tones detected are removed from the encoded data stream as returned by ReadFrame().
Parameters:
line - Number of line
removeTones - Flag for removing DTMF tones.

ovirtual unsigned IsToneDetected( unsigned line )
See if a tone is detected.
Parameters:
line - Number of line

ovirtual BOOL SetToneFilterParameters( unsigned line, CallProgressTones tone, unsigned lowFrequency, unsigned highFrequency, PINDEX numCadences, const unsigned* onTimes, const unsigned* offTimes )
Set a tones filter parameters.

The times are in centi-seconds. Thus, to have a 1 second delay, 100 is required.

Parameters:
line - Number of line
tone - Tone filter to change
lowFrequency - Low frequency
highFrequency - High frequency
numCadences - Number of cadence times
onTimes - Cadence ON times
offTimes - Cadence OFF times

ovirtual BOOL PlayTone( unsigned line, CallProgressTones tone )
Play a tone.
Parameters:
line - Number of line
tone - Tone to be played

ovirtual BOOL IsTonePlaying( unsigned line )
Determine if a tone is still playing
Parameters:
line - Number of line

ovirtual BOOL StopTone( unsigned line )
Stop playing a tone.
Parameters:
line - Number of line

ovirtual BOOL HasHookFlash(unsigned line)
Return TRUE if a hook flash has been detected

ovirtual BOOL SetCountryCode( T35CountryCodes country )
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.
Parameters:
country - COuntry code for device

ovirtual DWORD GetSerialNumber()
Get the serial number for the xJACK card

oDWORD GetCardType() const
Get the serial number for the xJACK card

ostatic PStringArray GetDeviceNames()
Get all the xJack devices


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.