OpenH323 1.18.0
Classes | Public Member Functions | Protected Types | Protected Attributes
OpalVpbDevice Class Reference

#include <vpblid.h>

Inheritance diagram for OpalVpbDevice:
OpalLineInterfaceDevice

List of all members.

Classes

struct  LineState

Public Member Functions

 OpalVpbDevice ()
 ~OpalVpbDevice ()
virtual BOOL Open (const PString &device)
virtual BOOL Close ()
virtual PString GetName () const
virtual unsigned GetLineCount ()
virtual BOOL IsLineOffHook (unsigned line)
virtual BOOL SetLineOffHook (unsigned line, BOOL newState=TRUE)
virtual BOOL IsLineRinging (unsigned line, DWORD *cadence=NULL)
virtual BOOL IsLineDisconnected (unsigned line, BOOL checkForWink=TRUE)
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 StopReadCodec (unsigned line)
virtual BOOL StopWriteCodec (unsigned line)
virtual BOOL SetReadFrameSize (unsigned line, PINDEX frameSize)
virtual BOOL SetWriteFrameSize (unsigned line, PINDEX frameSize)
virtual PINDEX GetReadFrameSize (unsigned line)
virtual PINDEX GetWriteFrameSize (unsigned line)
virtual BOOL ReadFrame (unsigned line, void *buf, PINDEX &count)
virtual BOOL WriteFrame (unsigned line, const void *buf, PINDEX count, PINDEX &written)
virtual BOOL SetRecordVolume (unsigned line, unsigned volume)
virtual BOOL SetPlayVolume (unsigned line, unsigned volume)
int GetOSHandle (unsigned line)
virtual char ReadDTMF (unsigned line)
virtual BOOL PlayDTMF (unsigned line, const char *digits, DWORD onTime=90, DWORD offTime=30)
virtual unsigned IsToneDetected (unsigned line)
virtual BOOL PlayTone (unsigned line, CallProgressTones tone)
virtual BOOL StopTone (unsigned line)
virtual BOOL PlayAudio (unsigned line, const PString &filename)
virtual BOOL StopAudio (unsigned line)

Protected Types

enum  { MaxLineCount = 8 }

Protected Attributes

unsigned cardNumber
unsigned lineCount
struct OpalVpbDevice::LineState lineState [MaxLineCount]

Detailed Description

This class describes the Voicetronix line interface device.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
MaxLineCount 

Constructor & Destructor Documentation

OpalVpbDevice::OpalVpbDevice ( )

Create a new, closed, device for a VPB card.

OpalVpbDevice::~OpalVpbDevice ( ) [inline]

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

References Close().


Member Function Documentation

virtual BOOL OpalVpbDevice::Close ( ) [virtual]

Close the device.

Reimplemented from OpalLineInterfaceDevice.

Referenced by ~OpalVpbDevice().

virtual unsigned OpalVpbDevice::GetLineCount ( ) [virtual]

Get the total number of lines supported by this device.

Implements OpalLineInterfaceDevice.

virtual OpalMediaFormat::List OpalVpbDevice::GetMediaFormats ( ) const [virtual]

Get the media formats this device is capable of using.

Implements OpalLineInterfaceDevice.

virtual PString OpalVpbDevice::GetName ( ) const [virtual]

Get the device name.

Implements OpalLineInterfaceDevice.

int OpalVpbDevice::GetOSHandle ( unsigned  line)

Return line handle

Parameters:
lineNumber of line
virtual OpalMediaFormat OpalVpbDevice::GetReadFormat ( unsigned  line) [virtual]

Get the media format (codec) for reading on the specified line.

Parameters:
lineNumber of line

Implements OpalLineInterfaceDevice.

virtual PINDEX OpalVpbDevice::GetReadFrameSize ( unsigned  line) [virtual]

Get the read frame size in bytes. All calls to ReadFrame() will return this number of bytes.

Parameters:
lineNumber of line

Implements OpalLineInterfaceDevice.

virtual OpalMediaFormat OpalVpbDevice::GetWriteFormat ( unsigned  line) [virtual]

Get the media format (codec) for writing on the specified line.

Parameters:
lineNumber of line

Implements OpalLineInterfaceDevice.

virtual PINDEX OpalVpbDevice::GetWriteFrameSize ( unsigned  line) [virtual]

Get the write frame size in bytes. All calls to WriteFrame() must be this number of bytes.

Parameters:
lineNumber of line

Implements OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::IsLineDisconnected ( unsigned  line,
BOOL  checkForWink = TRUE 
) [virtual]

Determine if line has been disconnected from a call. return TRUE if a tone is detected.

Parameters:
lineNumber of line

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::IsLineOffHook ( unsigned  line) [virtual]

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:
lineNumber of line

Implements OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::IsLineRinging ( unsigned  line,
DWORD *  cadence = NULL 
) [virtual]

Determine if line is ringing.

Parameters:
lineNumber of line
cadenceCadence of incoming ring

Reimplemented from OpalLineInterfaceDevice.

virtual unsigned OpalVpbDevice::IsToneDetected ( unsigned  line) [virtual]

See if a tone is detected.

Parameters:
lineNumber of line

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::Open ( const PString &  device) [virtual]

Open the device.

Parameters:
deviceDevice identifier name.

Implements OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::PlayAudio ( unsigned  line,
const PString &  filename 
) [virtual]

Play a wav file

Parameters:
lineNumber of line
filenameFile Name

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::PlayDTMF ( unsigned  line,
const char *  digits,
DWORD  onTime = 90,
DWORD  offTime = 30 
) [virtual]

Play a DTMF digit. Any characters that are not in the set 0-9, A-D, * or # will be ignored.

Parameters:
lineNumber of line
digitsDTMF digits to be played
onTimeNumber of milliseconds to play each DTMF digit
offTimeNumber of milliseconds between digits

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::PlayTone ( unsigned  line,
CallProgressTones  tone 
) [virtual]

Play a tone.

Parameters:
lineNumber of line
toneTone to be played

Reimplemented from OpalLineInterfaceDevice.

virtual char OpalVpbDevice::ReadDTMF ( unsigned  line) [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.

Parameters:
lineNumber of line

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::ReadFrame ( unsigned  line,
void *  buf,
PINDEX &  count 
) [virtual]

Low level read of a frame from the device.

Parameters:
lineNumber of line
bufPointer to a block of memory to receive the read bytes.
countNumber of bytes read, <= GetReadFrameSize()

Implements OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::SetLineOffHook ( unsigned  line,
BOOL  newState = TRUE 
) [virtual]

Set the state of the line. Note that not be possible on a given line.

Parameters:
lineNumber of line
newStateNew state to set

Implements OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::SetPlayVolume ( unsigned  line,
unsigned  volume 
) [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.

Parameters:
lineNumber of line
volumeVolume level from 0 to 100%

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::SetReadFormat ( unsigned  line,
const OpalMediaFormat mediaFormat 
) [virtual]

Set the codec for reading.

Parameters:
lineNumber of line
mediaFormatCodec type

Implements OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::SetReadFrameSize ( unsigned  line,
PINDEX  frameSize 
) [virtual]

Set the read frame size in bytes. Note that a LID may ignore this value so always use GetReadFrameSize() for I/O.

Parameters:
lineNumber of line
frameSizeNew frame size

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::SetRecordVolume ( unsigned  line,
unsigned  volume 
) [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.

Parameters:
lineNumber of line
volumeVolume level from 0 to 100%

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::SetWriteFormat ( unsigned  line,
const OpalMediaFormat mediaFormat 
) [virtual]

Set the codec for writing.

Parameters:
lineNumber of line
mediaFormatCodec type

Implements OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::SetWriteFrameSize ( unsigned  line,
PINDEX  frameSize 
) [virtual]

Set the write frame size in bytes. Note that a LID may ignore this value so always use GetReadFrameSize() for I/O.

Parameters:
lineNumber of line
frameSizeNew frame size

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::StopAudio ( unsigned  line) [virtual]

Stop playing the Wave File

Parameters:
lineNumber of line

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::StopReadCodec ( unsigned  line) [virtual]

Stop the read codec.

Parameters:
lineNumber of line

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::StopTone ( unsigned  line) [virtual]

Stop playing a tone.

Parameters:
lineNumber of line

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::StopWriteCodec ( unsigned  line) [virtual]

Stop the write codec.

Parameters:
lineNumber of line

Reimplemented from OpalLineInterfaceDevice.

virtual BOOL OpalVpbDevice::WriteFrame ( unsigned  line,
const void *  buf,
PINDEX  count,
PINDEX &  written 
) [virtual]

Low level write frame to the device.

Parameters:
lineNumber of line
bufPointer to a block of memory to write.
countNumber of bytes to write, <= GetWriteFrameSize()
writtenNumber of bytes written, <= GetWriteFrameSize()

Implements OpalLineInterfaceDevice.


Member Data Documentation

unsigned OpalVpbDevice::cardNumber [protected]
unsigned OpalVpbDevice::lineCount [protected]
struct OpalVpbDevice::LineState OpalVpbDevice::lineState[MaxLineCount] [protected]

The documentation for this class was generated from the following file: