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

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:          [ForeignKey("EmsOnt_Id")]
  85:          public virtual Ia.Ngn.Cl.Model.Huawei.EmsOnt EmsOnt { get; set; }
  86:   
  87:          ////////////////////////////////////////////////////////////////////////////
  88:   
  89:          /// <summary>
  90:          ///
  91:          /// </summary>
  92:          [NotMapped]
  93:          public string ResultCodeString
  94:          {
  95:              get
  96:              {
  97:                  return this.ResultCode.ToString();
  98:              }
  99:          }
 100:   
 101:          ////////////////////////////////////////////////////////////////////////////
 102:   
 103:          /// <summary>
 104:          ///
 105:          /// </summary>
 106:          [NotMapped]
 107:          public string State
 108:          {
 109:              get
 110:              {
 111:                  return Ia.Ngn.Cl.Model.Data.Huawei.Ems.BellcoreStateFromId(this.StateId);
 112:              }
 113:          }
 114:   
 115:          ////////////////////////////////////////////////////////////////////////////
 116:   
 117:          /// <summary>
 118:          ///
 119:          /// </summary>
 120:          public static bool operator ==(Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo a, Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo b)
 121:          {
 122:              bool areEqual;
 123:   
 124:              if (ReferenceEquals(a, b)) areEqual = true;
 125:              else if (ReferenceEquals(a, null)) areEqual = false;
 126:              else if (ReferenceEquals(b, null)) areEqual = false;
 127:              else
 128:              {
 129:                  if (a.ResultCode != b.ResultCode) areEqual = false;
 130:                  else if (a.StateId != b.StateId) areEqual = false;
 131:                  else if (a.SIPUSERNAME != b.SIPUSERNAME) areEqual = false;
 132:                  else if (a.SIPUSERPWD != b.SIPUSERPWD) areEqual = false;
 133:                  else if (a.SIPNAME != b.SIPNAME) areEqual = false;
 134:                  else if (a.TEL != b.TEL) areEqual = false;
 135:                  else if (a.EmsOnt.Id != b.EmsOnt.Id) areEqual = false;
 136:                  else areEqual = true;
 137:              }
 138:   
 139:              return areEqual;
 140:          }
 141:   
 142:          ////////////////////////////////////////////////////////////////////////////
 143:   
 144:          /// <summary>
 145:          ///
 146:          /// </summary>
 147:          public static bool operator !=(Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo a, Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo b)
 148:          {
 149:              return !(a == b);
 150:          }
 151:   
 152:          ////////////////////////////////////////////////////////////////////////////
 153:   
 154:          /// <summary>
 155:          ///
 156:          /// </summary>
 157:          public bool Equals(EmsOntSipInfo emsOntSipInfo)
 158:          {
 159:              // below: this will not check the Id, Created, Updated fields
 160:              bool areEqual;
 161:   
 162:              if (ReferenceEquals(null, emsOntSipInfo)) areEqual = false;
 163:              else if (ReferenceEquals(this, emsOntSipInfo)) areEqual = true;
 164:              else
 165:              {
 166:                  if (this.ResultCode != emsOntSipInfo.ResultCode) areEqual = false;
 167:                  else if (this.StateId != emsOntSipInfo.StateId) areEqual = false;
 168:                  else if (this.SIPUSERNAME != emsOntSipInfo.SIPUSERNAME) areEqual = false;
 169:                  else if (this.SIPUSERPWD != emsOntSipInfo.SIPUSERPWD) areEqual = false;
 170:                  else if (this.SIPNAME != emsOntSipInfo.SIPNAME) areEqual = false;
 171:                  else if (this.TEL != emsOntSipInfo.TEL) areEqual = false;
 172:                  else if (this.EmsOnt.Id != emsOntSipInfo.EmsOnt.Id) areEqual = false;
 173:                  else areEqual = true;
 174:              }
 175:   
 176:              return areEqual;
 177:          }
 178:   
 179:          ////////////////////////////////////////////////////////////////////////////
 180:   
 181:          /// <summary>
 182:          ///
 183:          /// </summary>
 184:          public override bool Equals(object obj)
 185:          {
 186:              bool areEqual;
 187:   
 188:              if (ReferenceEquals(null, obj)) areEqual = false;
 189:              else if (ReferenceEquals(this, obj)) areEqual = true;
 190:              else
 191:              {
 192:                  areEqual = obj.GetType() == GetType() && Equals((EmsOntSipInfo)obj);
 193:              }
 194:   
 195:              return areEqual;
 196:          }
 197:   
 198:          ////////////////////////////////////////////////////////////////////////////
 199:   
 200:          /// <summary>
 201:          ///
 202:          /// </summary>
 203:          public override int GetHashCode()
 204:          {
 205:              unchecked
 206:              {
 207:                  int hashCode;
 208:   
 209:                  hashCode = ResultCode.GetHashCode();
 210:                  hashCode = (hashCode * 397) ^ StateId.GetHashCode();
 211:                  hashCode = (hashCode * 397) ^ SIPUSERNAME.GetHashCode();
 212:                  hashCode = (hashCode * 397) ^ SIPUSERPWD.GetHashCode();
 213:                  hashCode = (hashCode * 397) ^ SIPNAME.GetHashCode();
 214:                  hashCode = (hashCode * 397) ^ TEL.GetHashCode();
 215:                  hashCode = (hashCode * 397) ^ EmsOnt.Id.GetHashCode();
 216:   
 217:                  return hashCode;
 218:              }
 219:          }
 220:   
 221:          ////////////////////////////////////////////////////////////////////////////
 222:   
 223:          /// <summary>
 224:          ///
 225:          /// </summary>
 226:          public bool Update(Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo updatedItem)
 227:          {
 228:              // below: this will not update Id, Created
 229:              bool updated;
 230:   
 231:              updated = false;
 232:   
 233:              if (this.ResultCode != updatedItem.ResultCode) { this.ResultCode = updatedItem.ResultCode; updated = true; }
 234:              if (this.StateId != updatedItem.StateId) { this.StateId = updatedItem.StateId; updated = true; }
 235:              if (this.SIPUSERNAME != updatedItem.SIPUSERNAME) { this.SIPUSERNAME = updatedItem.SIPUSERNAME; updated = true; }
 236:              if (this.SIPUSERPWD != updatedItem.SIPUSERPWD) { this.SIPUSERPWD = updatedItem.SIPUSERPWD; updated = true; }
 237:              if (this.SIPNAME != updatedItem.SIPNAME) { this.SIPNAME = updatedItem.SIPNAME; updated = true; }
 238:              if (this.TEL != updatedItem.TEL) { this.TEL = updatedItem.TEL; updated = true; }
 239:              if (this.EmsOnt != updatedItem.EmsOnt) { this.EmsOnt = updatedItem.EmsOnt; updated = true; }
 240:   
 241:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
 242:   
 243:              return updated;
 244:          }
 245:   
 246:          ////////////////////////////////////////////////////////////////////////////
 247:          ////////////////////////////////////////////////////////////////////////////
 248:   
 249:          /// <summary>
 250:          ///
 251:          /// </summary>
 252:          public string ToSimpleTextString()
 253:          {
 254:              return Ia.Ngn.Cl.Model.Data.Huawei.OntSipInfo.ToSimpleTextString(this);
 255:          }
 256:   
 257:          ////////////////////////////////////////////////////////////////////////////
 258:          ////////////////////////////////////////////////////////////////////////////
 259:      }
 260:   
 261:      ////////////////////////////////////////////////////////////////////////////
 262:      ////////////////////////////////////////////////////////////////////////////
 263:  }