OPAL Version 3.10.2
|
00001 /* 00002 * 00003 * Inter Asterisk Exchange 2 00004 * 00005 * The classes used to hold Information Elements. 00006 * 00007 * Open Phone Abstraction Library (OPAL) 00008 * 00009 * Copyright (c) 2005 Indranet Technologies Ltd. 00010 * 00011 * The contents of this file are subject to the Mozilla Public License 00012 * Version 1.0 (the "License"); you may not use this file except in 00013 * compliance with the License. You may obtain a copy of the License at 00014 * http://www.mozilla.org/MPL/ 00015 * 00016 * Software distributed under the License is distributed on an "AS IS" 00017 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00018 * the License for the specific language governing rights and limitations 00019 * under the License. 00020 * 00021 * The Original Code is Open Phone Abstraction Library. 00022 * 00023 * The Initial Developer of the Original Code is Indranet Technologies Ltd. 00024 * 00025 * The author of this code is Derek J Smithies 00026 * 00027 * $Revision: 24625 $ 00028 * $Author: dereksmithies $ 00029 * $Date: 2010-08-08 17:41:30 -0500 (Sun, 08 Aug 2010) $ 00030 */ 00031 00032 #ifndef OPAL_IAX2_IES_H 00033 #define OPAL_IAX2_IES_H 00034 00035 #ifndef _PTLIB_H 00036 #include <ptlib.h> 00037 #endif 00038 00039 #include <opal/buildopts.h> 00040 00041 #if OPAL_IAX2 00042 00043 #include <ptlib/sockets.h> 00044 #include <iax2/iedata.h> 00045 00046 #ifdef P_USE_PRAGMA 00047 #pragma interface 00048 #endif 00049 00050 00051 class IAX2Ie; 00052 class IAX2Encryption; 00053 00055 class IAX2Ie : public PObject 00056 { 00057 PCLASSINFO(IAX2Ie, PObject); 00058 public: 00060 enum IAX2IeTypeCode { 00061 ie_calledNumber = 1, 00062 ie_callingNumber = 2, 00063 ie_callingAni = 3, 00064 ie_callingName = 4, 00065 ie_calledContext = 5, 00066 ie_userName = 6, 00067 ie_password = 7, 00068 ie_capability = 8, 00069 ie_format = 9, 00070 ie_language = 10, 00071 ie_version = 11, 00072 ie_adsicpe = 12, 00073 ie_dnid = 13, 00074 ie_authMethods = 14, 00075 ie_challenge = 15, 00076 ie_md5Result = 16, 00077 ie_rsaResult = 17, 00078 ie_apparentAddr = 18, 00079 ie_refresh = 19, 00080 ie_dpStatus = 20, 00081 ie_callNo = 21, 00082 ie_cause = 22, 00083 ie_iaxUnknown = 23, 00084 ie_msgCount = 24, 00085 ie_autoAnswer = 25, 00086 ie_musicOnHold = 26, 00087 ie_transferId = 27, 00088 ie_rdnis = 28, 00089 ie_provisioning = 29, 00090 ie_aesProvisioning = 30, 00091 ie_dateTime = 31, 00092 ie_deviceType = 32, 00093 ie_serviceIdent = 33, 00094 ie_firmwareVer = 34, 00095 ie_fwBlockDesc = 35, 00096 ie_fwBlockData = 36, 00097 ie_provVer = 37, 00098 ie_callingPres = 38, 00099 ie_callingTon = 39, 00100 ie_callingTns = 40, 00101 ie_samplingRate = 41, 00102 ie_causeCode = 42, 00103 ie_encryption = 43, 00104 ie_encKey = 44, 00105 ie_codecPrefs = 45, 00106 ie_recJitter = 46, 00107 ie_recLoss = 47, 00108 ie_recPackets = 48, 00109 ie_recDelay = 49, 00110 ie_recDropped = 50, 00111 ie_recOoo = 51, 00112 ie_variable = 52, 00113 ie_ospToken = 53, 00114 ie_callToken = 54, 00115 ie_capability2 = 55, 00116 ie_format2 = 56, 00117 ie_countEntries 00118 }; 00119 00122 00124 IAX2Ie(); 00125 00127 virtual ~IAX2Ie() { }; 00129 00133 static IAX2Ie *BuildInformationElement(BYTE _typeCode, BYTE length, BYTE *srcData); 00134 00136 virtual PBoolean IsValid() { return validData; } 00137 00139 virtual BYTE GetLengthOfData() { return 0; } 00140 00142 int GetBinarySize() { return 2 + GetLengthOfData(); } 00143 00145 virtual void PrintOn(ostream & str) const; 00146 00148 virtual BYTE GetKeyValue() const { return 255; } 00149 00151 void SetData(int &/*newData*/) { PAssertAlways("Ie class cannnot set data value"); }; 00152 00154 int ReadData() { PAssertAlways("Ie class cannot read the internal data value"); return 0; }; 00155 00158 void WriteBinary(void *data, PINDEX & writeIndex); 00159 00162 virtual void StoreDataIn(IAX2IeData &/*res*/) { PAssertAlways(PUnimplementedFunction); } 00164 00165 protected: 00167 virtual void WriteBinary(BYTE * /*data*/) { PAssertAlways(PUnimplementedFunction); } 00168 00171 PBoolean validData; 00172 }; 00173 00175 00176 class IAX2IeInvalidElement : public IAX2Ie 00177 { 00178 PCLASSINFO(IAX2IeInvalidElement, IAX2Ie); 00179 public: 00180 IAX2IeInvalidElement() : IAX2Ie() {}; 00181 00184 virtual BYTE GetlengthOfData() { return 0; } 00185 00187 virtual void PrintOn(ostream & str) const 00188 { str << "Invlalid Information Element" << endl; } 00189 protected: 00193 virtual void WriteBinary(BYTE * /*data*/) { } 00194 }; 00196 00197 class IAX2IeNone : public IAX2Ie 00198 { 00199 PCLASSINFO(IAX2IeNone, IAX2Ie); 00202 00206 IAX2IeNone(BYTE length, BYTE *srcData); 00207 00209 IAX2IeNone() : IAX2Ie() {} 00211 00215 virtual BYTE GetLengthOfData() { return 0; } 00216 00218 BYTE GetValue() { return 0; } 00219 00221 virtual void PrintOn(ostream & str) const; 00222 00224 void SetData(void * /*newData*/) 00225 { PAssertAlways("IeNone cannot set data"); } 00226 00228 int ReadData() { PAssertAlways("IeNone cannot read the internal data value"); return 0; } 00229 00231 protected: 00234 virtual void WriteBinary(BYTE * /*data*/) { } 00235 }; 00236 00238 00239 class IAX2IeByte : public IAX2Ie 00240 { 00241 PCLASSINFO(IAX2IeByte, IAX2Ie); 00244 00248 IAX2IeByte(BYTE length, BYTE *srcData); 00249 00251 IAX2IeByte(BYTE newValue) : IAX2Ie() { SetData(newValue); } 00252 00254 IAX2IeByte() : IAX2Ie() { } 00256 00260 virtual BYTE GetLengthOfData() { return sizeof(dataValue); } 00261 00263 virtual void PrintOn(ostream & str) const; 00264 00266 void SetData(BYTE newData) { dataValue = newData; validData = true; } 00267 00269 BYTE ReadData() { return dataValue; } 00270 00272 protected: 00275 virtual void WriteBinary(BYTE *data) { data[0] = dataValue; } 00276 00278 BYTE dataValue; 00279 }; 00280 00282 00283 class IAX2IeChar : public IAX2Ie 00284 { 00285 PCLASSINFO(IAX2IeChar, IAX2Ie); 00288 00292 IAX2IeChar(BYTE length, BYTE *srcData); 00293 00295 IAX2IeChar(char newValue) : IAX2Ie() { SetData(newValue); } 00296 00298 IAX2IeChar() : IAX2Ie() { } 00300 00304 virtual BYTE GetLengthOfData() { return sizeof(dataValue); } 00305 00307 virtual void PrintOn(ostream & str) const; 00308 00310 void SetData(char newData) { dataValue = newData; validData = true; } 00311 00313 char ReadData() { return dataValue; } 00314 00316 protected: 00319 virtual void WriteBinary(BYTE *data) { data[0] = dataValue; } 00320 00322 char dataValue; 00323 }; 00324 00326 00327 class IAX2IeShort : public IAX2Ie 00328 { 00329 PCLASSINFO(IAX2IeShort, IAX2Ie); 00332 00336 IAX2IeShort(BYTE length, BYTE *srcData); 00337 00339 IAX2IeShort(short newValue) : IAX2Ie() { SetData(newValue); } 00340 00342 IAX2IeShort() : IAX2Ie() { } 00344 00348 virtual BYTE GetLengthOfData() { return sizeof(dataValue); } 00349 00351 virtual void PrintOn(ostream & str) const; 00352 00354 void SetData(short newData) { dataValue = newData; validData = true; } 00355 00357 short ReadData() { return dataValue; } 00359 protected: 00362 virtual void WriteBinary(BYTE *data); 00363 00365 short dataValue; 00366 }; 00368 00369 class IAX2IeInt : public IAX2Ie 00370 { 00371 PCLASSINFO(IAX2IeInt, IAX2Ie); 00374 00378 IAX2IeInt(BYTE length, BYTE *srcData); 00379 00381 IAX2IeInt(int newValue) : IAX2Ie() { SetData(newValue); } 00382 00384 IAX2IeInt() : IAX2Ie() { } 00386 00390 virtual BYTE GetLengthOfData() { return sizeof(dataValue); } 00391 00393 virtual void PrintOn(ostream & str) const; 00394 00396 void SetData(int newData) { dataValue = newData; validData = true; } 00397 00399 int ReadData() { return dataValue; } 00400 00402 protected: 00405 virtual void WriteBinary(BYTE *data); 00406 00408 int dataValue; 00409 }; 00411 00412 class IAX2IeUShort : public IAX2Ie 00413 { 00414 PCLASSINFO(IAX2IeUShort, IAX2Ie); 00417 00421 IAX2IeUShort(BYTE length, BYTE *srcData); 00422 00424 IAX2IeUShort(unsigned short newValue) : IAX2Ie() { SetData(newValue); } 00425 00427 IAX2IeUShort() : IAX2Ie() {} 00429 00433 virtual BYTE GetLengthOfData() { return sizeof(dataValue); } 00434 00436 virtual void PrintOn(ostream & str) const; 00437 00439 void SetData(unsigned short newData) { dataValue = newData; validData = true; } 00440 00442 unsigned short ReadData() { return dataValue; } 00444 protected: 00447 virtual void WriteBinary(BYTE *data); 00448 00450 unsigned short dataValue; 00451 }; 00453 00454 class IAX2IeUInt : public IAX2Ie 00455 { 00456 PCLASSINFO(IAX2IeUInt, IAX2Ie); 00459 00463 IAX2IeUInt(BYTE length, BYTE *srcData); 00464 00466 IAX2IeUInt() : IAX2Ie() {} 00467 00469 IAX2IeUInt(unsigned int newValue) { SetData(newValue); } 00471 00475 virtual BYTE GetLengthOfData() { return sizeof(dataValue); } 00476 00478 virtual void PrintOn(ostream & str) const; 00479 00481 void SetData(unsigned int &newData) { dataValue = newData; validData = true; } 00482 00484 unsigned int ReadData() { return dataValue; } 00486 00487 protected: 00490 virtual void WriteBinary(BYTE *data); 00491 00493 unsigned int dataValue; 00494 }; 00495 00497 00498 class IAX2IeString : public IAX2Ie 00499 { 00500 PCLASSINFO(IAX2IeString, IAX2Ie); 00503 00504 public: 00508 IAX2IeString(BYTE length, BYTE *srcData); 00509 00511 IAX2IeString(const PString & newValue) : IAX2Ie() { SetData(newValue); } 00512 00514 IAX2IeString(const char * newValue) : IAX2Ie() { SetData(newValue); } 00515 00517 IAX2IeString() : IAX2Ie() {} 00519 00523 virtual BYTE GetLengthOfData(); 00524 00526 void PrintOn(ostream & str) const; 00527 00529 void SetData(const PString & newData); 00530 00532 void SetData(const char * newData); 00533 00535 PString ReadData() { return dataValue; } 00537 00538 protected: 00541 virtual void WriteBinary(BYTE *data); 00542 00544 PString dataValue; 00545 }; 00546 00548 00550 class IAX2IeBinary : public IAX2Ie 00551 { 00552 PCLASSINFO(IAX2IeBinary, IAX2Ie); 00555 00556 public: 00561 IAX2IeBinary(BYTE length, BYTE *srcData); 00562 00564 IAX2IeBinary(PBYTEArray newValue) : IAX2Ie() { SetData(newValue); } 00565 00567 IAX2IeBinary() : IAX2Ie() {} 00569 00573 virtual BYTE GetLengthOfData() { return (BYTE)dataValue.GetSize(); } 00574 00576 virtual void PrintOn(ostream & str) const; 00577 00579 void SetData(const PBYTEArray & newData); 00580 00582 void GetData(PBYTEArray & answer); 00583 00586 void CopyData(IAX2IeBinary *src); 00588 00589 protected: 00592 virtual void WriteBinary(BYTE *data); 00593 00595 PBYTEArray dataValue; 00596 }; 00597 00598 00600 00601 class IAX2IeDateAndTime : public IAX2Ie 00602 { 00603 PCLASSINFO(IAX2IeDateAndTime, IAX2Ie); 00606 00607 public: 00611 IAX2IeDateAndTime(BYTE length, BYTE *srcData); 00612 00614 IAX2IeDateAndTime(const PTime & newValue) : IAX2Ie() { SetData(newValue); } 00615 00617 IAX2IeDateAndTime() : IAX2Ie() {} 00619 00623 virtual void PrintOn(ostream & str) const; 00624 00626 virtual BYTE GetLengthOfData() { return 4; } 00627 00629 void SetData(const PTime & newData) 00630 { dataValue = newData; validData = true; } 00631 00633 PTime ReadData() { return dataValue; } 00635 protected: 00638 virtual void WriteBinary(BYTE *data); 00639 00641 PTime dataValue; 00642 }; 00644 00645 class IAX2IeBlockOfData : public IAX2Ie 00646 { 00647 PCLASSINFO(IAX2IeBlockOfData, IAX2Ie); 00650 00651 public: 00655 IAX2IeBlockOfData(BYTE length, BYTE *srcData); 00656 00658 IAX2IeBlockOfData(const PBYTEArray & newData) : IAX2Ie() { SetData(newData); } 00659 00661 IAX2IeBlockOfData() : IAX2Ie() {} 00663 00667 virtual void PrintOn(ostream & str) const; 00668 00670 virtual BYTE GetLengthOfData() { return (BYTE)dataValue.GetSize(); } 00671 00673 void SetData(const PBYTEArray & newData) 00674 { dataValue = newData; validData = true; } 00675 00677 PBYTEArray ReadData() { return dataValue; } 00678 00680 protected: 00683 virtual void WriteBinary(BYTE *data); 00684 00686 PBYTEArray dataValue; 00687 }; 00689 00690 class IAX2IeSockaddrIn : public IAX2Ie 00691 { 00692 PCLASSINFO(IAX2IeSockaddrIn, IAX2Ie); 00695 00696 public: 00700 IAX2IeSockaddrIn(BYTE length, BYTE *srcData); 00701 00703 IAX2IeSockaddrIn(const PIPSocket::Address & addr, PINDEX port) : IAX2Ie() 00704 { SetData(addr, port); } 00705 00707 IAX2IeSockaddrIn() : IAX2Ie() {} 00708 00710 ~IAX2IeSockaddrIn() { } ; 00712 00716 virtual void PrintOn(ostream & str) const; 00717 00719 virtual BYTE GetLengthOfData() { return sizeof(struct sockaddr_in); } 00720 00722 void SetData(const PIPSocket::Address & newAddr, PINDEX newPort) 00723 { dataValue = newAddr; portNumber = newPort; validData = true; } 00724 00726 PIPSocket::Address ReadData() { return dataValue; } 00727 00729 protected: 00732 virtual void WriteBinary(BYTE *data); 00733 00735 PIPSocket::Address dataValue; 00736 00738 PINDEX portNumber; 00739 }; 00740 00742 00743 class IAX2IeCalledNumber : public IAX2IeString 00744 { 00745 PCLASSINFO(IAX2IeCalledNumber, IAX2IeString); 00746 public: 00750 IAX2IeCalledNumber(BYTE length, BYTE *srcData) 00751 : IAX2IeString(length, srcData) {}; 00752 00754 IAX2IeCalledNumber(const PString & newValue) { SetData(newValue); } 00755 00757 virtual void PrintOn(ostream & str) const; 00758 00760 virtual BYTE GetKeyValue() const { return ie_calledNumber; } 00761 00765 virtual void StoreDataIn(IAX2IeData &res) { res.calledNumber = dataValue; } 00766 protected: 00767 }; 00769 00771 class IAX2IeCallingNumber : public IAX2IeString 00772 { 00773 PCLASSINFO(IAX2IeCallingNumber, IAX2IeString); 00774 public: 00778 IAX2IeCallingNumber(BYTE length, BYTE *srcData) 00779 : IAX2IeString(length, srcData) { }; 00780 00782 IAX2IeCallingNumber(const PString & newValue) { SetData(newValue); } 00783 00785 virtual void PrintOn(ostream & str) const; 00786 00788 virtual BYTE GetKeyValue() const { return ie_callingNumber; } 00789 00793 virtual void StoreDataIn(IAX2IeData &res) 00794 { res.callingNumber = dataValue; } 00795 protected: 00796 }; 00797 00799 00800 class IAX2IeCallingAni : public IAX2IeString 00801 { 00802 PCLASSINFO(IAX2IeCallingAni, IAX2IeString); 00803 public: 00807 IAX2IeCallingAni(BYTE length, BYTE *srcData) 00808 : IAX2IeString(length, srcData) { }; 00809 00811 IAX2IeCallingAni(const PString & newValue) { SetData(newValue); } 00812 00814 virtual void PrintOn(ostream & str) const; 00815 00817 virtual BYTE GetKeyValue() const { return ie_callingAni; } 00818 00822 virtual void StoreDataIn(IAX2IeData &res) 00823 { res.callingAni = dataValue; } 00824 protected: 00825 }; 00826 00828 00829 class IAX2IeCallingName : public IAX2IeString 00830 { 00831 PCLASSINFO(IAX2IeCallingName, IAX2IeString); 00832 public: 00836 IAX2IeCallingName(BYTE length, BYTE *srcData) 00837 : IAX2IeString(length, srcData) { }; 00838 00840 IAX2IeCallingName(const PString & newValue) { SetData(newValue); } 00841 00843 virtual void PrintOn(ostream & str) const; 00844 00846 virtual BYTE GetKeyValue() const { return ie_callingName; } 00847 00851 virtual void StoreDataIn(IAX2IeData &res) 00852 { res.callingName = dataValue; } 00853 protected: 00854 }; 00855 00857 00858 class IAX2IeCalledContext : public IAX2IeString 00859 { 00860 PCLASSINFO(IAX2IeCalledContext, IAX2IeString); 00861 public: 00865 IAX2IeCalledContext(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 00866 00868 IAX2IeCalledContext(const PString & newValue) { SetData(newValue); } 00869 00871 virtual void PrintOn(ostream & str) const; 00872 00874 virtual BYTE GetKeyValue() const { return ie_calledContext; } 00875 00879 virtual void StoreDataIn(IAX2IeData &res) 00880 { res.calledContext = dataValue; } 00881 protected: 00882 }; 00883 00885 00886 class IAX2IeUserName : public IAX2IeString 00887 { 00888 PCLASSINFO(IAX2IeUserName, IAX2IeString); 00889 public: 00893 IAX2IeUserName(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 00894 00896 IAX2IeUserName(const PString & newValue) { SetData(newValue); } 00897 00899 virtual void PrintOn(ostream & str) const; 00900 00902 virtual BYTE GetKeyValue() const { return ie_userName; } 00903 00907 virtual void StoreDataIn(IAX2IeData &res) { res.userName = dataValue; } 00908 protected: 00909 }; 00910 00912 00913 class IAX2IePassword : public IAX2IeString 00914 { 00915 PCLASSINFO(IAX2IePassword, IAX2IeString); 00916 public: 00920 IAX2IePassword(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 00921 00923 IAX2IePassword(const PString & newValue) { SetData(newValue); } 00924 00926 virtual void PrintOn(ostream & str) const; 00927 00929 virtual BYTE GetKeyValue() const { return ie_password; } 00930 00934 virtual void StoreDataIn(IAX2IeData &res) { res.password = dataValue; } 00935 protected: 00936 }; 00937 00939 00940 class IAX2IeCapability : public IAX2IeUInt 00941 { 00942 PCLASSINFO(IAX2IeCapability, IAX2IeUInt); 00943 public: 00947 IAX2IeCapability(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { }; 00948 00950 IAX2IeCapability(unsigned int newValue) : IAX2IeUInt(newValue) { } 00951 00953 virtual void PrintOn(ostream & str) const; 00954 00956 virtual BYTE GetKeyValue() const { return ie_capability; } 00957 00961 virtual void StoreDataIn(IAX2IeData &res) { res.capability = dataValue; } 00962 protected: 00963 }; 00964 00966 00967 class IAX2IeFormat : public IAX2IeUInt 00968 { 00969 PCLASSINFO(IAX2IeFormat, IAX2IeUInt); 00970 public: 00974 IAX2IeFormat(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { }; 00975 00977 IAX2IeFormat(unsigned int newValue) : IAX2IeUInt(newValue) { } 00978 00980 virtual void PrintOn(ostream & str) const; 00981 00983 virtual BYTE GetKeyValue() const { return ie_format; } 00984 00988 virtual void StoreDataIn(IAX2IeData &res) { res.format = dataValue; } 00989 protected: 00990 }; 00991 00993 00994 class IAX2IeLanguage : public IAX2IeString 00995 { 00996 PCLASSINFO(IAX2IeLanguage, IAX2IeString); 00997 public: 01001 IAX2IeLanguage(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01002 01004 IAX2IeLanguage(const PString & newValue) { SetData(newValue); } 01005 01007 virtual void PrintOn(ostream & str) const; 01008 01010 virtual BYTE GetKeyValue() const { return ie_language; } 01011 01015 virtual void StoreDataIn(IAX2IeData &res) { res.language = dataValue; } 01016 protected: 01017 }; 01018 01020 01021 class IAX2IeVersion : public IAX2IeShort 01022 { 01023 PCLASSINFO(IAX2IeVersion, IAX2IeShort); 01024 public: 01028 IAX2IeVersion(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { }; 01029 01031 IAX2IeVersion() { dataValue = 2; validData = true; } 01032 01034 virtual void PrintOn(ostream & str) const; 01035 01037 virtual BYTE GetKeyValue() const { return ie_version; } 01038 01042 virtual void StoreDataIn(IAX2IeData &res) { res.version = dataValue; } 01043 protected: 01044 }; 01045 01047 01048 class IAX2IeAdsicpe : public IAX2IeShort 01049 { 01050 PCLASSINFO(IAX2IeAdsicpe, IAX2IeShort); 01051 public: 01055 IAX2IeAdsicpe(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { }; 01056 01058 virtual void PrintOn(ostream & str) const; 01059 01061 virtual BYTE GetKeyValue() const { return ie_adsicpe; } 01062 01066 virtual void StoreDataIn(IAX2IeData &res) { res.adsicpe = dataValue; } 01067 protected: 01068 }; 01069 01071 01072 class IAX2IeDnid : public IAX2IeString 01073 { 01074 PCLASSINFO(IAX2IeDnid, IAX2IeString); 01075 public: 01079 IAX2IeDnid(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01080 01082 IAX2IeDnid(const PString & newValue) { SetData(newValue); } 01083 01085 virtual void PrintOn(ostream & str) const; 01086 01088 virtual BYTE GetKeyValue() const { return ie_dnid; } 01089 01093 virtual void StoreDataIn(IAX2IeData &res) { res.dnid = dataValue; } 01094 protected: 01095 }; 01096 01098 01099 class IAX2IeAuthMethods : public IAX2IeShort 01100 { 01101 PCLASSINFO(IAX2IeAuthMethods, IAX2IeShort); 01102 public: 01106 IAX2IeAuthMethods(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { }; 01107 01109 IAX2IeAuthMethods(short newValue) { SetData(newValue); } 01110 01112 virtual void PrintOn(ostream & str) const; 01113 01115 virtual BYTE GetKeyValue() const { return ie_authMethods; } 01116 01120 virtual void StoreDataIn(IAX2IeData &res) { res.authMethods = dataValue; } 01121 01123 static PBoolean IsRsaAuthentication(short testValue) { return InternalIsRsa(testValue); } 01124 01126 static PBoolean IsMd5Authentication(short testValue) { return InternalIsMd5(testValue); } 01127 01129 static PBoolean IsPlainTextAuthentication(short testValue) { return InternalIsPlainText(testValue); } 01130 01132 PBoolean IsRsaAuthentication() { if (IsValid()) return InternalIsRsa(dataValue); else return false; } 01133 01135 PBoolean IsMd5Authentication() { if (IsValid()) return InternalIsMd5(dataValue); else return false; } 01136 01138 PBoolean IsPlainTextAuthentication() { if (IsValid()) return InternalIsPlainText(dataValue); else return false; } 01139 01140 protected: 01141 01143 static PBoolean InternalIsRsa(short testValue) { return testValue & 0x04; } 01144 01146 static PBoolean InternalIsMd5(short testValue) { return testValue & 0x02; } 01147 01149 static PBoolean InternalIsPlainText(short testValue) { return testValue & 0x01; } 01150 }; 01151 01153 01154 class IAX2IeChallenge : public IAX2IeString 01155 { 01156 PCLASSINFO(IAX2IeChallenge, IAX2IeString); 01157 public: 01161 IAX2IeChallenge(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01162 01164 IAX2IeChallenge(const PString & newValue) { SetData(newValue); } 01165 01167 virtual void PrintOn(ostream & str) const; 01168 01170 virtual BYTE GetKeyValue() const { return ie_challenge; } 01171 01175 virtual void StoreDataIn(IAX2IeData &res) { res.challenge = dataValue; } 01176 protected: 01177 }; 01178 01180 01181 class IAX2IeMd5Result : public IAX2IeString 01182 { 01183 PCLASSINFO(IAX2IeMd5Result, IAX2IeString); 01184 public: 01188 IAX2IeMd5Result(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01189 01191 IAX2IeMd5Result(const PString & newValue) { SetData(newValue); } 01192 01194 IAX2IeMd5Result(const PString & challenge, const PString & password); 01195 01197 IAX2IeMd5Result(IAX2Encryption & encryption); 01198 01200 void InitializeChallengePassword(const PString & newChallenge, const PString & newPassword); 01201 01203 virtual void PrintOn(ostream & str) const; 01204 01206 virtual BYTE GetKeyValue() const { return ie_md5Result; } 01207 01211 virtual void StoreDataIn(IAX2IeData &res) { res.md5Result = dataValue; } 01212 01215 PBYTEArray & GetDataBlock() { return dataBlock; } 01216 01217 protected: 01218 01220 PBYTEArray dataBlock; 01221 }; 01222 01224 01225 class IAX2IeRsaResult : public IAX2IeString 01226 { 01227 PCLASSINFO(IAX2IeRsaResult, IAX2IeString); 01228 public: 01232 IAX2IeRsaResult(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01233 01235 IAX2IeRsaResult(const PString & newValue) { SetData(newValue); } 01236 01238 virtual void PrintOn(ostream & str) const; 01239 01241 virtual BYTE GetKeyValue() const { return ie_rsaResult; } 01242 01246 virtual void StoreDataIn(IAX2IeData &res) { res.rsaResult = dataValue; } 01247 protected: 01248 }; 01249 01251 01252 class IAX2IeApparentAddr : public IAX2IeSockaddrIn 01253 { 01254 PCLASSINFO(IAX2IeApparentAddr, IAX2IeSockaddrIn); 01255 public: 01259 IAX2IeApparentAddr(BYTE length, BYTE *srcData) : IAX2IeSockaddrIn(length, srcData) { }; 01260 01262 ~IAX2IeApparentAddr() { }; 01263 01265 virtual void PrintOn(ostream & str) const; 01266 01268 virtual BYTE GetKeyValue() const { return ie_apparentAddr; } 01269 01273 virtual void StoreDataIn(IAX2IeData &res) { res.apparentAddr = dataValue; } 01274 protected: 01275 }; 01276 01278 01279 class IAX2IeRefresh : public IAX2IeShort 01280 { 01281 PCLASSINFO(IAX2IeRefresh, IAX2IeShort); 01282 public: 01286 IAX2IeRefresh(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { }; 01287 01289 IAX2IeRefresh(short refreshTime) : IAX2IeShort(refreshTime) { }; 01290 01292 virtual void PrintOn(ostream & str) const; 01293 01295 virtual BYTE GetKeyValue() const { return ie_refresh; } 01296 01300 virtual void StoreDataIn(IAX2IeData &res) { res.refresh = dataValue; } 01301 protected: 01302 }; 01303 01305 01306 class IAX2IeDpStatus : public IAX2IeShort 01307 { 01308 PCLASSINFO(IAX2IeDpStatus, IAX2IeShort); 01309 public: 01313 IAX2IeDpStatus(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { }; 01314 01316 virtual void PrintOn(ostream & str) const; 01317 01319 virtual BYTE GetKeyValue() const { return ie_dpStatus; } 01320 01324 virtual void StoreDataIn(IAX2IeData &res) { res.dpStatus = dataValue; } 01325 protected: 01326 }; 01327 01329 01330 class IAX2IeCallNo : public IAX2IeShort 01331 { 01332 PCLASSINFO(IAX2IeCallNo, IAX2IeShort); 01333 public: 01337 IAX2IeCallNo(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { }; 01338 01340 virtual void PrintOn(ostream & str) const; 01341 01343 virtual BYTE GetKeyValue() const { return ie_callNo; } 01344 01348 virtual void StoreDataIn(IAX2IeData &res) { res.callNo = dataValue; } 01349 protected: 01350 }; 01351 01353 01354 class IAX2IeCause : public IAX2IeString 01355 { 01356 PCLASSINFO(IAX2IeCause, IAX2IeString); 01357 public: 01361 IAX2IeCause(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01362 01364 IAX2IeCause(const PString & newValue) : IAX2IeString(newValue) { } 01365 01367 IAX2IeCause(const char *newValue) : IAX2IeString(newValue) { } 01368 01370 virtual void PrintOn(ostream & str) const; 01371 01373 virtual BYTE GetKeyValue() const { return ie_cause; } 01374 01378 virtual void StoreDataIn(IAX2IeData &res) { res.cause = dataValue; } 01379 protected: 01380 }; 01381 01383 01384 class IAX2IeIaxUnknown : public IAX2IeByte 01385 { 01386 PCLASSINFO(IAX2IeIaxUnknown, IAX2IeByte); 01387 public: 01391 IAX2IeIaxUnknown(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { }; 01392 01394 IAX2IeIaxUnknown(BYTE newValue) : IAX2IeByte(newValue) { } 01395 01397 virtual void PrintOn(ostream & str) const; 01398 01400 virtual BYTE GetKeyValue() const { return ie_iaxUnknown; } 01401 01405 virtual void StoreDataIn(IAX2IeData &res) { res.iaxUnknown = dataValue; } 01406 protected: 01407 }; 01408 01410 01411 class IAX2IeMsgCount : public IAX2IeShort 01412 { 01413 PCLASSINFO(IAX2IeMsgCount, IAX2IeShort); 01414 public: 01418 IAX2IeMsgCount(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { }; 01419 01421 virtual void PrintOn(ostream & str) const; 01422 01424 virtual BYTE GetKeyValue() const { return ie_msgCount; } 01425 01429 virtual void StoreDataIn(IAX2IeData &res) { res.msgCount = dataValue; } 01430 protected: 01431 }; 01432 01434 01435 class IAX2IeAutoAnswer : public IAX2IeNone 01436 { 01437 PCLASSINFO(IAX2IeAutoAnswer, IAX2IeNone); 01438 public: 01442 IAX2IeAutoAnswer(BYTE length, BYTE *srcData) : IAX2IeNone(length, srcData) { }; 01443 01445 virtual void PrintOn(ostream & str) const; 01446 01448 virtual BYTE GetKeyValue() const { return ie_autoAnswer; } 01449 01453 virtual void StoreDataIn(IAX2IeData &res) { res.autoAnswer = true;; } 01454 protected: 01455 }; 01456 01458 01459 class IAX2IeMusicOnHold : public IAX2IeNone 01460 { 01461 PCLASSINFO(IAX2IeMusicOnHold, IAX2IeNone); 01462 public: 01466 IAX2IeMusicOnHold(BYTE length, BYTE *srcData) : IAX2IeNone(length, srcData) { }; 01467 01469 IAX2IeMusicOnHold() : IAX2IeNone() { }; 01470 01472 virtual void PrintOn(ostream & str) const; 01473 01475 virtual BYTE GetKeyValue() const { return ie_musicOnHold; } 01476 01480 virtual void StoreDataIn(IAX2IeData &res) { res.musicOnHold = true; } 01481 protected: 01482 }; 01483 01485 01486 class IAX2IeTransferId : public IAX2IeInt 01487 { 01488 PCLASSINFO(IAX2IeTransferId, IAX2IeInt); 01489 public: 01493 IAX2IeTransferId(BYTE length, BYTE *srcData) : IAX2IeInt(length, srcData) { }; 01494 01496 virtual void PrintOn(ostream & str) const; 01497 01499 virtual BYTE GetKeyValue() const { return ie_transferId; } 01500 01504 virtual void StoreDataIn(IAX2IeData &res) { res.transferId = dataValue; } 01505 protected: 01506 }; 01507 01509 01510 class IAX2IeRdnis : public IAX2IeString 01511 { 01512 PCLASSINFO(IAX2IeRdnis, IAX2IeString); 01513 public: 01517 IAX2IeRdnis(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01518 01520 virtual void PrintOn(ostream & str) const; 01521 01523 virtual BYTE GetKeyValue() const { return ie_rdnis; } 01524 01528 virtual void StoreDataIn(IAX2IeData &res) { res.rdnis = dataValue; } 01529 protected: 01530 }; 01531 01533 01534 class IAX2IeProvisioning : public IAX2IeBlockOfData 01535 { 01536 PCLASSINFO(IAX2IeProvisioning, IAX2IeBlockOfData); 01537 public: 01541 IAX2IeProvisioning(BYTE length, BYTE *srcData) : IAX2IeBlockOfData (length, srcData) { }; 01542 01544 virtual void PrintOn(ostream & str) const; 01545 01547 virtual BYTE GetKeyValue() const { return ie_provisioning; } 01548 01552 virtual void StoreDataIn(IAX2IeData &/*res*/) { } 01553 protected: 01554 }; 01555 01557 01558 class IAX2IeAesProvisioning : public IAX2IeNone 01559 { 01560 PCLASSINFO(IAX2IeAesProvisioning, IAX2IeNone); 01561 public: 01565 IAX2IeAesProvisioning(BYTE length, BYTE *srcData) : IAX2IeNone(length, srcData) { }; 01566 01568 virtual void PrintOn(ostream & str) const; 01569 01571 virtual BYTE GetKeyValue() const { return ie_aesProvisioning; } 01572 01576 virtual void StoreDataIn(IAX2IeData &/*res*/) { } 01577 protected: 01578 }; 01579 01581 01582 class IAX2IeDateTime : public IAX2IeDateAndTime 01583 { 01584 PCLASSINFO(IAX2IeDateTime, IAX2IeDateAndTime); 01585 public: 01589 IAX2IeDateTime(BYTE length, BYTE *srcData) : IAX2IeDateAndTime(length, srcData) { }; 01590 01592 virtual void PrintOn(ostream & str) const; 01593 01595 virtual BYTE GetKeyValue() const { return ie_dateTime; } 01596 01600 virtual void StoreDataIn(IAX2IeData &res) { res.dateTime = dataValue; } 01601 protected: 01602 }; 01603 01605 01606 class IAX2IeDeviceType : public IAX2IeString 01607 { 01608 PCLASSINFO(IAX2IeDeviceType, IAX2IeString); 01609 public: 01613 IAX2IeDeviceType(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01614 01616 virtual void PrintOn(ostream & str) const; 01617 01619 virtual BYTE GetKeyValue() const { return ie_deviceType; } 01620 01624 virtual void StoreDataIn(IAX2IeData &res) { res.deviceType = dataValue; } 01625 protected: 01626 }; 01627 01629 01630 class IAX2IeServiceIdent : public IAX2IeString 01631 { 01632 PCLASSINFO(IAX2IeServiceIdent, IAX2IeString); 01633 public: 01637 IAX2IeServiceIdent(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01638 01640 virtual void PrintOn(ostream & str) const; 01641 01643 virtual BYTE GetKeyValue() const { return ie_serviceIdent; } 01644 01648 virtual void StoreDataIn(IAX2IeData &res) { res.serviceIdent = dataValue; } 01649 protected: 01650 }; 01651 01653 01654 class IAX2IeFirmwareVer : public IAX2IeShort 01655 { 01656 PCLASSINFO(IAX2IeFirmwareVer, IAX2IeShort); 01657 public: 01661 IAX2IeFirmwareVer(BYTE length, BYTE *srcData) : IAX2IeShort(length, srcData) { }; 01662 01664 virtual void PrintOn(ostream & str) const; 01665 01667 virtual BYTE GetKeyValue() const { return ie_firmwareVer; } 01668 01672 virtual void StoreDataIn(IAX2IeData &res) { res.firmwareVer = dataValue; } 01673 protected: 01674 }; 01675 01677 01678 class IAX2IeFwBlockDesc : public IAX2IeUInt 01679 { 01680 PCLASSINFO(IAX2IeFwBlockDesc, IAX2IeUInt); 01681 public: 01685 IAX2IeFwBlockDesc(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { }; 01686 01688 IAX2IeFwBlockDesc(unsigned int newValue) : IAX2IeUInt(newValue) { } 01689 01691 virtual void PrintOn(ostream & str) const; 01692 01694 virtual BYTE GetKeyValue() const { return ie_fwBlockDesc; } 01695 01699 virtual void StoreDataIn(IAX2IeData &res) { res.fwBlockDesc = dataValue; } 01700 protected: 01701 }; 01702 01704 01705 class IAX2IeFwBlockData : public IAX2IeBlockOfData 01706 { 01707 PCLASSINFO(IAX2IeFwBlockData, IAX2IeBlockOfData); 01708 public: 01712 IAX2IeFwBlockData(BYTE length, BYTE *srcData) : IAX2IeBlockOfData(length, srcData) { }; 01713 01715 virtual void PrintOn(ostream & str) const; 01716 01718 virtual BYTE GetKeyValue() const { return ie_fwBlockData; } 01719 01723 virtual void StoreDataIn(IAX2IeData &res) { res.fwBlockData = dataValue; } 01724 protected: 01725 }; 01726 01728 01729 class IAX2IeProvVer : public IAX2IeUInt 01730 { 01731 PCLASSINFO(IAX2IeProvVer, IAX2IeUInt); 01732 public: 01736 IAX2IeProvVer(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { }; 01737 01739 IAX2IeProvVer(unsigned int newValue) : IAX2IeUInt(newValue) { } 01740 01742 virtual void PrintOn(ostream & str) const; 01743 01745 virtual BYTE GetKeyValue() const { return ie_provVer; } 01746 01750 virtual void StoreDataIn(IAX2IeData &res) { res.provVer = dataValue; } 01751 protected: 01752 }; 01753 01755 01756 class IAX2IeCallingPres : public IAX2IeByte 01757 { 01758 PCLASSINFO(IAX2IeCallingPres, IAX2IeByte); 01759 public: 01763 IAX2IeCallingPres(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { }; 01764 01766 virtual void PrintOn(ostream & str) const; 01767 01769 virtual BYTE GetKeyValue() const { return ie_callingPres; } 01770 01774 virtual void StoreDataIn(IAX2IeData &res) { res.callingPres = dataValue; } 01775 protected: 01776 }; 01777 01779 01780 class IAX2IeCallingTon : public IAX2IeByte 01781 { 01782 PCLASSINFO(IAX2IeCallingTon, IAX2IeByte); 01783 public: 01787 IAX2IeCallingTon(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { }; 01788 01790 virtual void PrintOn(ostream & str) const; 01791 01793 virtual BYTE GetKeyValue() const { return ie_callingTon; } 01794 01798 virtual void StoreDataIn(IAX2IeData &res) { res.callingTon = dataValue; } 01799 protected: 01800 }; 01801 01803 01804 class IAX2IeCallingTns : public IAX2IeUShort 01805 { 01806 PCLASSINFO(IAX2IeCallingTns, IAX2IeUShort); 01807 public: 01811 IAX2IeCallingTns(BYTE length, BYTE *srcData) : IAX2IeUShort(length, srcData) { }; 01812 01814 virtual void PrintOn(ostream & str) const; 01815 01817 virtual BYTE GetKeyValue() const { return ie_callingTns; } 01818 01822 virtual void StoreDataIn(IAX2IeData &res) { res.callingTns = dataValue; } 01823 protected: 01824 }; 01825 01827 01828 class IAX2IeSamplingRate : public IAX2IeUShort 01829 { 01830 PCLASSINFO(IAX2IeSamplingRate, IAX2IeUShort); 01831 public: 01835 IAX2IeSamplingRate(BYTE length, BYTE *srcData) : IAX2IeUShort(length, srcData) { }; 01836 01838 virtual void PrintOn(ostream & str) const; 01839 01841 virtual BYTE GetKeyValue() const { return ie_samplingRate; } 01842 01846 virtual void StoreDataIn(IAX2IeData &res) { res.samplingRate = dataValue; } 01847 protected: 01848 }; 01849 01851 01852 class IAX2IeEncryption : public IAX2IeUShort 01853 { 01854 PCLASSINFO(IAX2IeEncryption, IAX2IeUShort); 01855 public: 01857 enum IAX2IeEncryptionMethod { 01858 encryptAes128 = 1 01859 }; 01860 01862 IAX2IeEncryption(IAX2IeEncryptionMethod method = encryptAes128); 01863 01867 IAX2IeEncryption(BYTE length, BYTE *srcData) : IAX2IeUShort(length, srcData) { }; 01868 01870 virtual void PrintOn(ostream & str) const; 01871 01873 virtual BYTE GetKeyValue() const { return ie_encryption; } 01874 01878 virtual void StoreDataIn(IAX2IeData &res) { res.encryptionMethods = dataValue; } 01879 protected: 01880 }; 01881 01883 01884 class IAX2IeEncKey : public IAX2IeString 01885 { 01886 PCLASSINFO(IAX2IeEncKey, IAX2IeString); 01887 public: 01891 IAX2IeEncKey(BYTE length, BYTE *srcData) : IAX2IeString(length, srcData) { }; 01892 01894 virtual void PrintOn(ostream & str) const; 01895 01897 virtual BYTE GetKeyValue() const { return ie_encKey; } 01898 01902 virtual void StoreDataIn(IAX2IeData &res) { res.encKey = dataValue; } 01903 protected: 01904 }; 01905 01907 01908 class IAX2IeCodecPrefs : public IAX2IeByte 01909 { 01910 PCLASSINFO(IAX2IeCodecPrefs, IAX2IeByte); 01911 public: 01915 IAX2IeCodecPrefs(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { }; 01916 01918 virtual void PrintOn(ostream & str) const; 01919 01921 virtual BYTE GetKeyValue() const { return ie_codecPrefs; } 01922 01926 virtual void StoreDataIn(IAX2IeData &res) { res.codecPrefs = dataValue; } 01927 protected: 01928 }; 01929 01931 01932 class IAX2IeReceivedJitter : public IAX2IeUInt 01933 { 01934 PCLASSINFO(IAX2IeReceivedJitter, IAX2IeUInt); 01935 public: 01939 IAX2IeReceivedJitter(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { }; 01940 01942 virtual void PrintOn(ostream & str) const; 01943 01945 virtual BYTE GetKeyValue() const { return ie_recJitter; } 01946 01950 virtual void StoreDataIn(IAX2IeData &res) { res.receivedJitter = dataValue; } 01951 protected: 01952 }; 01953 01955 01956 class IAX2IeReceivedLoss : public IAX2IeUInt 01957 { 01958 PCLASSINFO(IAX2IeReceivedLoss, IAX2IeUInt); 01959 public: 01963 IAX2IeReceivedLoss(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { }; 01964 01966 virtual void PrintOn(ostream & str) const; 01967 01969 virtual BYTE GetKeyValue() const { return ie_recLoss; } 01970 01974 virtual void StoreDataIn(IAX2IeData &res) { res.receivedLoss = dataValue; } 01975 protected: 01976 }; 01977 01979 01980 class IAX2IeReceivedFrames : public IAX2IeUInt 01981 { 01982 PCLASSINFO(IAX2IeReceivedFrames, IAX2IeUInt); 01983 public: 01987 IAX2IeReceivedFrames(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { }; 01988 01990 virtual void PrintOn(ostream & str) const; 01991 01993 virtual BYTE GetKeyValue() const { return ie_recPackets; } 01994 01998 virtual void StoreDataIn(IAX2IeData &res) { res.receivedPackets = dataValue; } 01999 protected: 02000 }; 02001 02003 02004 class IAX2IeReceivedDelay : public IAX2IeUShort 02005 { 02006 PCLASSINFO(IAX2IeReceivedDelay, IAX2IeUShort); 02007 public: 02011 IAX2IeReceivedDelay(BYTE length, BYTE *srcData) : IAX2IeUShort(length, srcData) { }; 02012 02014 virtual void PrintOn(ostream & str) const; 02015 02017 virtual BYTE GetKeyValue() const { return ie_recDelay; } 02018 02022 virtual void StoreDataIn(IAX2IeData &res) { res.receivedDelay = dataValue; } 02023 protected: 02024 }; 02025 02027 02028 class IAX2IeDroppedFrames : public IAX2IeUInt 02029 { 02030 PCLASSINFO(IAX2IeDroppedFrames, IAX2IeUInt); 02031 public: 02035 IAX2IeDroppedFrames(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { }; 02036 02038 virtual void PrintOn(ostream & str) const; 02039 02041 virtual BYTE GetKeyValue() const { return ie_recDropped; } 02042 02046 virtual void StoreDataIn(IAX2IeData &res) { res.receivedDropped = dataValue; } 02047 protected: 02048 }; 02049 02051 02052 class IAX2IeReceivedOoo : public IAX2IeUInt 02053 { 02054 PCLASSINFO(IAX2IeReceivedOoo, IAX2IeUInt); 02055 public: 02059 IAX2IeReceivedOoo(BYTE length, BYTE *srcData) : IAX2IeUInt(length, srcData) { }; 02060 02062 virtual void PrintOn(ostream & str) const; 02063 02065 virtual BYTE GetKeyValue() const { return ie_recOoo; } 02066 02070 virtual void StoreDataIn(IAX2IeData &res) { res.receivedOoo = dataValue; } 02071 protected: 02072 }; 02073 02075 02082 class IAX2IeCallToken : public IAX2IeBinary 02083 { 02084 PCLASSINFO(IAX2IeCallToken, IAX2IeBinary); 02085 public: 02088 IAX2IeCallToken(BYTE length, BYTE *srcData) 02089 : IAX2IeBinary(length, srcData) { }; 02090 02093 IAX2IeCallToken() : IAX2IeBinary(0, NULL) {}; 02094 02096 virtual void PrintOn(ostream & str) const; 02097 02099 virtual BYTE GetKeyValue() const { return ie_callToken; } 02100 02104 virtual void StoreDataIn(IAX2IeData &res) { res.callToken = dataValue; } 02105 02109 static void InitialiseKey(); 02110 02112 void WriteKeySequence(PIPSocket::Address & remoteAddress); 02113 02116 static PBoolean ValidKeySequence (IAX2IeCallToken & cf, 02117 PIPSocket::Address & remote); 02118 02119 protected: 02122 static PString ReportKeySequence(const PString & time, PIPSocket::Address & remote); 02123 02126 enum { 02127 iKeyValue = 0x36, 02128 oKeyValue = 0x5c, 02129 blockSize = 64 02130 }; 02131 02134 static PString secretKey; 02135 02138 static BYTE iKeyPad[blockSize]; 02139 02141 static BYTE oKeyPad[blockSize]; 02142 }; 02144 02145 02146 PDECLARE_LIST (IAX2IeList, IAX2Ie *) 02147 #ifdef DOC_PLUS_PLUS 02148 02149 class IAX2IeList : public IAX2Ie * 02150 { 02151 #endif 02152 public: 02154 ~IAX2IeList(); 02155 02159 IAX2Ie *RemoveIeAt(PINDEX i); 02160 02164 IAX2Ie *RemoveLastIe(); 02165 02167 void Initialise() { DisallowDeleteObjects(); } 02168 02170 void DeleteAt(PINDEX idex); 02171 02173 PBoolean Empty() const { return GetSize() == 0; } 02174 02176 PBoolean IsEmpty() const { return GetSize() == 0; } 02177 02179 void AppendIe(IAX2Ie *newMember) { Append(newMember);} 02180 02182 int GetBinaryDataSize() const; 02183 02185 IAX2Ie * GetIeAt(int i) const; 02186 02187 protected: 02188 02189 }; 02190 02191 02192 #endif // OPAL_IAX2 02193 02194 #endif // OPAL_IAX2_IES_H 02195 02196 /* The comment below is magic for those who use emacs to edit this file. 02197 * With the comment below, the tab key does auto indent to 2 spaces. 02198 * 02199 * Local Variables: 02200 * mode:c 02201 * c-basic-offset:2 02202 * End: 02203 */