#include <lid.h>
Public Types | |
| enum | { MaxVolume = 100 } |
| enum | AECLevels { AECOff, AECLow, AECMedium, AECHigh, AECAuto, AECAGC, AECError } |
| enum | { DefaultDTMFOnTime = 180, DefaultDTMFOffTime = 120 } |
| enum | CallProgressTones { NoTone = 0x00, DialTone = 0x01, RingTone = 0x02, BusyTone = 0x04, FastBusyTone = 0x08, ClearTone = 0x10, CNGTone = 0x20, MwiTone = 0x40, AllTones = 0x4f } |
| enum | T35CountryCodes { Japan, Albania, Algeria, AmericanSamoa, Germany, Anguilla, AntiguaAndBarbuda, Argentina, Ascension, Australia, Austria, Bahamas, Bahrain, Bangladesh, Barbados, Belgium, Belize, Benin, Bermudas, Bhutan, Bolivia, Botswana, Brazil, BritishAntarcticTerritory, BritishIndianOceanTerritory, BritishVirginIslands, BruneiDarussalam, Bulgaria, Myanmar, Burundi, Byelorussia, Cameroon, Canada, CapeVerde, CaymanIslands, CentralAfricanRepublic, Chad, Chile, China, Colombia, Comoros, Congo, CookIslands, CostaRica, Cuba, Cyprus, Czechoslovakia, Cambodia, DemocraticPeoplesRepublicOfKorea, Denmark, Djibouti, DominicanRepublic, Dominica, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Ethiopia, FalklandIslands, Fiji, Finland, France, FrenchPolynesia, FrenchSouthernAndAntarcticLands, Gabon, Gambia, Germany2, Angola, Ghana, Gibraltar, Greece, Grenada, Guam, Guatemala, Guernsey, Guinea, GuineaBissau, Guayana, Haiti, Honduras, Hongkong, Hungary, Iceland, India, Indonesia, Iran, Iraq, Ireland, Israel, Italy, CotedIvoire, Jamaica, Afghanistan, Jersey, Jordan, Kenya, Kiribati, KoreaRepublic, Kuwait, Lao, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Luxemborg, Macao, Madagascar, Malaysia, Malawi, Maldives, Mali, Malta, Mauritania, Mauritius, Mexico, Monaco, Mongolia, Montserrat, Morocco, Mozambique, Nauru, Nepal, Netherlands, NetherlandsAntilles, NewCaledonia, NewZealand, Nicaragua, Niger, Nigeria, Norway, Oman, Pakistan, Panama, PapuaNewGuinea, Paraguay, Peru, Philippines, Poland, Portugal, PuertoRico, Qatar, Romania, Rwanda, SaintKittsAndNevis, SaintCroix, SaintHelenaAndAscension, SaintLucia, SanMarino, SaintThomas, SaoTomeAndPrincipe, SaintVicentAndTheGrenadines, SaudiArabia, Senegal, Seychelles, SierraLeone, Singapore, SolomonIslands, Somalia, SouthAfrica, Spain, SriLanka, Sudan, Suriname, Swaziland, Sweden, Switzerland, Syria, Tanzania, Thailand, Togo, Tonga, TrinidadAndTobago, Tunisia, Turkey, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine, UnitedArabEmirates, UnitedKingdom, UnitedStates, BurkinaFaso, Uruguay, USSR, Vanuatu, VaticanCityState, Venezuela, VietNam, WallisAndFutuna, WesternSamoa, Yemen, Yemen2, Yugoslavia, Zaire, Zambia, Zimbabwe, NumCountryCodes, UnknownCountry = -1 } |
| enum | { DIAL_TONE_TIMEOUT = 10000 } |
Public Methods | |
| OpalLineInterfaceDevice () | |
| virtual BOOL | Open (const PString &device)=0 |
| virtual BOOL | IsOpen () const |
| virtual BOOL | Close () |
| virtual PString | GetDeviceType () const=0 |
| virtual PString | GetDeviceName () const=0 |
| virtual PStringArray | GetAllNames () const=0 |
| virtual PString | GetDescription () const=0 |
| virtual unsigned | GetLineCount ()=0 |
| virtual BOOL | IsLineTerminal (unsigned line) |
| virtual BOOL | IsLinePresent (unsigned line, BOOL force=FALSE) |
| virtual BOOL | IsLineOffHook (unsigned line)=0 |
| virtual BOOL | SetLineOffHook (unsigned line, BOOL newState=TRUE)=0 |
| virtual BOOL | SetLineOnHook (unsigned line) |
| virtual BOOL | HookFlash (unsigned line, unsigned flashTime=200) |
| virtual BOOL | HasHookFlash (unsigned line) |
| 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) |
| virtual BOOL | SetLineToLineDirect (unsigned line1, unsigned line2, BOOL connect) |
| virtual BOOL | IsLineToLineDirect (unsigned line1, unsigned line2) |
| virtual OpalMediaFormatList | GetMediaFormats () const=0 |
| virtual BOOL | SetReadFormat (unsigned line, const OpalMediaFormat &mediaFormat)=0 |
| virtual BOOL | SetWriteFormat (unsigned line, const OpalMediaFormat &mediaFormat)=0 |
| virtual OpalMediaFormat | GetReadFormat (unsigned line)=0 |
| virtual OpalMediaFormat | GetWriteFormat (unsigned line)=0 |
| virtual BOOL | SetReadCodec (unsigned line, RTP_DataFrame::PayloadTypes codec) |
| virtual BOOL | SetWriteCodec (unsigned line, RTP_DataFrame::PayloadTypes codec) |
| virtual 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) |
| virtual BOOL | SetWriteFrameSize (unsigned line, PINDEX frameSize) |
| virtual PINDEX | GetReadFrameSize (unsigned line)=0 |
| virtual PINDEX | GetWriteFrameSize (unsigned line)=0 |
| virtual BOOL | ReadFrame (unsigned line, void *buf, PINDEX &count)=0 |
| virtual BOOL | WriteFrame (unsigned line, const void *buf, PINDEX count, PINDEX &written)=0 |
| virtual BOOL | ReadBlock (unsigned line, void *buf, PINDEX count) |
| virtual BOOL | WriteBlock (unsigned line, const void *buf, PINDEX count) |
| virtual unsigned | GetAverageSignalLevel (unsigned line, BOOL playback) |
| virtual BOOL | EnableAudio (unsigned line, BOOL enable=TRUE) |
| BOOL | DisableAudio (unsigned line) |
| 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) |
| virtual AECLevels | GetAEC (unsigned line) |
| virtual BOOL | SetAEC (unsigned line, AECLevels level) |
| virtual unsigned | GetWinkDuration (unsigned line) |
| virtual 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 CallProgressTones | IsToneDetected (unsigned line) |
| virtual CallProgressTones | WaitForToneDetect (unsigned line, unsigned timeout=3000) |
| virtual BOOL | WaitForTone (unsigned line, CallProgressTones tone, unsigned timeout=3000) |
| virtual BOOL | SetToneFilter (unsigned line, CallProgressTones tone, const PString &description) |
| 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 | PlayAudio (unsigned line, const PString &filename) |
| virtual BOOL | StopAudio (unsigned line) |
| virtual BOOL | RecordAudioStart (unsigned line, const PString &filename) |
| virtual BOOL | RecordAudioStop (unsigned line) |
| virtual CallProgressTones | DialOut (unsigned line, const PString &number, BOOL requireTones=FALSE, unsigned uiDialDelay=0) |
| T35CountryCodes | GetCountryCode () const |
| PString | GetCountryCodeName () const |
| virtual BOOL | SetCountryCode (T35CountryCodes country) |
| virtual BOOL | SetCountryCodeName (const PString &countryName) |
| virtual PStringList | GetCountryCodeNameList () const |
| int | GetErrorNumber () const |
| PString | GetErrorText () const |
| virtual void | PrintOn (ostream &strm) const |
Static Public Methods | |
| PString | GetCountryCodeName (T35CountryCodes code) |
| T35CountryCodes | GetCountryCode (const PString &name) |
| OpalLineInterfaceDevice * | Create (const PString &type, void *parameters=NULL) |
| PStringList | GetAllTypes () |
| PStringList | GetAllDevices () |
Protected Methods | |
| int | getOsHandle () const |
| void | setOsHandle (int os_handleToSet) |
| int | getOsError () const |
| void | setOsError (int osErrorToSet) |
| const PBYTEArray & | getReadDeblockingBuffer () |
| const PBYTEArray & | getWriteDeblockingBuffer () |
| PINDEX | getReadDeblockingOffset () const |
| void | setReadDeblockingOffset (PINDEX readDeblockingOffset) |
| PINDEX | getWriteDeblockingOffset () const |
| void | setWriteDeblockingOffset (PINDEX writeDeblockingOffset) |
| unsigned int | getCardNumber () const |
| void | setCardNumber (unsigned int uiCardNumber) |
| unsigned int | getDialToneTimeout () const |
| void | setDialToneTimeout (unsigned int uiDialToneTimeout) |
Protected Attributes | |
| int | os_handle |
| int | osError |
| T35CountryCodes | countryCode |
| PBYTEArray | m_readDeblockingBuffer |
| PBYTEArray | m_writeDeblockingBuffer |
| PINDEX | m_readDeblockingOffset |
| PINDEX | m_writeDeblockingOffset |
| unsigned int | m_uiCardNumber |
| unsigned int | m_uiDialToneTimeout |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Construct a new line interface device. |
|
|
Close the line interface device. |
|
||||||||||||
|
Create a new device from the registration string
|
|
||||||||||||||||||||
|
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
|
|
|
Disable audio for the line.
|
|
||||||||||||
|
Enable audio for the line.
|
|
|
Get acoustic echo cancellation. Note, not all devices may support this function.
|
|
|
Return an array of all the LID types registered and all of the possible devices each one can open. Each string will be of the form "type: name" eg "Quicknet: 3211FFFF" |
|
|
Get all the possible devices that can be opened. |
|
|
Return an array of all the LID types registered. |
|
||||||||||||
|
Get average signal level in last frame.
|
|
||||||||||||||||
|
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').
|
|
|
|
|
|
|
|
|
Get the country code set for the device. |
|
|
Get the country code set for the device as a string. |
|
|
Get the country code set for the device as a string. |
|
|
Get the list of countries actually supported by the device |
|
|
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". |
|
|
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. |
|
|
Get the device type identifier. This is as is used in the factory registration. |
|
|
|
|
|
Return number for last error. |
|
|
Return text for last error. |
|
|
Get the total number of lines supported by this device. |
|
|
Get the media formats this device is capable of using. |
|
|
|
|
|
|
|
||||||||||||
|
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.
|
|
|
|
|
|
|
|
|
Get the media format (codec) for reading on the specified line.
|
|
|
Get the read frame size in bytes. All calls to ReadFrame() will return this number of bytes.
|
|
||||||||||||
|
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.
|
|
|
Get DTMF removal mode. When set in this mode the DTMF tones detected are removed from the encoded data stream as returned by ReadFrame().
|
|
|
Get voice activity detection. Note, not all devices, or selected codecs, may support this function.
|
|
|
Get wink detect minimum duration. This is the signal used by telcos to end PSTN call.
|
|
|
|
|
|
|
|
|
Get the media format (codec) for writing on the specified line.
|
|
|
Get the write frame size in bytes. All calls to WriteFrame() must be this number of bytes.
|
|
|
Return TRUE if a hook flash has been detected |
|
||||||||||||
|
Set the hook state off then straight back on again. This will only operate if the line is currently off hook.
|
|
|
Determine if audio for the line is enabled.
|
|
||||||||||||
|
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().
|
|
|
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.
|
|
||||||||||||
|
Determine if a physical line is present on the logical line.
|
|
||||||||||||
|
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.
|
|
|
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.
|
|
||||||||||||
|
Determine if the two lines are directly connected.
|
|
|
Determine if the line interface device is open. |
|
|
See if any tone is detected.
|
|
|
Determine if a tone is still playing
|
|
|
Open the line interface device.
|