#include <ixjlid.h>
Inheritance diagram for OpalIxJDevice:
Public Types | |
enum | { POTSLine, PSTNLine, NumLines } |
enum | CardTypes { PhoneJACK = 1, LineJACK = 3, PhoneJACK_Lite, PhoneJACK_PCI, PhoneCARD, PhoneJACK_PCI_TJ } |
Public Member Functions | |
OpalIxJDevice () | |
~OpalIxJDevice () | |
virtual BOOL | Open (const PString &device) |
virtual BOOL | Close () |
virtual PString | GetName () const |
virtual unsigned | GetLineCount () |
virtual BOOL | IsLineTerminal (unsigned line) |
virtual BOOL | IsLinePresent (unsigned line, BOOL force=FALSE) |
virtual BOOL | IsLineOffHook (unsigned line) |
virtual BOOL | SetLineOffHook (unsigned line, BOOL newState=TRUE) |
virtual BOOL | IsLineRinging (unsigned line, DWORD *cadence=NULL) |
virtual BOOL | RingLine (unsigned line, DWORD cadence) |
virtual BOOL | RingLine (unsigned line, PINDEX nCadence, unsigned *pattern) |
virtual BOOL | IsLineDisconnected (unsigned line, BOOL checkForWink=TRUE) |
BOOL | SetLineToLineDirect (unsigned line1, unsigned line2, BOOL connect) |
BOOL | IsLineToLineDirect (unsigned line1, unsigned line2) |
virtual OpalMediaFormat::List | GetMediaFormats () const |
virtual BOOL | SetReadFormat (unsigned line, const OpalMediaFormat &mediaFormat) |
virtual BOOL | SetWriteFormat (unsigned line, const OpalMediaFormat &mediaFormat) |
virtual OpalMediaFormat | GetReadFormat (unsigned line) |
virtual OpalMediaFormat | GetWriteFormat (unsigned line) |
virtual BOOL | SetRawCodec (unsigned line) |
virtual BOOL | StopRawCodec (unsigned line) |
virtual BOOL | StopReadCodec (unsigned line) |
virtual BOOL | StopWriteCodec (unsigned line) |
virtual PINDEX | GetReadFrameSize (unsigned line) |
virtual BOOL | SetReadFrameSize (unsigned, PINDEX) |
virtual PINDEX | GetWriteFrameSize (unsigned line) |
virtual BOOL | SetWriteFrameSize (unsigned, PINDEX) |
virtual BOOL | ReadFrame (unsigned line, void *buf, PINDEX &count) |
virtual BOOL | WriteFrame (unsigned line, const void *buf, PINDEX count, PINDEX &written) |
virtual unsigned | GetAverageSignalLevel (unsigned line, BOOL playback) |
virtual BOOL | EnableAudio (unsigned line, BOOL enable=TRUE) |
virtual BOOL | IsAudioEnabled (unsigned line) |
virtual BOOL | SetRecordVolume (unsigned line, unsigned volume) |
virtual BOOL | SetPlayVolume (unsigned line, unsigned volume) |
virtual BOOL | GetRecordVolume (unsigned line, unsigned &volume) |
virtual BOOL | GetPlayVolume (unsigned line, unsigned &volume) |
AECLevels | GetAEC (unsigned line) |
BOOL | SetAEC (unsigned line, AECLevels level) |
unsigned | GetWinkDuration (unsigned line) |
BOOL | SetWinkDuration (unsigned line, unsigned winkDuration) |
virtual BOOL | GetVAD (unsigned line) |
virtual BOOL | SetVAD (unsigned line, BOOL enable) |
virtual BOOL | GetCallerID (unsigned line, PString &idString, BOOL full=FALSE) |
virtual BOOL | SetCallerID (unsigned line, const PString &idString) |
virtual BOOL | SendCallerIDOnCallWaiting (unsigned line, const PString &idString) |
virtual BOOL | SendVisualMessageWaitingIndicator (unsigned line, BOOL on) |
virtual BOOL | PlayDTMF (unsigned line, const char *digits, DWORD onTime=DefaultDTMFOnTime, DWORD offTime=DefaultDTMFOffTime) |
virtual char | ReadDTMF (unsigned line) |
virtual BOOL | GetRemoveDTMF (unsigned line) |
virtual BOOL | SetRemoveDTMF (unsigned line, BOOL removeTones) |
virtual unsigned | IsToneDetected (unsigned line) |
virtual BOOL | SetToneFilterParameters (unsigned line, CallProgressTones tone, unsigned lowFrequency, unsigned highFrequency, PINDEX numCadences, const unsigned *onTimes, const unsigned *offTimes) |
virtual BOOL | PlayTone (unsigned line, CallProgressTones tone) |
virtual BOOL | IsTonePlaying (unsigned line) |
virtual BOOL | StopTone (unsigned line) |
virtual BOOL | HasHookFlash (unsigned line) |
virtual BOOL | SetCountryCode (T35CountryCodes country) |
virtual DWORD | GetSerialNumber () |
DWORD | GetCardType () const |
ExceptionInfo * | GetException () |
int | GetOSHandle () |
Static Public Member Functions | |
PStringArray | GetDeviceNames () |
void | SignalHandler (int sig) |
Protected Member Functions | |
PINDEX | LogScaleVolume (unsigned line, PINDEX volume, BOOL isPlay) |
BOOL | ConvertOSError (int err) |
Protected Attributes | |
PString | deviceName |
DWORD | dwCardType |
PMutex | readMutex |
PMutex | writeMutex |
BOOL | readStopped |
BOOL | writeStopped |
PINDEX | readFrameSize |
PINDEX | writeFrameSize |
PINDEX | readCodecType |
PINDEX | writeCodecType |
BOOL | lastHookState |
BOOL | currentHookState |
PTimer | hookTimeout |
BOOL | inRawMode |
unsigned | enabledAudioLine |
BOOL | exclusiveAudioMode |
AECLevels | aecLevel |
BOOL | removeDTMF |
PMutex | toneMutex |
BOOL | tonePlaying |
PTimer | lastRingTime |
BOOL | pstnIsOffHook |
BOOL | gotWink |
int | userPlayVol |
int | userRecVol |
int | savedPlayVol |
int | savedRecVol |
AECLevels | savedAEC |
Static Protected Attributes | |
ExceptionInfo | exceptionInfo [MaxIxjDevices] |
PMutex | exceptionMutex |
BOOL | exceptionInit |
|
|
|
|
|
Create a new, closed, device for a xJack card. |
|
Destroy line interface device. This calls Close() on the device. |
|
Close the xJack device. Reimplemented from OpalLineInterfaceDevice. |
|
|
|
Enable audio for the line.
Reimplemented from OpalLineInterfaceDevice. |
|
Get acoustic echo cancellation.
Reimplemented from OpalLineInterfaceDevice. |
|
Get average signal level in last frame.
Reimplemented from OpalLineInterfaceDevice. |
|
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 ('').
Reimplemented from OpalLineInterfaceDevice. |
|
Get the serial number for the xJACK card. |
|
Get all the xJack devices. |
|
|
|
Get the total number of lines supported by this device. Implements OpalLineInterfaceDevice. |
|
Get the media formats this device is capable of using. Implements OpalLineInterfaceDevice. |
|
Get the device name. Implements OpalLineInterfaceDevice. |
|
|
|
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.
Reimplemented from OpalLineInterfaceDevice. |
|
Get the media format (codec) for reading on the specified line.
Implements OpalLineInterfaceDevice. |
|
Get the read frame size in bytes. All calls to ReadFrame() will return this number of bytes.
Implements OpalLineInterfaceDevice. |
|
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.
Reimplemented from OpalLineInterfaceDevice. |
|
Get DTMF removal mode. When set in this mode the DTMF tones detected are removed from the encoded data stream as returned by ReadFrame().
Reimplemented from OpalLineInterfaceDevice. |
|
Get the serial number for the xJACK card. |
|
Get voice activity detection. Note, not all devices, or selected codecs, may support this function.
Reimplemented from OpalLineInterfaceDevice. |
|
Get wink detect minimum duration. This is the signal used by telcos to end PSTN call.
Reimplemented from OpalLineInterfaceDevice. |
|
Get the media format (codec) for writing on the specified line.
Implements OpalLineInterfaceDevice. |
|
Get the write frame size in bytes. All calls to WriteFrame() must be this number of bytes.
Implements OpalLineInterfaceDevice. |
|
Return TRUE if a hook flash has been detected Reimplemented from OpalLineInterfaceDevice. |
|
Determine if audio for the line is enabled.
Reimplemented from OpalLineInterfaceDevice. |
|
Determine if line has been disconnected from a call.
Reimplemented from OpalLineInterfaceDevice. |
|
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).
Implements OpalLineInterfaceDevice. |
|
Determine if a physical line is present on the logical line.
Reimplemented from OpalLineInterfaceDevice. |
|
Determine if line is ringing.
Reimplemented from OpalLineInterfaceDevice. |
|
Get the type of the line.
Reimplemented from OpalLineInterfaceDevice. |
|
Determine if the two lines are directly connected.
Reimplemented from OpalLineInterfaceDevice. |
|
See if a tone is detected.
Reimplemented from OpalLineInterfaceDevice. |
|
Determine if a tone is still playing
Reimplemented from OpalLineInterfaceDevice. |
|
|
|
Open the xJack device.
Implements OpalLineInterfaceDevice. |
|
Play a DTMF digit. Any characters that are not in the set 0-9, A-D, * or # will be ignored.
Reimplemented from OpalLineInterfaceDevice. |
|
Play a tone.
Reimplemented from OpalLineInterfaceDevice. |
|
Read a DTMF digit detected. This may be characters from the set 0-9, A-D, * or #. A null ('') character indicates that there are no tones in the queue.
Reimplemented from OpalLineInterfaceDevice. |
|
Low level read of a frame from the device.
Implements OpalLineInterfaceDevice. |
|
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 }
Reimplemented from OpalLineInterfaceDevice. |
|
Begin ringing local phone set with specified cadence. If cadence is zero then stops ringing.
Reimplemented from OpalLineInterfaceDevice. |
|
Send Caller ID during call
Reimplemented from OpalLineInterfaceDevice. |
|
Send a Visual Message Waiting Indicator
Reimplemented from OpalLineInterfaceDevice. |
|
Set acoustic echo cancellation.
Reimplemented from OpalLineInterfaceDevice. |
|
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 (''). 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.
Reimplemented from OpalLineInterfaceDevice. |
|
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.
Reimplemented from OpalLineInterfaceDevice. |
|
Set the state of the line. Note that not be possible on a given line.
Implements OpalLineInterfaceDevice. |
|
Directly connect the two lines.
Reimplemented from OpalLineInterfaceDevice. |
|
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.
Reimplemented from OpalLineInterfaceDevice. |
|
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.
Reimplemented from OpalLineInterfaceDevice. |
|
Set the xJack codec for reading.
Implements OpalLineInterfaceDevice. |
|
Set the read frame size in bytes. Note that a LID may ignore this value so always use GetReadFrameSize() for I/O. Reimplemented from OpalLineInterfaceDevice. |
|
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.
Reimplemented from OpalLineInterfaceDevice. |
|
Set DTMF removal mode. When set in this mode the DTMF tones detected are removed from the encoded data stream as returned by ReadFrame().
Reimplemented from OpalLineInterfaceDevice. |
|
Set a tones filter parameters. The times are in centi-seconds. Thus, to have a 1 second delay, 100 is required.
Reimplemented from OpalLineInterfaceDevice. |
|
Set voice activity detection. Note, not all devices, or selected codecs, may support this function.
Reimplemented from OpalLineInterfaceDevice. |
|
Set wink detect minimum duration. This is the signal used by telcos to end PSTN call.
Reimplemented from OpalLineInterfaceDevice. |
|
Set the xJack codec for writing.
Implements OpalLineInterfaceDevice. |
|
Set the write frame size in bytes. Note that a LID may ignore this value so always use GetReadFrameSize() for I/O. Reimplemented from OpalLineInterfaceDevice. |
|
|
|
Stop the raw PCM mode codec.
Reimplemented from OpalLineInterfaceDevice. |
|
Stop the read codec.
Reimplemented from OpalLineInterfaceDevice. |
|
Stop playing a tone.
Reimplemented from OpalLineInterfaceDevice. |
|
Stop the write codec.
Reimplemented from OpalLineInterfaceDevice. |
|
Low level write frame to the device.
Implements OpalLineInterfaceDevice. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|