شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة ش.ش.و.

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » EmsOntSipInfo

Public general use code classes and xml files that we've compiled and used over the years:

Huawei's EMS ONT SIP INFO Entity Framework class for Next Generation Network (NGN) entity model.

   1:  using System;
   2:  using System.ComponentModel.DataAnnotations;
   3:  using System.ComponentModel.DataAnnotations.Schema;
   4:   
   5:  namespace Ia.Ngn.Cl.Model.Huawei
   6:  {
   7:      ////////////////////////////////////////////////////////////////////////////
   8:   
   9:      /// <summary publish="true">
  10:      /// Huawei's EMS ONT SIP INFO Entity Framework class for Next Generation Network (NGN) entity model.
  11:      /// </summary>
  12:      /// 
  13:      /// <remarks> 
  14:      /// Copyright © 2006-2020 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
  15:      ///
  16:      /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
  17:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  18:      ///
  19:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  20:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  21:      /// 
  22:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  23:      /// 
  24:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  25:      /// </remarks> 
  26:      public partial class EmsOntSipInfo : IEquatable<EmsOntSipInfo>
  27:      {
  28:          /*
  29:           * iManager_NCE_V200R014C60_TL1_NBI_User_Guide_13.pdf
  30:           * 
  31:           * 14.7.24 Querying ONT SIP User Accounts (LST-ONTSIPINFO)
  32:           * 
  33:           * Command Format LST-ONTSIPINFO::(DID=Device-ID|DEV=Device-name),((FN=Frame-id,SN=Slot-id,PN=Portid,ONTID=ont-id)|(ONTKEY=ont-key))[,SIPUSERNAME=Sip-userName]:{ctag}::; Supporting Device Device Type No. Device Type 34 MA5680T (V800R008C00 and later versions) 249 MA5600T (V800R008C00 and later versions) 2331 MA5608T 95 MA5603T (V800R008C00 and later versions) 2346/2349/2352/2353 MA5800-X17/MA5800-X7/MA5800-X15/MA5800-X2
  34:           *  
  35:           */
  36:   
  37:          /// <summary/>
  38:          //public enum ServiceTypeList { IMPU = 1, TEMPLATEIDX, DSPIDX, LP, CSC, UNAME, VCCFLAG, VTFLAG, NSCFU, NSCFUVM, NSCFB, NSCFBVM, NSCFNR, NSCFNRVM, NSCFNL, NSCFNLVM, NSCD, NSCDVM, NSCFNRC, NSCFNRCVM, NSCLIP, NSCIDCW, NSRIO, NSCNIP, NSCLIR, NSRIP, NSCNIR, NSRID, NSNRID, NSRND, NSNRND, NSCW, NSCCW, NSOIP, NSACRM, NSGOIR, NSMOIR, NSTIP, NSTIR, NSOTIR, NSCLIPNOSCREENING, NSCR, NSWAKE_UP, NSAOC_D, NSAOC_E, NSXEXH, NSXEGJ, NSCWCFNR, NSIIFC, NSDN_CALL_OUT_BAR, NSCCBS, NSCCNR, NSCCBSR, NSCCNRR, NS3PTY, NSNPTY, NSDND, NSMCR, NSCBA, NSTMP_LIN, NSCODEC_CNTRL, NSMWI, NSDC, NSHOLD, NSECT, NSCFTB, NSDAN, NSSTOP_SECRET, NSMCID, NSEBO, NSICO, NSOUTG, NSINQYH, NSUINFO, NSDN_CALL_OUT_ALLOW, NSSIC, NSSOC, NSSETCFNRTIME, NSCFS, NSCFSB, NSFAX, NSABRC, NSACRTOVM, NSPREPAID, NSCRBT, NSICB, NSMRINGING, NSCIS, NSCBEG, NSCOLP, NSCOLR, NSCOLPOVR, NSBAOC, NSBOIC, NSBOICEXHC, NSBAIC, NSBICROM, NSSPEED_DIAL, NSSD1D, NSSD2D, NSGRNCALL, NSCPARK, NSGAA, NSQSNS, NSMSN, NSHOTLINE, NSAOC_S, NSNIGHTSRV, NSBACKNUM, NSAUTOCON, NSCAMPON, NSCTD, NSCLICKHOLD, NSQUEUE, NSSANSWER, NSICENCF, NSCFGO, NSCECT, NSCTGO, NSCTIO, NSSETBUSY, NSOVERSTEP, NSABSENT, NSMONITOR, NSFMONITOR, NSDISCNT, NSFDISCNT, NSINSERT, NSFINSERT, NSASI, NSPWCB, NSRD, NSLCPS, NSNCPS, NSICPS, NSCBCLOCK, NSMINIBAR, NSMCN, NSDSTR, NSOPRREG, NSONEKEY, NSINBOUND, NSOUTBOUND, NSCALLERID, NSCUN, NSIPTVVC, NSNP, NSSEC, NSSECSTA, NSHRCN, NSSB, NSOCCR, LCO, LC, LCT, NTT, ITT, ICTX, OCTX, INTT, IITT, ICLT, ICDDD, ICIDD, IOLT, CTLCO, CTLCT, CTLD, CTINTNANP, CTINTWORLD, CTDA, CTOSM, CTOSP, CTOSP1, CCO1, CCO2, CCO3, CCO4, CCO5, CCO6, CCO7, CCO8, CCO9, CCO10, CCO11, CCO12, CCO13, CCO14, CCO15, CCO16, HIGHENTCO, OPERATOR, SUPYSRV, IDDCI, NTCI, LTCI, RSC, CIG, OUTRST, INRST, NOAT, RINGCOUNT, VMAIND, VDMAIND, TGRP, TIDHLD, TIDCW, SCF, LMTGRP, FLBGRP, SLBGRP, COP, G711_64K_A_LAW, G711_64K_U_LAW, G722, G723, G726, G728, G729, CODEC_MP4A, CODEC2833, CODEC2198, G726_40, G726_32, G726_24, G726_16, AMR, CLEARMODE, ILBC, SPEEX, G729EV, EVRC, EVRCB, H261, H263, CODEC_MP4V, H264, T38, T120, G711A_VBD, G711U_VBD, G726_VBD, G726_40_VBD, G726_32_VBD, G726_24_VBD, G726_16_VBD, WIND_BAND_AMR, GSM610, H263_2000, BROADVOICE_32, UNKNOWN_CODEC, ACODEC, VCODEC, POLIDX, NCPI, ICPI, EBOCL, EBOPL, EBOIT, RM, CPC, PCHG, TFPT, CHT, MCIDMODE, MCIDCMODE, MCIDAMODE, PREPAIDIDX, CRBTID, ODBBICTYPE, ODBBOCTYPE, ODBBARTYPE, ODBSS, ODBBRCFTYPE, PNOTI, MAXPARACALL, ATSDTMBUSY, CALLCOUNT, CDNOTICALLER, ISCHGFLAG, CHC, CUSER, CGRP, CUSERGRP, STCF, CHARSC, REGUIDX, SOCBFUNC, SOCBPTONEIDX, ADMINCBA, ADCONTROL_DIVERSION, DPR, PRON, CPCRUS, CUSCAT, SPT100REL }
  39:   
  40:          /// <summary/>
  41:          public EmsOntSipInfo() { }
  42:   
  43:          /// <summary/>
  44:          [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
  45:          public string Id { get; set; }
  46:   
  47:          /// <summary>
  48:          /// Last ResultCode of device
  49:          /// </summary>
  50:          public long ResultCode { get; set; }
  51:   
  52:          /// <summary>
  53:          /// Operational state ID of the device
  54:          /// </summary>
  55:          public int StateId { get; set; }
  56:   
  57:          /// <summary>        
  58:          /// SIPUSERNAME OCTET STRING SIZE (64) Indicates the registration user name of a SIP user port. This value is a phone number.
  59:          /// </summary>
  60:          public string SIPUSERNAME { get; set; }
  61:   
  62:          /// <summary>        
  63:          /// SIPUSERPWD OCTET STRING SIZE (64) Indicates the password of a SIP user port.
  64:          /// </summary>
  65:          public string SIPUSERPWD { get; set; }
  66:   
  67:          /// <summary>        
  68:          /// SIPNAME OCTET STRING SIZE (64) Indicates the authentication user name of a SIP user port.
  69:          /// </summary>
  70:          public string SIPNAME { get; set; }
  71:   
  72:          /// <summary>        
  73:          /// Tel designation used to speficity the POT
  74:          /// </summary>
  75:          public int TEL { get; set; }
  76:   
  77:          /// <summary/>
  78:          public DateTime Created { get; set; }
  79:   
  80:          /// <summary/>
  81:          public DateTime Updated { get; set; }
  82:   
  83:          /// <summary/>
  84:          public virtual Ia.Ngn.Cl.Model.Huawei.EmsOnt EmsOnt { get; set; }
  85:   
  86:          ////////////////////////////////////////////////////////////////////////////
  87:   
  88:          /// <summary>
  89:          ///
  90:          /// </summary>
  91:          [NotMapped]
  92:          public string ResultCodeString
  93:          {
  94:              get
  95:              {
  96:                  return this.ResultCode.ToString();
  97:              }
  98:          }
  99:   
 100:          ////////////////////////////////////////////////////////////////////////////
 101:   
 102:          /// <summary>
 103:          ///
 104:          /// </summary>
 105:          [NotMapped]
 106:          public string State
 107:          {
 108:              get
 109:              {
 110:                  return Ia.Ngn.Cl.Model.Data.Huawei.Ems.BellcoreStateFromId(this.StateId);
 111:              }
 112:          }
 113:   
 114:          ////////////////////////////////////////////////////////////////////////////
 115:   
 116:          /// <summary>
 117:          ///
 118:          /// </summary>
 119:          public static bool operator ==(Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo a, Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo b)
 120:          {
 121:              bool areEqual;
 122:   
 123:              if (ReferenceEquals(a, b)) areEqual = true;
 124:              else if (ReferenceEquals(a, null)) areEqual = false;
 125:              else if (ReferenceEquals(b, null)) areEqual = false;
 126:              else
 127:              {
 128:                  if (a.ResultCode != b.ResultCode) areEqual = false;
 129:                  else if (a.StateId != b.StateId) areEqual = false;
 130:                  else if (a.SIPUSERNAME != b.SIPUSERNAME) areEqual = false;
 131:                  else if (a.SIPUSERPWD != b.SIPUSERPWD) areEqual = false;
 132:                  else if (a.SIPNAME != b.SIPNAME) areEqual = false;
 133:                  else if (a.TEL != b.TEL) areEqual = false;
 134:                  else if (a.EmsOnt.Id != b.EmsOnt.Id) areEqual = false;
 135:                  else areEqual = true;
 136:              }
 137:   
 138:              return areEqual;
 139:          }
 140:   
 141:          ////////////////////////////////////////////////////////////////////////////
 142:   
 143:          /// <summary>
 144:          ///
 145:          /// </summary>
 146:          public static bool operator !=(Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo a, Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo b)
 147:          {
 148:              return !(a == b);
 149:          }
 150:   
 151:          ////////////////////////////////////////////////////////////////////////////
 152:   
 153:          /// <summary>
 154:          ///
 155:          /// </summary>
 156:          public bool Equals(EmsOntSipInfo emsOntSipInfo)
 157:          {
 158:              // below: this will not check the Id, Created, Updated fields
 159:              bool areEqual;
 160:   
 161:              if (ReferenceEquals(null, emsOntSipInfo)) areEqual = false;
 162:              else if (ReferenceEquals(this, emsOntSipInfo)) areEqual = true;
 163:              else
 164:              {
 165:                  if (this.ResultCode != emsOntSipInfo.ResultCode) areEqual = false;
 166:                  else if (this.StateId != emsOntSipInfo.StateId) areEqual = false;
 167:                  else if (this.SIPUSERNAME != emsOntSipInfo.SIPUSERNAME) areEqual = false;
 168:                  else if (this.SIPUSERPWD != emsOntSipInfo.SIPUSERPWD) areEqual = false;
 169:                  else if (this.SIPNAME != emsOntSipInfo.SIPNAME) areEqual = false;
 170:                  else if (this.TEL != emsOntSipInfo.TEL) areEqual = false;
 171:                  else if (this.EmsOnt.Id != emsOntSipInfo.EmsOnt.Id) areEqual = false;
 172:                  else areEqual = true;
 173:              }
 174:   
 175:              return areEqual;
 176:          }
 177:   
 178:          ////////////////////////////////////////////////////////////////////////////
 179:   
 180:          /// <summary>
 181:          ///
 182:          /// </summary>
 183:          public override bool Equals(object obj)
 184:          {
 185:              bool areEqual;
 186:   
 187:              if (ReferenceEquals(null, obj)) areEqual = false;
 188:              else if (ReferenceEquals(this, obj)) areEqual = true;
 189:              else
 190:              {
 191:                  areEqual = obj.GetType() == GetType() && Equals((EmsOntSipInfo)obj);
 192:              }
 193:   
 194:              return areEqual;
 195:          }
 196:   
 197:          ////////////////////////////////////////////////////////////////////////////
 198:   
 199:          /// <summary>
 200:          ///
 201:          /// </summary>
 202:          public override int GetHashCode()
 203:          {
 204:              unchecked
 205:              {
 206:                  int hashCode;
 207:   
 208:                  hashCode = ResultCode.GetHashCode();
 209:                  hashCode = (hashCode * 397) ^ StateId.GetHashCode();
 210:                  hashCode = (hashCode * 397) ^ SIPUSERNAME.GetHashCode();
 211:                  hashCode = (hashCode * 397) ^ SIPUSERPWD.GetHashCode();
 212:                  hashCode = (hashCode * 397) ^ SIPNAME.GetHashCode();
 213:                  hashCode = (hashCode * 397) ^ TEL.GetHashCode();
 214:                  hashCode = (hashCode * 397) ^ EmsOnt.Id.GetHashCode();
 215:   
 216:                  return hashCode;
 217:              }
 218:          }
 219:   
 220:          ////////////////////////////////////////////////////////////////////////////
 221:   
 222:          /// <summary>
 223:          ///
 224:          /// </summary>
 225:          public bool Update(Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo updatedItem)
 226:          {
 227:              // below: this will not update Id, Created
 228:              bool updated;
 229:   
 230:              updated = false;
 231:   
 232:              if (this.ResultCode != updatedItem.ResultCode) { this.ResultCode = updatedItem.ResultCode; updated = true; }
 233:              if (this.StateId != updatedItem.StateId) { this.StateId = updatedItem.StateId; updated = true; }
 234:              if (this.SIPUSERNAME != updatedItem.SIPUSERNAME) { this.SIPUSERNAME = updatedItem.SIPUSERNAME; updated = true; }
 235:              if (this.SIPUSERPWD != updatedItem.SIPUSERPWD) { this.SIPUSERPWD = updatedItem.SIPUSERPWD; updated = true; }
 236:              if (this.SIPNAME != updatedItem.SIPNAME) { this.SIPNAME = updatedItem.SIPNAME; updated = true; }
 237:              if (this.TEL != updatedItem.TEL) { this.TEL = updatedItem.TEL; updated = true; }
 238:              if (this.EmsOnt != updatedItem.EmsOnt) { this.EmsOnt = updatedItem.EmsOnt; updated = true; }
 239:   
 240:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
 241:   
 242:              return updated;
 243:          }
 244:   
 245:          ////////////////////////////////////////////////////////////////////////////
 246:          ////////////////////////////////////////////////////////////////////////////
 247:   
 248:          /// <summary>
 249:          ///
 250:          /// </summary>
 251:          public string ToSimpleTextString()
 252:          {
 253:              return Ia.Ngn.Cl.Model.Data.Huawei.OntSipInfo.ToSimpleTextString(this);
 254:          }
 255:   
 256:          ////////////////////////////////////////////////////////////////////////////
 257:          ////////////////////////////////////////////////////////////////////////////
 258:      }
 259:   
 260:      ////////////////////////////////////////////////////////////////////////////
 261:      ////////////////////////////////////////////////////////////////////////////
 262:  }