00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260 #ifndef __OPAL_LID_H
00261 #define __OPAL_LID_H
00262
00263 #ifdef P_USE_PRAGMA
00264 #pragma interface
00265 #endif
00266
00267
00268 #include <opal/mediafmt.h>
00269
00270
00272
00276 class OpalLineInterfaceDevice : public PObject
00277 {
00278 PCLASSINFO(OpalLineInterfaceDevice, PObject);
00279
00280 public:
00283 OpalLineInterfaceDevice();
00284
00287 virtual BOOL Open(
00288 const PString & device
00289 ) = 0;
00290
00293 virtual BOOL IsOpen() const;
00294
00297 virtual BOOL Close();
00298
00302 virtual PString GetDeviceType() const = 0;
00303
00308 virtual PString GetDeviceName() const = 0;
00309
00312 virtual PStringArray GetAllNames() const = 0;
00313
00319 virtual PString GetDescription() const = 0;
00320
00323 virtual unsigned GetLineCount() = 0;
00324
00331 virtual BOOL IsLineTerminal(
00332 unsigned line
00333 );
00334
00335
00338 virtual BOOL IsLinePresent(
00339 unsigned line,
00340 BOOL force = FALSE
00341 );
00342
00343
00349 virtual BOOL IsLineOffHook(
00350 unsigned line
00351 ) = 0;
00352
00358 virtual BOOL SetLineOffHook(
00359 unsigned line,
00360 BOOL newState = TRUE
00361 ) = 0;
00362
00366 virtual BOOL SetLineOnHook(
00367 unsigned line
00368 ) { return SetLineOffHook(line, FALSE); }
00369
00373 virtual BOOL HookFlash(
00374 unsigned line,
00375 unsigned flashTime = 200
00376 );
00377
00380 virtual BOOL HasHookFlash(unsigned line);
00381
00382
00393 virtual BOOL IsLineRinging(
00394 unsigned line,
00395 DWORD * cadence = NULL
00396 );
00397
00408 virtual BOOL RingLine(
00409 unsigned line,
00410 DWORD cadence
00411 );
00412
00427 virtual BOOL RingLine(
00428 unsigned line,
00429 PINDEX nCadence,
00430 unsigned * pattern
00431 );
00432
00433
00440 virtual BOOL IsLineDisconnected(
00441 unsigned line,
00442 BOOL checkForWink = TRUE
00443 );
00444
00445
00448 virtual BOOL SetLineToLineDirect(
00449 unsigned line1,
00450 unsigned line2,
00451 BOOL connect
00452 );
00453
00456 virtual BOOL IsLineToLineDirect(
00457 unsigned line1,
00458 unsigned line2
00459 );
00460
00461
00464 virtual OpalMediaFormatList GetMediaFormats() const = 0;
00465
00468 virtual BOOL SetReadFormat(
00469 unsigned line,
00470 const OpalMediaFormat & mediaFormat
00471 ) = 0;
00472
00475 virtual BOOL SetWriteFormat(
00476 unsigned line,
00477 const OpalMediaFormat & mediaFormat
00478 ) = 0;
00479
00482 virtual OpalMediaFormat GetReadFormat(
00483 unsigned line
00484 ) = 0;
00485
00488 virtual OpalMediaFormat GetWriteFormat(
00489 unsigned line
00490 ) = 0;
00491
00500 virtual BOOL SetReadCodec(
00501 unsigned line,
00502 RTP_DataFrame::PayloadTypes codec
00503 );
00504
00510 virtual BOOL SetWriteCodec(
00511 unsigned line,
00512 RTP_DataFrame::PayloadTypes codec
00513 );
00514
00525 virtual BOOL SetRawCodec(
00526 unsigned line
00527 );
00528
00531 virtual BOOL StopReadCodec(
00532 unsigned line
00533 );
00534
00537 virtual BOOL StopWriteCodec(
00538 unsigned line
00539 );
00540
00543 virtual BOOL StopRawCodec(
00544 unsigned line
00545 );
00546
00551 virtual BOOL SetReadFrameSize(
00552 unsigned line,
00553 PINDEX frameSize
00554 );
00555
00560 virtual BOOL SetWriteFrameSize(
00561 unsigned line,
00562 PINDEX frameSize
00563 );
00564
00568 virtual PINDEX GetReadFrameSize(
00569 unsigned line
00570 ) = 0;
00571
00575 virtual PINDEX GetWriteFrameSize(
00576 unsigned line
00577 ) = 0;
00578
00581 virtual BOOL ReadFrame(
00582 unsigned line,
00583 void * buf,
00584 PINDEX & count
00585 ) = 0;
00586
00589 virtual BOOL WriteFrame(
00590 unsigned line,
00591 const void * buf,
00592 PINDEX count,
00593 PINDEX & written
00594 ) = 0;
00595
00599 virtual BOOL ReadBlock(
00600 unsigned line,
00601 void * buf,
00602 PINDEX count
00603 );
00604
00607 virtual BOOL WriteBlock(
00608 unsigned line,
00609 const void * buf,
00610 PINDEX count
00611 );
00612
00613
00616 virtual unsigned GetAverageSignalLevel(
00617 unsigned line,
00618 BOOL playback
00619 );
00620
00621
00624 virtual BOOL EnableAudio(
00625 unsigned line,
00626 BOOL enable = TRUE
00627 );
00628
00631 BOOL DisableAudio(
00632 unsigned line
00633 ) { return EnableAudio(line, FALSE); }
00634
00637 virtual BOOL IsAudioEnabled(
00638 unsigned line
00639 );
00640
00641
00642 enum {
00643 MaxVolume = 100
00644 };
00645
00650 virtual BOOL SetRecordVolume(
00651 unsigned line,
00652 unsigned volume
00653 );
00654
00659 virtual BOOL SetPlayVolume(
00660 unsigned line,
00661 unsigned volume
00662 );
00663
00668 virtual BOOL GetRecordVolume(
00669 unsigned line,
00670 unsigned & volume
00671 );
00672
00677 virtual BOOL GetPlayVolume(
00678 unsigned line,
00679 unsigned & volume
00680 );
00681
00682
00683 enum AECLevels {
00684 AECOff,
00685 AECLow,
00686 AECMedium,
00687 AECHigh,
00688 AECAuto,
00689 AECAGC,
00690 AECError
00691 };
00692
00696 virtual AECLevels GetAEC(
00697 unsigned line
00698 );
00699
00703 virtual BOOL SetAEC(
00704 unsigned line,
00705 AECLevels level
00706 );
00707
00711 virtual unsigned GetWinkDuration(
00712 unsigned line
00713 );
00714
00718 virtual BOOL SetWinkDuration(
00719 unsigned line,
00720 unsigned winkDuration
00721 );
00722
00726 virtual BOOL GetVAD(
00727 unsigned line
00728 );
00729
00733 virtual BOOL SetVAD(
00734 unsigned line,
00735 BOOL enable
00736 );
00737
00738
00746 virtual BOOL GetCallerID(
00747 unsigned line,
00748 PString & idString,
00749 BOOL full = FALSE
00750 );
00751
00760 virtual BOOL SetCallerID(
00761 unsigned line,
00762 const PString & idString
00763 );
00764
00773 virtual BOOL SendCallerIDOnCallWaiting(
00774 unsigned line,
00775 const PString & idString
00776 );
00777
00780 virtual BOOL SendVisualMessageWaitingIndicator(
00781 unsigned line,
00782 BOOL on
00783 );
00784
00785
00786 enum {
00787 DefaultDTMFOnTime = 180,
00788 DefaultDTMFOffTime = 120
00789 };
00790
00794 virtual BOOL PlayDTMF(
00795 unsigned line,
00796 const char * digits,
00797 DWORD onTime = DefaultDTMFOnTime,
00798 DWORD offTime = DefaultDTMFOffTime
00799 );
00800
00810 virtual char ReadDTMF(
00811 unsigned line
00812 );
00813
00818 virtual BOOL GetRemoveDTMF(
00819 unsigned line
00820 );
00821
00826 virtual BOOL SetRemoveDTMF(
00827 unsigned line,
00828 BOOL removeTones
00829 );
00830
00831
00832 enum CallProgressTones {
00833 NoTone = 0x00,
00834 DialTone = 0x01,
00835 RingTone = 0x02,
00836 BusyTone = 0x04,
00837 ClearTone = 0x08,
00838 CNGTone = 0x10,
00839 AllTones = 0x1f
00840 };
00841
00844 virtual unsigned IsToneDetected(
00845 unsigned line
00846 );
00847
00850 virtual unsigned WaitForToneDetect(
00851 unsigned line,
00852 unsigned timeout = 3000
00853 );
00854
00857 virtual BOOL WaitForTone(
00858 unsigned line,
00859 CallProgressTones tone,
00860 unsigned timeout = 3000
00861 );
00862
00880 virtual BOOL SetToneFilter(
00881 unsigned line,
00882 CallProgressTones tone,
00883 const PString & description
00884 );
00885
00888 virtual BOOL SetToneFilterParameters(
00889 unsigned line,
00890 CallProgressTones tone,
00891 unsigned lowFrequency,
00892 unsigned highFrequency,
00893 PINDEX numCadences,
00894 const unsigned * onTimes,
00895 const unsigned * offTimes
00896 );
00897
00900 virtual BOOL PlayTone(
00901 unsigned line,
00902 CallProgressTones tone
00903 );
00904
00907 virtual BOOL IsTonePlaying(
00908 unsigned line
00909 );
00910
00913 virtual BOOL StopTone(
00914 unsigned line
00915 );
00916
00919 virtual BOOL PlayAudio(
00920 unsigned line,
00921 const PString & filename
00922 );
00923
00926 virtual BOOL StopAudio(
00927 unsigned line
00928 );
00929
00930
00946 virtual CallProgressTones DialOut(
00947 unsigned line,
00948 const PString & number,
00949 BOOL requireTones = FALSE
00950 );
00951
00952
00953 enum T35CountryCodes {
00954 Japan, Albania, Algeria, AmericanSamoa, Germany, Anguilla, AntiguaAndBarbuda,
00955 Argentina, Ascension, Australia, Austria, Bahamas, Bahrain, Bangladesh,
00956 Barbados, Belgium, Belize, Benin, Bermudas, Bhutan, Bolivia, Botswana,
00957 Brazil, BritishAntarcticTerritory, BritishIndianOceanTerritory,
00958 BritishVirginIslands, BruneiDarussalam, Bulgaria, Myanmar, Burundi,
00959 Byelorussia, Cameroon, Canada, CapeVerde, CaymanIslands,
00960 CentralAfricanRepublic, Chad, Chile, China, Colombia, Comoros, Congo,
00961 CookIslands, CostaRica, Cuba, Cyprus, Czechoslovakia, Cambodia,
00962 DemocraticPeoplesRepublicOfKorea, Denmark, Djibouti, DominicanRepublic,
00963 Dominica, Ecuador, Egypt, ElSalvador, EquatorialGuinea, Ethiopia,
00964 FalklandIslands, Fiji, Finland, France, FrenchPolynesia,
00965 FrenchSouthernAndAntarcticLands, Gabon, Gambia, Germany2, Angola, Ghana,
00966 Gibraltar, Greece, Grenada, Guam, Guatemala, Guernsey, Guinea, GuineaBissau,
00967 Guayana, Haiti, Honduras, Hongkong, Hungary, Iceland, India, Indonesia,
00968 Iran, Iraq, Ireland, Israel, Italy, CotedIvoire, Jamaica, Afghanistan,
00969 Jersey, Jordan, Kenya, Kiribati, KoreaRepublic, Kuwait, Lao, Lebanon,
00970 Lesotho, Liberia, Libya, Liechtenstein, Luxemborg, Macao, Madagascar,
00971 Malaysia, Malawi, Maldives, Mali, Malta, Mauritania, Mauritius, Mexico,
00972 Monaco, Mongolia, Montserrat, Morocco, Mozambique, Nauru, Nepal,
00973 Netherlands, NetherlandsAntilles, NewCaledonia, NewZealand, Nicaragua,
00974 Niger, Nigeria, Norway, Oman, Pakistan, Panama, PapuaNewGuinea, Paraguay,
00975 Peru, Philippines, Poland, Portugal, PuertoRico, Qatar, Romania, Rwanda,
00976 SaintKittsAndNevis, SaintCroix, SaintHelenaAndAscension, SaintLucia,
00977 SanMarino, SaintThomas, SaoTomeAndPrincipe, SaintVicentAndTheGrenadines,
00978 SaudiArabia, Senegal, Seychelles, SierraLeone, Singapore, SolomonIslands,
00979 Somalia, SouthAfrica, Spain, SriLanka, Sudan, Suriname, Swaziland, Sweden,
00980 Switzerland, Syria, Tanzania, Thailand, Togo, Tonga, TrinidadAndTobago,
00981 Tunisia, Turkey, TurksAndCaicosIslands, Tuvalu, Uganda, Ukraine,
00982 UnitedArabEmirates, UnitedKingdom, UnitedStates, BurkinaFaso, Uruguay,
00983 USSR, Vanuatu, VaticanCityState, Venezuela, VietNam, WallisAndFutuna,
00984 WesternSamoa, Yemen, Yemen2, Yugoslavia, Zaire, Zambia, Zimbabwe,
00985 NumCountryCodes,
00986 UnknownCountry = -1
00987 };
00988
00991 T35CountryCodes GetCountryCode() const { return countryCode; }
00992
00995 PString GetCountryCodeName() const;
00996
00999 static PString GetCountryCodeName(T35CountryCodes code);
01000 static T35CountryCodes GetCountryCode(const PString & name);
01001
01007 virtual BOOL SetCountryCode(
01008 T35CountryCodes country
01009 );
01010
01013 virtual BOOL SetCountryCodeName(
01014 const PString & countryName
01015 );
01016
01019 virtual PStringList GetCountryCodeNameList() const;
01020
01021
01024 int GetErrorNumber() const { return osError; }
01025
01028 PString GetErrorText() const;
01029
01030 virtual void PrintOn(
01031 ostream & strm
01032 ) const;
01033
01036 static OpalLineInterfaceDevice * Create(
01037 const PString & type,
01038 void * parameters = NULL
01039 );
01040
01043 static PStringList GetAllTypes();
01044
01049 static PStringList GetAllDevices();
01050
01051 protected:
01052 int os_handle;
01053 int osError;
01054 T35CountryCodes countryCode;
01055 PBYTEArray readDeblockingBuffer, writeDeblockingBuffer;
01056 PINDEX readDeblockingOffset, writeDeblockingOffset;
01057
01058 #if PTRACING
01059 friend ostream & operator<<(ostream & o, CallProgressTones t);
01060 #endif
01061 };
01062
01063
01064 PLIST(OpalLIDList, OpalLineInterfaceDevice);
01065
01066
01067
01070 class OpalLine : public PObject
01071 {
01072 PCLASSINFO(OpalLine, PObject);
01073 public:
01078 OpalLine(
01079 OpalLineInterfaceDevice & device,
01080 unsigned lineNumber,
01081 const char * description = NULL
01082 );
01084
01091 void PrintOn(
01092 ostream & strm
01093 ) const;
01095
01104 virtual BOOL IsTerminal() { return device.IsLineTerminal(lineNumber); }
01105
01106
01109 virtual BOOL IsPresent(
01110 BOOL force = FALSE
01111 ) { return device.IsLinePresent(lineNumber, force); }
01112
01113
01119 virtual BOOL IsOffHook() { return device.IsLineOffHook(lineNumber); }
01120
01126 virtual BOOL SetOffHook(
01127 BOOL newState = TRUE
01128 ) { return device.SetLineOffHook(lineNumber, newState); }
01129
01133 virtual BOOL SetOnHook() { return SetOffHook(FALSE); }
01134
01138 virtual BOOL HookFlash(
01139 unsigned flashTime = 200
01140 ) { return device.HookFlash(lineNumber, flashTime); }
01141
01144 virtual BOOL HasHookFlash() { return device.HasHookFlash(lineNumber); }
01145
01146
01157 virtual BOOL IsRinging(
01158 DWORD * cadence = NULL
01159 ) { return device.IsLineRinging(lineNumber, cadence); }
01160
01164 virtual unsigned GetRingCount(
01165 DWORD * cadence = NULL
01166 );
01167
01178 virtual BOOL Ring(
01179 DWORD cadence
01180 ) { return device.RingLine(lineNumber, cadence); }
01181
01196 virtual BOOL Ring(
01197 PINDEX nCadence,
01198 unsigned * pattern
01199 ) { return device.RingLine(lineNumber, nCadence, pattern); }
01200
01201
01205 virtual BOOL IsDisconnected() { return device.IsLineDisconnected(lineNumber); }
01206
01209 virtual BOOL SetReadFormat(
01210 const OpalMediaFormat & mediaFormat
01211 ) { return device.SetReadFormat(lineNumber, mediaFormat); }
01212
01215 virtual BOOL SetWriteFormat(
01216 const OpalMediaFormat & mediaFormat
01217 ) { return device.SetWriteFormat(lineNumber, mediaFormat); }
01218
01221 virtual OpalMediaFormat GetReadFormat() { return device.GetReadFormat(lineNumber); }
01222
01225 virtual OpalMediaFormat GetWriteFormat() { return device.GetWriteFormat(lineNumber); }
01226
01237 virtual BOOL SetRawCodec() { return device.SetRawCodec(lineNumber); }
01238
01241 virtual BOOL StopReadCodec() { return device.StopReadCodec(lineNumber); }
01242
01245 virtual BOOL StopWriteCodec() { return device.StopWriteCodec(lineNumber); }
01246
01249 virtual BOOL StopRawCodec() { return device.StopRawCodec(lineNumber); }
01250
01255 virtual BOOL SetReadFrameSize(
01256 PINDEX frameSize
01257 ) { return device.SetReadFrameSize(lineNumber, frameSize); }
01258
01263 virtual BOOL SetWriteFrameSize(
01264 PINDEX frameSize
01265 ) { return device.SetWriteFrameSize(lineNumber, frameSize); }
01266
01270 virtual PINDEX GetReadFrameSize() { return device.GetReadFrameSize(lineNumber); }
01271
01275 virtual PINDEX GetWriteFrameSize() { return device.GetWriteFrameSize(lineNumber); }
01276
01279 virtual BOOL ReadFrame(
01280 void * buf,
01281 PINDEX & count
01282 ) { return device.ReadFrame(lineNumber, buf, count); }
01283
01286 virtual BOOL WriteFrame(
01287 const void * buf,
01288 PINDEX count,
01289 PINDEX & written
01290 ) { return device.WriteFrame(lineNumber, buf, count, written); }
01291
01295 virtual BOOL ReadBlock(
01296 void * buf,
01297 PINDEX count
01298 ) { return device.ReadBlock(lineNumber, buf, count); }
01299
01302 virtual BOOL WriteBlock(
01303 const void * buf,
01304 PINDEX count
01305 ) { return device.WriteBlock(lineNumber, buf, count); }
01306
01307
01310 virtual unsigned GetAverageSignalLevel(
01311 BOOL playback
01312 ) { return device.GetAverageSignalLevel(lineNumber, playback); }
01313
01314
01317 virtual BOOL EnableAudio(
01318 BOOL enable = TRUE
01319 ) { return device.EnableAudio(lineNumber, enable); }
01320
01323 BOOL DisableAudio() { return EnableAudio(FALSE); }
01324
01327 virtual BOOL IsAudioEnabled() { return device.IsAudioEnabled(lineNumber); }
01328
01329
01334 virtual BOOL SetRecordVolume(
01335 unsigned volume
01336 ) { return device.SetRecordVolume(lineNumber, volume); }
01337
01342 virtual BOOL SetPlayVolume(
01343 unsigned volume
01344 ) { return device.SetPlayVolume(lineNumber, volume); }
01345
01350 virtual BOOL GetRecordVolume(
01351 unsigned & volume
01352 ) { return device.GetRecordVolume(lineNumber, volume); }
01353
01358 virtual BOOL GetPlayVolume(
01359 unsigned & volume
01360 ) { return device.GetPlayVolume(lineNumber, volume); }
01361
01362
01366 virtual OpalLineInterfaceDevice::AECLevels GetAEC() { return device.GetAEC(lineNumber); }
01367
01371 virtual BOOL SetAEC(
01372 OpalLineInterfaceDevice::AECLevels level
01373 ) { return device.SetAEC(lineNumber, level); }
01374
01375
01379 virtual BOOL GetVAD() { return device.GetVAD(lineNumber); }
01380
01384 virtual BOOL SetVAD(
01385 BOOL enable
01386 ) { return device.SetVAD(lineNumber, enable); }
01387
01388
01396 virtual BOOL GetCallerID(
01397 PString & idString,
01398 BOOL full = FALSE
01399 ) { return device.GetCallerID(lineNumber, idString, full); }
01400
01409 virtual BOOL SetCallerID(
01410 const PString & idString
01411 ) { return device.SetCallerID(lineNumber, idString); }
01412
01421 virtual BOOL SendCallerIDOnCallWaiting(
01422 const PString & idString
01423 ) { return device.SendCallerIDOnCallWaiting(lineNumber, idString); }
01424
01427 virtual BOOL SendVisualMessageWaitingIndicator(
01428 BOOL on
01429 ) { return device.SendVisualMessageWaitingIndicator(lineNumber, on); }
01430
01431
01435 virtual BOOL PlayDTMF(
01436 const char * digits,
01437 DWORD onTime = OpalLineInterfaceDevice::DefaultDTMFOnTime,
01438 DWORD offTime = OpalLineInterfaceDevice::DefaultDTMFOffTime
01439 ) { return device.PlayDTMF(lineNumber, digits, onTime, offTime); }
01440
01450 virtual char ReadDTMF() { return device.ReadDTMF(lineNumber); }
01451
01456 virtual BOOL GetRemoveDTMF() { return device.GetRemoveDTMF(lineNumber); }
01457
01462 virtual BOOL SetRemoveDTMF(
01463 BOOL removeTones
01464 ) { return device.SetRemoveDTMF(lineNumber, removeTones); }
01465
01466
01469 virtual unsigned IsToneDetected() { return device.IsToneDetected(lineNumber); }
01470
01473 virtual unsigned WaitForToneDetect(
01474 unsigned timeout = 3000
01475 ) { return device.WaitForToneDetect(lineNumber, timeout); }
01476
01479 virtual BOOL WaitForTone(
01480 OpalLineInterfaceDevice::CallProgressTones tone,
01481 unsigned timeout = 3000
01482 ) { return device.WaitForTone(lineNumber, tone, timeout); }
01483
01486 virtual BOOL PlayTone(
01487 OpalLineInterfaceDevice::CallProgressTones tone
01488 ) { return device.PlayTone(lineNumber, tone); }
01489
01492 virtual BOOL IsTonePlaying() { return device.IsTonePlaying(lineNumber); }
01493
01496 virtual BOOL StopTone() { return device.StopTone(lineNumber); }
01497
01498
01514 virtual OpalLineInterfaceDevice::CallProgressTones DialOut(
01515 const PString & number,
01516 BOOL requireTones = FALSE
01517 ) { return device.DialOut(lineNumber, number, requireTones); }
01519
01524 OpalLineInterfaceDevice & GetDevice() const { return device; }
01525
01528 unsigned GetLineNumber() const { return lineNumber; }
01529
01532 PString GetToken() const { return token; }
01533
01536 PString GetDescription() const { return description; }
01538
01539 protected:
01540 OpalLineInterfaceDevice & device;
01541 unsigned lineNumber;
01542 PString token;
01543 PString description;
01544 unsigned ringCount;
01545 PTimeInterval ringTick;
01546 PTimeInterval ringStoppedTime;
01547 PTimeInterval ringInterCadenceTime;
01548 };
01549
01550
01551 PLIST(OpalLineList, OpalLine);
01552
01553
01560 class OpalLIDRegistration : public PCaselessString
01561 {
01562 PCLASSINFO(OpalLIDRegistration, PCaselessString);
01563 public:
01568 OpalLIDRegistration(
01569 const char * name
01570 );
01572
01577 virtual OpalLineInterfaceDevice * Create(
01578 void * parameters
01579 ) const = 0;
01581
01582 protected:
01583 OpalLIDRegistration * link;
01584
01585 friend class OpalLineInterfaceDevice;
01586 };
01587
01588
01589 #define OPAL_REGISTER_LID_FUNCTION(cls, type, param) \
01590 static class cls##_Registration : public OpalLIDRegistration { \
01591 public: \
01592 cls##_Registration() : OpalLIDRegistration(type) { } \
01593 OpalLineInterfaceDevice * Create(void * param) const; \
01594 } instance_##cls##_Registration; \
01595 OpalLineInterfaceDevice * cls##_Registration::Create(void * param) const
01596
01597 #ifndef OPAL_NO_PARAM
01598 #define OPAL_NO_PARAM
01599 #endif
01600
01601 #define OPAL_REGISTER_LID(cls, type) \
01602 OPAL_REGISTER_LID_FUNCTION(cls, type, OPAL_NO_PARAM) \
01603 { return new cls; }
01604
01605 #define OPAL_REGISTER_LID_PARAM(cls, type) \
01606 OPAL_REGISTER_LID_FUNCTION(cls, type, parameter) \
01607 { return new cls(parameter); }
01608
01609
01610 #endif // __OPAL_LID_H
01611
01612
01613