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 #ifndef IES_H
00069 #define IES_H
00070
00071 #ifndef _PTLIB_H
00072 #include <ptlib.h>
00073 #endif
00074
00075 #include <ptlib/sockets.h>
00076 #include <iax2/iedata.h>
00077
00078 #ifdef P_USE_PRAGMA
00079 #pragma interface
00080 #endif
00081
00082
00083 class IAX2Ie;
00084 class IAX2Encryption;
00085
00087 class IAX2Ie : public PObject
00088 {
00089 PCLASSINFO(IAX2Ie, PObject);
00090 public:
00092 enum IAX2IeTypeCode {
00093 ie_calledNumber = 1,
00094 ie_callingNumber = 2,
00095 ie_callingAni = 3,
00096 ie_callingName = 4,
00097 ie_calledContext = 5,
00098 ie_userName = 6,
00099 ie_password = 7,
00100 ie_capability = 8,
00101 ie_format = 9,
00102 ie_language = 10,
00103 ie_version = 11,
00104 ie_adsicpe = 12,
00105 ie_dnid = 13,
00106 ie_authMethods = 14,
00107 ie_challenge = 15,
00108 ie_md5Result = 16,
00109 ie_rsaResult = 17,
00110 ie_apparentAddr = 18,
00111 ie_refresh = 19,
00112 ie_dpStatus = 20,
00113 ie_callNo = 21,
00114 ie_cause = 22,
00115 ie_iaxUnknown = 23,
00116 ie_msgCount = 24,
00117 ie_autoAnswer = 25,
00118 ie_musicOnHold = 26,
00119 ie_transferId = 27,
00120 ie_rdnis = 28,
00121 ie_provisioning = 29,
00122 ie_aesProvisioning = 30,
00123 ie_dateTime = 31,
00124 ie_deviceType = 32,
00125 ie_serviceIdent = 33,
00126 ie_firmwareVer = 34,
00127 ie_fwBlockDesc = 35,
00128 ie_fwBlockData = 36,
00129 ie_provVer = 37,
00130 ie_callingPres = 38,
00131 ie_callingTon = 39,
00132 ie_callingTns = 40,
00133 ie_samplingRate = 41,
00134 ie_causeCode = 42,
00135 ie_encryption = 43,
00136 ie_encKey = 44,
00137 ie_codecPrefs = 45,
00138 ie_recJitter = 46,
00139 ie_recLoss = 47,
00140 ie_recPackets = 48,
00141 ie_recDelay = 49,
00142 ie_recDropped = 50,
00143 ie_recOoo = 51
00144 };
00145
00148
00150 IAX2Ie();
00151
00153 virtual ~IAX2Ie() { };
00155
00159 static IAX2Ie *BuildInformationElement(BYTE _typeCode, BYTE length, BYTE *srcData);
00160
00162 virtual PBoolean IsValid() { return validData; }
00163
00165 virtual BYTE GetLengthOfData() { return 0; }
00166
00168 int GetBinarySize() { return 2 + GetLengthOfData(); }
00169
00171 void PrintOn(ostream & str) const;
00172
00174 virtual BYTE GetKeyValue() const { return 255; }
00175
00177 void SetData(int &) { PAssertAlways("Ie class cannnot set data value"); };
00178
00180 int ReadData() { PAssertAlways("Ie class cannot read the internal data value"); return 0; };
00181
00184 void WriteBinary(void *data, PINDEX & writeIndex);
00185
00188 virtual void StoreDataIn(IAX2IeData &) { PTRACE(0, "UNIMPLEMENTED FUNCTION"); }
00190
00191 protected:
00193 virtual void WriteBinary(BYTE * ) { PTRACE(0, "UNIMPLEMENTED FUNCTION"); }
00194
00197 PBoolean validData;
00198 };
00199
00201
00202 class IAX2IeInvalidElement : public IAX2Ie
00203 {
00204 PCLASSINFO(IAX2IeInvalidElement, IAX2Ie);
00205 public:
00206 IAX2IeInvalidElement() : IAX2Ie() {};
00207
00209 virtual BYTE GetlengthOfData() { return 0; }
00210
00212 void PrintOn(ostream & str) const
00213 { str << "Invlalid Information Element" << endl; }
00214 protected:
00217 virtual void WriteBinary(BYTE * ) { }
00218 };
00220
00221 class IAX2IeNone : public IAX2Ie
00222 {
00223 PCLASSINFO(IAX2IeNone, IAX2Ie);
00226
00230 IAX2IeNone(BYTE length, BYTE *srcData);
00231
00233 IAX2IeNone() : IAX2Ie() {}
00235
00239 virtual BYTE GetLengthOfData() { return 0; }
00240
00242 BYTE GetValue() { return 0; }
00243
00245 void PrintOn(ostream & str) const;
00246
00248 void SetData(void * ) { PAssertAlways("IeNone cannot set data"); }
00249
00251 int ReadData() { PAssertAlways("IeNone cannot read the internal data value"); return 0; }
00252
00254 protected:
00257 virtual void WriteBinary(BYTE * ) { }
00258 };
00259
00261
00262 class IAX2IeByte : public IAX2Ie
00263 {
00264 PCLASSINFO(IAX2IeByte, IAX2Ie);
00267
00271 IAX2IeByte(BYTE length, BYTE *srcData);
00272
00274 IAX2IeByte(BYTE newValue) : IAX2Ie() { SetData(newValue); }
00275
00277 IAX2IeByte() : IAX2Ie() { }
00279
00283 virtual BYTE GetLengthOfData() { return sizeof(dataValue); }
00284
00286 void PrintOn(ostream & str) const;
00287
00289 void SetData(BYTE newData) { dataValue = newData; validData = PTrue; }
00290
00292 BYTE ReadData() { return dataValue; }
00293
00295 protected:
00297 virtual void WriteBinary(BYTE *data) { data[0] = dataValue; }
00298
00300 BYTE dataValue;
00301 };
00302
00304
00305 class IAX2IeChar : public IAX2Ie
00306 {
00307 PCLASSINFO(IAX2IeChar, IAX2Ie);
00310
00314 IAX2IeChar(BYTE length, BYTE *srcData);
00315
00317 IAX2IeChar(char newValue) : IAX2Ie() { SetData(newValue); }
00318
00320 IAX2IeChar() : IAX2Ie() { }
00322
00326 virtual BYTE GetLengthOfData() { return sizeof(dataValue); }
00327
00329 void PrintOn(ostream & str) const;
00330
00332 void SetData(char newData) { dataValue = newData; validData = PTrue; }
00333
00335 char ReadData() { return dataValue; }
00336
00338 protected:
00340 virtual void WriteBinary(BYTE *data) { data[0] = dataValue; }
00341
00343 char dataValue;
00344 };
00345
00347
00348 class IAX2IeShort : public IAX2Ie
00349 {
00350 PCLASSINFO(IAX2IeShort, IAX2Ie);
00353
00357 IAX2IeShort(BYTE length, BYTE *srcData);
00358
00360 IAX2IeShort(short newValue) : IAX2Ie() { SetData(newValue); }
00361
00363 IAX2IeShort() : IAX2Ie() { }
00365
00369 virtual BYTE GetLengthOfData() { return sizeof(dataValue); }
00370
00372 void PrintOn(ostream & str) const;
00373
00375 void SetData(short newData) { dataValue = newData; validData = PTrue; }
00376
00378 short ReadData() { return dataValue; }
00380 protected:
00382 virtual void WriteBinary(BYTE *data);
00383
00385 short dataValue;
00386 };
00388
00389 class IAX2IeInt : public IAX2Ie
00390 {
00391 PCLASSINFO(IAX2IeInt, IAX2Ie);
00394
00398 IAX2IeInt(BYTE length, BYTE *srcData);
00399
00401 IAX2IeInt(int newValue) : IAX2Ie() { SetData(newValue); }
00402
00404 IAX2IeInt() : IAX2Ie() { }
00406
00410 virtual BYTE GetLengthOfData() { return sizeof(dataValue); }
00411
00413 void PrintOn(ostream & str) const;
00414
00416 void SetData(int newData) { dataValue = newData; validData = PTrue; }
00417
00419 int ReadData() { return dataValue; }
00420
00422 protected:
00424 virtual void WriteBinary(BYTE *data);
00425
00427 int dataValue;
00428 };
00430
00431 class IAX2IeUShort : public IAX2Ie
00432 {
00433 PCLASSINFO(IAX2IeUShort, IAX2Ie);
00436
00440 IAX2IeUShort(BYTE length, BYTE *srcData);
00441
00443 IAX2IeUShort(unsigned short newValue) : IAX2Ie() { SetData(newValue); }
00444
00446 IAX2IeUShort() : IAX2Ie() {}
00448
00452 virtual BYTE GetLengthOfData() { return sizeof(dataValue); }
00453
00455 void PrintOn(ostream & str) const;
00456
00458 void SetData(unsigned short newData) { dataValue = newData; validData = PTrue; }
00459
00461 unsigned short ReadData() { return dataValue; }
00463 protected:
00465 virtual void WriteBinary(BYTE *data);
00466
00468 unsigned short dataValue;
00469 };
00471
00472 class IAX2IeUInt : public IAX2Ie
00473 {
00474 PCLASSINFO(IAX2IeUInt, IAX2Ie);
00477
00481 IAX2IeUInt(BYTE length, BYTE *srcData);
00482
00484 IAX2IeUInt() : IAX2Ie() {}
00485
00487 IAX2IeUInt(unsigned int newValue) { SetData(newValue); }
00489
00493 virtual BYTE GetLengthOfData() { return sizeof(dataValue); }
00494
00496 void PrintOn(ostream & str) const;
00497
00499 void SetData(unsigned int &newData) { dataValue = newData; validData = PTrue; }
00500
00502 unsigned int ReadData() { return dataValue; }
00504
00505 protected:
00507 virtual void WriteBinary(BYTE *data);
00508
00510 unsigned int dataValue;
00511 };
00512
00514
00515 class IAX2IeString : public IAX2Ie
00516 {
00517 PCLASSINFO(IAX2IeString, IAX2Ie);
00520
00521 public:
00525 IAX2IeString(BYTE length, BYTE *srcData);
00526
00528 IAX2IeString(const PString & newValue) : IAX2Ie() { SetData(newValue); }
00529
00531 IAX2IeString(const char * newValue) : IAX2Ie() { SetData(newValue); }
00532
00534 IAX2IeString() : IAX2Ie() {}
00536
00540 virtual BYTE GetLengthOfData();
00541
00543 void PrintOn(ostream & str) const;
00544
00546 void SetData(const PString & newData);
00547
00549 void SetData(const char * newData);
00550
00552 PString ReadData() { return dataValue; }
00554
00555 protected:
00557 virtual void WriteBinary(BYTE *data);
00558
00560 PString dataValue;
00561 };
00563
00564 class IAX2IeDateAndTime : public IAX2Ie
00565 {
00566 PCLASSINFO(IAX2IeDateAndTime, IAX2Ie);
00569
00570 public:
00574 IAX2IeDateAndTime(BYTE length, BYTE *srcData);
00575
00577 IAX2IeDateAndTime(const PTime & newValue) : IAX2Ie() { SetData(newValue); }
00578
00580 IAX2IeDateAndTime() : IAX2Ie() {}
00582
00586 void PrintOn(ostream & str) const;
00587
00589 virtual BYTE GetLengthOfData() { return 4; }
00590
00592 void SetData(const PTime & newData) { dataValue = newData; validData = PTrue; }
00593
00595 PTime ReadData() { return dataValue; }
00597 protected:
00599 virtual void WriteBinary(BYTE *data);
00600
00602 PTime dataValue;
00603 };
00605
00606 class IAX2IeBlockOfData : public IAX2Ie
00607 {
00608 PCLASSINFO(IAX2IeBlockOfData, IAX2Ie);
00611
00612 public:
00616 IAX2IeBlockOfData(BYTE length, BYTE *srcData);
00617
00619 IAX2IeBlockOfData(const PBYTEArray & newData) : IAX2Ie() { SetData(newData); }
00620
00622 IAX2IeBlockOfData() : IAX2Ie() {}
00624
00628 void PrintOn(ostream & str) const;
00629
00631 virtual BYTE GetLengthOfData() { return (BYTE)dataValue.GetSize(); }
00632
00634 void SetData(const PBYTEArray & newData) { dataValue = newData; validData = PTrue; }
00635
00637 PBYTEArray ReadData() { return dataValue; }
00638
00640 protected:
00642 virtual void WriteBinary(BYTE *data);
00643
00645 PBYTEArray dataValue;
00646 };
00648
00649 class IAX2IeSockaddrIn : public IAX2Ie
00650 {
00651 PCLASSINFO(IAX2IeSockaddrIn, IAX2Ie);
00654
00655 public:
00659 IAX2IeSockaddrIn(BYTE length, BYTE *srcData);
00660
00662 IAX2IeSockaddrIn(const PIPSocket::Address & addr, PINDEX port) : IAX2Ie() { SetData(addr, port); }
00663
00665 IAX2IeSockaddrIn() : IAX2Ie() {}
00666
00668 ~IAX2IeSockaddrIn() { } ;
00670
00674 void PrintOn(ostream & str) const;
00675
00677 virtual BYTE GetLengthOfData() { return sizeof(struct sockaddr_in); }
00678
00679
00681 void SetData(const PIPSocket::Address & newAddr, PINDEX newPort)
00682 { dataValue = newAddr; portNumber = newPort; validData = PTrue; }
00683
00685 PIPSocket::Address ReadData() { return dataValue; }
00686
00688 protected:
00690 virtual void WriteBinary(BYTE *data);
00691
00693 PIPSocket::Address dataValue;
00694
00696 PINDEX portNumber;
00697 };
00698
00700
00701 class IAX2IeCalledNumber : public IAX2IeString
00702 {
00703 PCLASSINFO(IAX2IeCalledNumber, IAX2IeString);
00704 public:
00708 IAX2IeCalledNumber(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) {};
00709
00711 IAX2IeCalledNumber(const PString & newValue) { SetData(newValue); }
00712
00714 void PrintOn(ostream & str) const;
00715
00717 virtual BYTE GetKeyValue() const { return ie_calledNumber; }
00718
00721 virtual void StoreDataIn(IAX2IeData &res) { res.calledNumber = dataValue; }
00722 protected:
00723 };
00725
00726 class IAX2IeCallingNumber : public IAX2IeString
00727 {
00728 PCLASSINFO(IAX2IeCallingNumber, IAX2IeString);
00729 public:
00733 IAX2IeCallingNumber(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
00734
00736 IAX2IeCallingNumber(const PString & newValue) { SetData(newValue); }
00737
00739 void PrintOn(ostream & str) const;
00740
00742 virtual BYTE GetKeyValue() const { return ie_callingNumber; }
00743
00746 virtual void StoreDataIn(IAX2IeData &res) { res.callingNumber = dataValue; }
00747 protected:
00748 };
00749
00751
00752 class IAX2IeCallingAni : public IAX2IeString
00753 {
00754 PCLASSINFO(IAX2IeCallingAni, IAX2IeString);
00755 public:
00759 IAX2IeCallingAni(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
00760
00762 IAX2IeCallingAni(const PString & newValue) { SetData(newValue); }
00763
00765 void PrintOn(ostream & str) const;
00766
00768 virtual BYTE GetKeyValue() const { return ie_callingAni; }
00769
00772 virtual void StoreDataIn(IAX2IeData &res) { res.callingAni = dataValue; }
00773 protected:
00774 };
00775
00777
00778 class IAX2IeCallingName : public IAX2IeString
00779 {
00780 PCLASSINFO(IAX2IeCallingName, IAX2IeString);
00781 public:
00785 IAX2IeCallingName(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
00786
00788 IAX2IeCallingName(const PString & newValue) { SetData(newValue); }
00789
00791 void PrintOn(ostream & str) const;
00792
00794 virtual BYTE GetKeyValue() const { return ie_callingName; }
00795
00798 virtual void StoreDataIn(IAX2IeData &res) { res.callingName = dataValue; }
00799 protected:
00800 };
00801
00803
00804 class IAX2IeCalledContext : public IAX2IeString
00805 {
00806 PCLASSINFO(IAX2IeCalledContext, IAX2IeString);
00807 public:
00811 IAX2IeCalledContext(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
00812
00814 IAX2IeCalledContext(const PString & newValue) { SetData(newValue); }
00815
00817 void PrintOn(ostream & str) const;
00818
00820 virtual BYTE GetKeyValue() const { return ie_calledContext; }
00821
00824 virtual void StoreDataIn(IAX2IeData &res) { res.calledContext = dataValue; }
00825 protected:
00826 };
00827
00829
00830 class IAX2IeUserName : public IAX2IeString
00831 {
00832 PCLASSINFO(IAX2IeUserName, IAX2IeString);
00833 public:
00837 IAX2IeUserName(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
00838
00840 IAX2IeUserName(const PString & newValue) { SetData(newValue); }
00841
00843 void PrintOn(ostream & str) const;
00844
00846 virtual BYTE GetKeyValue() const { return ie_userName; }
00847
00850 virtual void StoreDataIn(IAX2IeData &res) { res.userName = dataValue; }
00851 protected:
00852 };
00853
00855
00856 class IAX2IePassword : public IAX2IeString
00857 {
00858 PCLASSINFO(IAX2IePassword, IAX2IeString);
00859 public:
00863 IAX2IePassword(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
00864
00866 IAX2IePassword(const PString & newValue) { SetData(newValue); }
00867
00869 void PrintOn(ostream & str) const;
00870
00872 virtual BYTE GetKeyValue() const { return ie_password; }
00873
00876 virtual void StoreDataIn(IAX2IeData &res) { res.password = dataValue; }
00877 protected:
00878 };
00879
00881
00882 class IAX2IeCapability : public IAX2IeUInt
00883 {
00884 PCLASSINFO(IAX2IeCapability, IAX2IeUInt);
00885 public:
00889 IAX2IeCapability(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { };
00890
00892 IAX2IeCapability(unsigned int newValue) : IAX2IeUInt(newValue) { }
00893
00895 void PrintOn(ostream & str) const;
00896
00898 virtual BYTE GetKeyValue() const { return ie_capability; }
00899
00902 virtual void StoreDataIn(IAX2IeData &res) { res.capability = dataValue; }
00903 protected:
00904 };
00905
00907
00908 class IAX2IeFormat : public IAX2IeUInt
00909 {
00910 PCLASSINFO(IAX2IeFormat, IAX2IeUInt);
00911 public:
00915 IAX2IeFormat(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { };
00916
00918 IAX2IeFormat(unsigned int newValue) : IAX2IeUInt(newValue) { }
00919
00921 void PrintOn(ostream & str) const;
00922
00924 virtual BYTE GetKeyValue() const { return ie_format; }
00925
00928 virtual void StoreDataIn(IAX2IeData &res) { res.format = dataValue; }
00929 protected:
00930 };
00931
00933
00934 class IAX2IeLanguage : public IAX2IeString
00935 {
00936 PCLASSINFO(IAX2IeLanguage, IAX2IeString);
00937 public:
00941 IAX2IeLanguage(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
00942
00944 IAX2IeLanguage(const PString & newValue) { SetData(newValue); }
00945
00947 void PrintOn(ostream & str) const;
00948
00950 virtual BYTE GetKeyValue() const { return ie_language; }
00951
00954 virtual void StoreDataIn(IAX2IeData &res) { res.language = dataValue; }
00955 protected:
00956 };
00957
00959
00960 class IAX2IeVersion : public IAX2IeShort
00961 {
00962 PCLASSINFO(IAX2IeVersion, IAX2IeShort);
00963 public:
00967 IAX2IeVersion(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { };
00968
00970 IAX2IeVersion() { dataValue = 2; validData = PTrue; }
00971
00973 void PrintOn(ostream & str) const;
00974
00976 virtual BYTE GetKeyValue() const { return ie_version; }
00977
00980 virtual void StoreDataIn(IAX2IeData &res) { res.version = dataValue; }
00981 protected:
00982 };
00983
00985
00986 class IAX2IeAdsicpe : public IAX2IeShort
00987 {
00988 PCLASSINFO(IAX2IeAdsicpe, IAX2IeShort);
00989 public:
00993 IAX2IeAdsicpe(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { };
00994
00996 void PrintOn(ostream & str) const;
00997
00999 virtual BYTE GetKeyValue() const { return ie_adsicpe; }
01000
01003 virtual void StoreDataIn(IAX2IeData &res) { res.adsicpe = dataValue; }
01004 protected:
01005 };
01006
01008
01009 class IAX2IeDnid : public IAX2IeString
01010 {
01011 PCLASSINFO(IAX2IeDnid, IAX2IeString);
01012 public:
01016 IAX2IeDnid(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
01017
01019 IAX2IeDnid(const PString & newValue) { SetData(newValue); }
01020
01022 void PrintOn(ostream & str) const;
01023
01025 virtual BYTE GetKeyValue() const { return ie_dnid; }
01026
01029 virtual void StoreDataIn(IAX2IeData &res) { res.dnid = dataValue; }
01030 protected:
01031 };
01032
01034
01035 class IAX2IeAuthMethods : public IAX2IeShort
01036 {
01037 PCLASSINFO(IAX2IeAuthMethods, IAX2IeShort);
01038 public:
01042 IAX2IeAuthMethods(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { };
01043
01045 IAX2IeAuthMethods(short newValue) { SetData(newValue); }
01046
01048 void PrintOn(ostream & str) const;
01049
01051 virtual BYTE GetKeyValue() const { return ie_authMethods; }
01052
01055 virtual void StoreDataIn(IAX2IeData &res) { res.authMethods = dataValue; }
01056
01058 static PBoolean IsRsaAuthentication(short testValue) { return InternalIsRsa(testValue); }
01059
01061 static PBoolean IsMd5Authentication(short testValue) { return InternalIsMd5(testValue); }
01062
01064 static PBoolean IsPlainTextAuthentication(short testValue) { return InternalIsPlainText(testValue); }
01065
01067 PBoolean IsRsaAuthentication() { if (IsValid()) return InternalIsRsa(dataValue); else return PFalse; }
01068
01070 PBoolean IsMd5Authentication() { if (IsValid()) return InternalIsMd5(dataValue); else return PFalse; }
01071
01073 PBoolean IsPlainTextAuthentication() { if (IsValid()) return InternalIsPlainText(dataValue); else return PFalse; }
01074
01075 protected:
01076
01078 static PBoolean InternalIsRsa(short testValue) { return testValue & 0x04; }
01079
01081 static PBoolean InternalIsMd5(short testValue) { return testValue & 0x02; }
01082
01084 static PBoolean InternalIsPlainText(short testValue) { return testValue & 0x01; }
01085 };
01086
01088
01089 class IAX2IeChallenge : public IAX2IeString
01090 {
01091 PCLASSINFO(IAX2IeChallenge, IAX2IeString);
01092 public:
01096 IAX2IeChallenge(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
01097
01099 IAX2IeChallenge(const PString & newValue) { SetData(newValue); }
01100
01102 void PrintOn(ostream & str) const;
01103
01105 virtual BYTE GetKeyValue() const { return ie_challenge; }
01106
01109 virtual void StoreDataIn(IAX2IeData &res) { res.challenge = dataValue; }
01110 protected:
01111 };
01112
01114
01115 class IAX2IeMd5Result : public IAX2IeString
01116 {
01117 PCLASSINFO(IAX2IeMd5Result, IAX2IeString);
01118 public:
01122 IAX2IeMd5Result(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
01123
01125 IAX2IeMd5Result(const PString & newValue) { SetData(newValue); }
01126
01128 IAX2IeMd5Result(const PString & challenge, const PString & password);
01129
01131 IAX2IeMd5Result(IAX2Encryption & encryption);
01132
01134 void InitializeChallengePassword(const PString & newChallenge, const PString & newPassword);
01135
01137 void PrintOn(ostream & str) const;
01138
01140 virtual BYTE GetKeyValue() const { return ie_md5Result; }
01141
01144 virtual void StoreDataIn(IAX2IeData &res) { res.md5Result = dataValue; }
01145
01148 PBYTEArray & GetDataBlock() { return dataBlock; }
01149
01150 protected:
01151
01153 PBYTEArray dataBlock;
01154 };
01155
01157
01158 class IAX2IeRsaResult : public IAX2IeString
01159 {
01160 PCLASSINFO(IAX2IeRsaResult, IAX2IeString);
01161 public:
01165 IAX2IeRsaResult(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
01166
01168 IAX2IeRsaResult(const PString & newValue) { SetData(newValue); }
01169
01171 void PrintOn(ostream & str) const;
01172
01174 virtual BYTE GetKeyValue() const { return ie_rsaResult; }
01175
01178 virtual void StoreDataIn(IAX2IeData &res) { res.rsaResult = dataValue; }
01179 protected:
01180 };
01181
01183
01184 class IAX2IeApparentAddr : public IAX2IeSockaddrIn
01185 {
01186 PCLASSINFO(IAX2IeApparentAddr, IAX2IeSockaddrIn);
01187 public:
01191 IAX2IeApparentAddr(BYTE length, BYTE *srcData) : IAX2IeSockaddrIn(length, srcData) { };
01192
01194 ~IAX2IeApparentAddr() { };
01195
01197 void PrintOn(ostream & str) const;
01198
01200 virtual BYTE GetKeyValue() const { return ie_apparentAddr; }
01201
01204 virtual void StoreDataIn(IAX2IeData &res) { res.apparentAddr = dataValue; }
01205 protected:
01206 };
01207
01209
01210 class IAX2IeRefresh : public IAX2IeShort
01211 {
01212 PCLASSINFO(IAX2IeRefresh, IAX2IeShort);
01213 public:
01217 IAX2IeRefresh(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { };
01218
01220 IAX2IeRefresh(short refreshTime) : IAX2IeShort(refreshTime) { };
01221
01223 void PrintOn(ostream & str) const;
01224
01226 virtual BYTE GetKeyValue() const { return ie_refresh; }
01227
01230 virtual void StoreDataIn(IAX2IeData &res) { res.refresh = dataValue; }
01231 protected:
01232 };
01233
01235
01236 class IAX2IeDpStatus : public IAX2IeShort
01237 {
01238 PCLASSINFO(IAX2IeDpStatus, IAX2IeShort);
01239 public:
01243 IAX2IeDpStatus(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { };
01244
01246 void PrintOn(ostream & str) const;
01247
01249 virtual BYTE GetKeyValue() const { return ie_dpStatus; }
01250
01253 virtual void StoreDataIn(IAX2IeData &res) { res.dpStatus = dataValue; }
01254 protected:
01255 };
01256
01258
01259 class IAX2IeCallNo : public IAX2IeShort
01260 {
01261 PCLASSINFO(IAX2IeCallNo, IAX2IeShort);
01262 public:
01266 IAX2IeCallNo(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { };
01267
01269 void PrintOn(ostream & str) const;
01270
01272 virtual BYTE GetKeyValue() const { return ie_callNo; }
01273
01276 virtual void StoreDataIn(IAX2IeData &res) { res.callNo = dataValue; }
01277 protected:
01278 };
01279
01281
01282 class IAX2IeCause : public IAX2IeString
01283 {
01284 PCLASSINFO(IAX2IeCause, IAX2IeString);
01285 public:
01289 IAX2IeCause(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
01290
01292 IAX2IeCause(const PString & newValue) : IAX2IeString(newValue) { }
01293
01295 IAX2IeCause(const char *newValue) : IAX2IeString(newValue) { }
01296
01298 void PrintOn(ostream & str) const;
01299
01301 virtual BYTE GetKeyValue() const { return ie_cause; }
01302
01305 virtual void StoreDataIn(IAX2IeData &res) { res.cause = dataValue; }
01306 protected:
01307 };
01308
01310
01311 class IAX2IeIaxUnknown : public IAX2IeByte
01312 {
01313 PCLASSINFO(IAX2IeIaxUnknown, IAX2IeByte);
01314 public:
01318 IAX2IeIaxUnknown(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { };
01319
01321 IAX2IeIaxUnknown(BYTE newValue) : IAX2IeByte(newValue) { }
01322
01324 void PrintOn(ostream & str) const;
01325
01327 virtual BYTE GetKeyValue() const { return ie_iaxUnknown; }
01328
01331 virtual void StoreDataIn(IAX2IeData &res) { res.iaxUnknown = dataValue; }
01332 protected:
01333 };
01334
01336
01337 class IAX2IeMsgCount : public IAX2IeShort
01338 {
01339 PCLASSINFO(IAX2IeMsgCount, IAX2IeShort);
01340 public:
01344 IAX2IeMsgCount(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { };
01345
01347 void PrintOn(ostream & str) const;
01348
01350 virtual BYTE GetKeyValue() const { return ie_msgCount; }
01351
01354 virtual void StoreDataIn(IAX2IeData &res) { res.msgCount = dataValue; }
01355 protected:
01356 };
01357
01359
01360 class IAX2IeAutoAnswer : public IAX2IeNone
01361 {
01362 PCLASSINFO(IAX2IeAutoAnswer, IAX2IeNone);
01363 public:
01367 IAX2IeAutoAnswer(BYTE length, BYTE *srcData) : IAX2IeNone(length, srcData) { };
01368
01370 void PrintOn(ostream & str) const;
01371
01373 virtual BYTE GetKeyValue() const { return ie_autoAnswer; }
01374
01377 virtual void StoreDataIn(IAX2IeData &res) { res.autoAnswer = PTrue;; }
01378 protected:
01379 };
01380
01382
01383 class IAX2IeMusicOnHold : public IAX2IeNone
01384 {
01385 PCLASSINFO(IAX2IeMusicOnHold, IAX2IeNone);
01386 public:
01390 IAX2IeMusicOnHold(BYTE length, BYTE *srcData) : IAX2IeNone(length, srcData) { };
01391
01393 IAX2IeMusicOnHold() : IAX2IeNone() { };
01394
01396 void PrintOn(ostream & str) const;
01397
01399 virtual BYTE GetKeyValue() const { return ie_musicOnHold; }
01400
01403 virtual void StoreDataIn(IAX2IeData &res) { res.musicOnHold = PTrue; }
01404 protected:
01405 };
01406
01408
01409 class IAX2IeTransferId : public IAX2IeInt
01410 {
01411 PCLASSINFO(IAX2IeTransferId, IAX2IeInt);
01412 public:
01416 IAX2IeTransferId(BYTE length, BYTE *srcData) : IAX2IeInt(length, srcData) { };
01417
01419 void PrintOn(ostream & str) const;
01420
01422 virtual BYTE GetKeyValue() const { return ie_transferId; }
01423
01426 virtual void StoreDataIn(IAX2IeData &res) { res.transferId = dataValue; }
01427 protected:
01428 };
01429
01431
01432 class IAX2IeRdnis : public IAX2IeString
01433 {
01434 PCLASSINFO(IAX2IeRdnis, IAX2IeString);
01435 public:
01439 IAX2IeRdnis(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
01440
01442 void PrintOn(ostream & str) const;
01443
01445 virtual BYTE GetKeyValue() const { return ie_rdnis; }
01446
01449 virtual void StoreDataIn(IAX2IeData &res) { res.rdnis = dataValue; }
01450 protected:
01451 };
01452
01454
01455 class IAX2IeProvisioning : public IAX2IeBlockOfData
01456 {
01457 PCLASSINFO(IAX2IeProvisioning, IAX2IeBlockOfData);
01458 public:
01462 IAX2IeProvisioning(BYTE length, BYTE *srcData) : IAX2IeBlockOfData (length, srcData) { };
01463
01465 void PrintOn(ostream & str) const;
01466
01468 virtual BYTE GetKeyValue() const { return ie_provisioning; }
01469
01472 virtual void StoreDataIn(IAX2IeData &) { }
01473 protected:
01474 };
01475
01477
01478 class IAX2IeAesProvisioning : public IAX2IeNone
01479 {
01480 PCLASSINFO(IAX2IeAesProvisioning, IAX2IeNone);
01481 public:
01485 IAX2IeAesProvisioning(BYTE length, BYTE *srcData) : IAX2IeNone(length, srcData) { };
01486
01488 void PrintOn(ostream & str) const;
01489
01491 virtual BYTE GetKeyValue() const { return ie_aesProvisioning; }
01492
01495 virtual void StoreDataIn(IAX2IeData &) { }
01496 protected:
01497 };
01498
01500
01501 class IAX2IeDateTime : public IAX2IeDateAndTime
01502 {
01503 PCLASSINFO(IAX2IeDateTime, IAX2IeDateAndTime);
01504 public:
01508 IAX2IeDateTime(BYTE length, BYTE *srcData) : IAX2IeDateAndTime(length, srcData) { };
01509
01511 void PrintOn(ostream & str) const;
01512
01514 virtual BYTE GetKeyValue() const { return ie_dateTime; }
01515
01518 virtual void StoreDataIn(IAX2IeData &res) { res.dateTime = dataValue; }
01519 protected:
01520 };
01521
01523
01524 class IAX2IeDeviceType : public IAX2IeString
01525 {
01526 PCLASSINFO(IAX2IeDeviceType, IAX2IeString);
01527 public:
01531 IAX2IeDeviceType(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
01532
01534 void PrintOn(ostream & str) const;
01535
01537 virtual BYTE GetKeyValue() const { return ie_deviceType; }
01538
01541 virtual void StoreDataIn(IAX2IeData &res) { res.deviceType = dataValue; }
01542 protected:
01543 };
01544
01546
01547 class IAX2IeServiceIdent : public IAX2IeString
01548 {
01549 PCLASSINFO(IAX2IeServiceIdent, IAX2IeString);
01550 public:
01554 IAX2IeServiceIdent(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
01555
01557 void PrintOn(ostream & str) const;
01558
01560 virtual BYTE GetKeyValue() const { return ie_serviceIdent; }
01561
01564 virtual void StoreDataIn(IAX2IeData &res) { res.serviceIdent = dataValue; }
01565 protected:
01566 };
01567
01569
01570 class IAX2IeFirmwareVer : public IAX2IeShort
01571 {
01572 PCLASSINFO(IAX2IeFirmwareVer, IAX2IeShort);
01573 public:
01577 IAX2IeFirmwareVer(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { };
01578
01580 void PrintOn(ostream & str) const;
01581
01583 virtual BYTE GetKeyValue() const { return ie_firmwareVer; }
01584
01587 virtual void StoreDataIn(IAX2IeData &res) { res.firmwareVer = dataValue; }
01588 protected:
01589 };
01590
01592
01593 class IAX2IeFwBlockDesc : public IAX2IeUInt
01594 {
01595 PCLASSINFO(IAX2IeFwBlockDesc, IAX2IeUInt);
01596 public:
01600 IAX2IeFwBlockDesc(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { };
01601
01603 IAX2IeFwBlockDesc(unsigned int newValue) : IAX2IeUInt(newValue) { }
01604
01606 void PrintOn(ostream & str) const;
01607
01609 virtual BYTE GetKeyValue() const { return ie_fwBlockDesc; }
01610
01613 virtual void StoreDataIn(IAX2IeData &res) { res.fwBlockDesc = dataValue; }
01614 protected:
01615 };
01616
01618
01619 class IAX2IeFwBlockData : public IAX2IeBlockOfData
01620 {
01621 PCLASSINFO(IAX2IeFwBlockData, IAX2IeBlockOfData);
01622 public:
01626 IAX2IeFwBlockData(BYTE length, BYTE *srcData) : IAX2IeBlockOfData(length, srcData) { };
01627
01629 void PrintOn(ostream & str) const;
01630
01632 virtual BYTE GetKeyValue() const { return ie_fwBlockData; }
01633
01636 virtual void StoreDataIn(IAX2IeData &res) { res.fwBlockData = dataValue; }
01637 protected:
01638 };
01639
01641
01642 class IAX2IeProvVer : public IAX2IeUInt
01643 {
01644 PCLASSINFO(IAX2IeProvVer, IAX2IeUInt);
01645 public:
01649 IAX2IeProvVer(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { };
01650
01652 IAX2IeProvVer(unsigned int newValue) : IAX2IeUInt(newValue) { }
01653
01655 void PrintOn(ostream & str) const;
01656
01658 virtual BYTE GetKeyValue() const { return ie_provVer; }
01659
01662 virtual void StoreDataIn(IAX2IeData &res) { res.provVer = dataValue; }
01663 protected:
01664 };
01665
01667
01668 class IAX2IeCallingPres : public IAX2IeByte
01669 {
01670 PCLASSINFO(IAX2IeCallingPres, IAX2IeByte);
01671 public:
01675 IAX2IeCallingPres(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { };
01676
01678 void PrintOn(ostream & str) const;
01679
01681 virtual BYTE GetKeyValue() const { return ie_callingPres; }
01682
01685 virtual void StoreDataIn(IAX2IeData &res) { res.callingPres = dataValue; }
01686 protected:
01687 };
01688
01690
01691 class IAX2IeCallingTon : public IAX2IeByte
01692 {
01693 PCLASSINFO(IAX2IeCallingTon, IAX2IeByte);
01694 public:
01698 IAX2IeCallingTon(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { };
01699
01701 void PrintOn(ostream & str) const;
01702
01704 virtual BYTE GetKeyValue() const { return ie_callingTon; }
01705
01708 virtual void StoreDataIn(IAX2IeData &res) { res.callingTon = dataValue; }
01709 protected:
01710 };
01711
01713
01714 class IAX2IeCallingTns : public IAX2IeUShort
01715 {
01716 PCLASSINFO(IAX2IeCallingTns, IAX2IeUShort);
01717 public:
01721 IAX2IeCallingTns(BYTE length, BYTE *srcData) : IAX2IeUShort(length, srcData) { };
01722
01724 void PrintOn(ostream & str) const;
01725
01727 virtual BYTE GetKeyValue() const { return ie_callingTns; }
01728
01731 virtual void StoreDataIn(IAX2IeData &res) { res.callingTns = dataValue; }
01732 protected:
01733 };
01734
01736
01737 class IAX2IeSamplingRate : public IAX2IeUShort
01738 {
01739 PCLASSINFO(IAX2IeSamplingRate, IAX2IeUShort);
01740 public:
01744 IAX2IeSamplingRate(BYTE length, BYTE *srcData) : IAX2IeUShort(length, srcData) { };
01745
01747 void PrintOn(ostream & str) const;
01748
01750 virtual BYTE GetKeyValue() const { return ie_samplingRate; }
01751
01754 virtual void StoreDataIn(IAX2IeData &res) { res.samplingRate = dataValue; }
01755 protected:
01756 };
01757
01759
01760 class IAX2IeEncryption : public IAX2IeUShort
01761 {
01762 PCLASSINFO(IAX2IeEncryption, IAX2IeUShort);
01763 public:
01765 enum IAX2IeEncryptionMethod {
01766 encryptAes128 = 1
01767 };
01768
01770 IAX2IeEncryption(IAX2IeEncryptionMethod method = encryptAes128);
01771
01775 IAX2IeEncryption(BYTE length, BYTE *srcData) : IAX2IeUShort(length, srcData) { };
01776
01778 void PrintOn(ostream & str) const;
01779
01781 virtual BYTE GetKeyValue() const { return ie_encryption; }
01782
01785 virtual void StoreDataIn(IAX2IeData &res) { res.encryptionMethods = dataValue; }
01786 protected:
01787 };
01788
01790
01791 class IAX2IeEncKey : public IAX2IeString
01792 {
01793 PCLASSINFO(IAX2IeEncKey, IAX2IeString);
01794 public:
01798 IAX2IeEncKey(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { };
01799
01801 void PrintOn(ostream & str) const;
01802
01804 virtual BYTE GetKeyValue() const { return ie_encKey; }
01805
01808 virtual void StoreDataIn(IAX2IeData &res) { res.encKey = dataValue; }
01809 protected:
01810 };
01811
01813
01814 class IAX2IeCodecPrefs : public IAX2IeByte
01815 {
01816 PCLASSINFO(IAX2IeCodecPrefs, IAX2IeByte);
01817 public:
01821 IAX2IeCodecPrefs(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { };
01822
01824 void PrintOn(ostream & str) const;
01825
01827 virtual BYTE GetKeyValue() const { return ie_codecPrefs; }
01828
01831 virtual void StoreDataIn(IAX2IeData &res) { res.codecPrefs = dataValue; }
01832 protected:
01833 };
01834
01836
01837 class IAX2IeReceivedJitter : public IAX2IeUInt
01838 {
01839 PCLASSINFO(IAX2IeReceivedJitter, IAX2IeUInt);
01840 public:
01844 IAX2IeReceivedJitter(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { };
01845
01847 void PrintOn(ostream & str) const;
01848
01850 virtual BYTE GetKeyValue() const { return ie_recJitter; }
01851
01854 virtual void StoreDataIn(IAX2IeData &res) { res.receivedJitter = dataValue; }
01855 protected:
01856 };
01857
01859
01860 class IAX2IeReceivedLoss : public IAX2IeUInt
01861 {
01862 PCLASSINFO(IAX2IeReceivedLoss, IAX2IeUInt);
01863 public:
01867 IAX2IeReceivedLoss(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { };
01868
01870 void PrintOn(ostream & str) const;
01871
01873 virtual BYTE GetKeyValue() const { return ie_recLoss; }
01874
01877 virtual void StoreDataIn(IAX2IeData &res) { res.receivedLoss = dataValue; }
01878 protected:
01879 };
01880
01882
01883 class IAX2IeReceivedFrames : public IAX2IeUInt
01884 {
01885 PCLASSINFO(IAX2IeReceivedFrames, IAX2IeUInt);
01886 public:
01890 IAX2IeReceivedFrames(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { };
01891
01893 void PrintOn(ostream & str) const;
01894
01896 virtual BYTE GetKeyValue() const { return ie_recPackets; }
01897
01900 virtual void StoreDataIn(IAX2IeData &res) { res.receivedPackets = dataValue; }
01901 protected:
01902 };
01903
01905
01906 class IAX2IeReceivedDelay : public IAX2IeUShort
01907 {
01908 PCLASSINFO(IAX2IeReceivedDelay, IAX2IeUShort);
01909 public:
01913 IAX2IeReceivedDelay(BYTE length, BYTE *srcData) : IAX2IeUShort(length, srcData) { };
01914
01916 void PrintOn(ostream & str) const;
01917
01919 virtual BYTE GetKeyValue() const { return ie_recDelay; }
01920
01923 virtual void StoreDataIn(IAX2IeData &res) { res.receivedDelay = dataValue; }
01924 protected:
01925 };
01926
01928
01929 class IAX2IeDroppedFrames : public IAX2IeUInt
01930 {
01931 PCLASSINFO(IAX2IeDroppedFrames, IAX2IeUInt);
01932 public:
01936 IAX2IeDroppedFrames(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { };
01937
01939 void PrintOn(ostream & str) const;
01940
01942 virtual BYTE GetKeyValue() const { return ie_recDropped; }
01943
01946 virtual void StoreDataIn(IAX2IeData &res) { res.receivedDropped = dataValue; }
01947 protected:
01948 };
01949
01951
01952 class IAX2IeReceivedOoo : public IAX2IeUInt
01953 {
01954 PCLASSINFO(IAX2IeReceivedOoo, IAX2IeUInt);
01955 public:
01959 IAX2IeReceivedOoo(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { };
01960
01962 void PrintOn(ostream & str) const;
01963
01965 virtual BYTE GetKeyValue() const { return ie_recOoo; }
01966
01969 virtual void StoreDataIn(IAX2IeData &res) { res.receivedOoo = dataValue; }
01970 protected:
01971 };
01972
01974
01975
01976 PDECLARE_LIST (IAX2IeList, IAX2Ie *)
01977 #ifdef DOC_PLUS_PLUS
01978
01979 class IAX2IeList : public IAX2Ie *
01980 {
01981 #endif
01982 public:
01984 ~IAX2IeList();
01985
01989 IAX2Ie *RemoveIeAt(PINDEX i);
01990
01994 IAX2Ie *RemoveLastIe();
01995
01997 void Initialise() { DisallowDeleteObjects(); }
01998
02000 void DeleteAt(PINDEX idex);
02001
02003 PBoolean Empty() const { return GetSize() == 0; }
02004
02006 PBoolean IsEmpty() const { return GetSize() == 0; }
02007
02009 void AppendIe(IAX2Ie *newMember) { Append(newMember);}
02010
02012 int GetBinaryDataSize() const;
02013
02015 IAX2Ie * GetIeAt(int i) const;
02016
02017 protected:
02018
02019 };
02020
02021
02022 #endif // IAX_IES_H
02023
02024
02025
02026
02027
02028
02029
02030
02031
02032
02033