Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
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-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet 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_U2000_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:          /// SIPUSERNAME OCTET STRING SIZE (64) Indicates the registration user name of a SIP user port. This value is a phone number.
  49:          /// </summary>
  50:          public string SIPUSERNAME { get; set; }
  51:   
  52:          /// <summary>        
  53:          /// SIPUSERPWD OCTET STRING SIZE (64) Indicates the password of a SIP user port.
  54:          /// </summary>
  55:          public string SIPUSERPWD { get; set; }
  56:   
  57:          /// <summary>        
  58:          /// SIPNAME OCTET STRING SIZE (64) Indicates the authentication user name of a SIP user port.
  59:          /// </summary>
  60:          public string SIPNAME { get; set; }
  61:   
  62:          /// <summary>        
  63:          /// Tel designation used to speficity the POT
  64:          /// </summary>
  65:          public int TEL { get; set; }
  66:   
  67:          /// <summary/>
  68:          public DateTime Created { get; set; }
  69:   
  70:          /// <summary/>
  71:          public DateTime Updated { get; set; }
  72:   
  73:          /// <summary/>
  74:          public virtual Ia.Ngn.Cl.Model.Huawei.EmsOnt EmsOnt { get; set; }
  75:   
  76:          ////////////////////////////////////////////////////////////////////////////
  77:   
  78:          /// <summary>
  79:          ///
  80:          /// </summary>
  81:          public static bool operator ==(Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo a, Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo b)
  82:          {
  83:              bool areEqual;
  84:   
  85:              if (ReferenceEquals(a, b)) areEqual = true;
  86:              else if (ReferenceEquals(a, null)) areEqual = false;
  87:              else if (ReferenceEquals(b, null)) areEqual = false;
  88:              else
  89:              {
  90:                  if (a.SIPUSERNAME != b.SIPUSERNAME) areEqual = false;
  91:                  else if (a.SIPUSERPWD != b.SIPUSERPWD) areEqual = false;
  92:                  else if (a.SIPNAME != b.SIPNAME) areEqual = false;
  93:                  else if (a.TEL != b.TEL) areEqual = false;
  94:                  else if (a.EmsOnt.Id != b.EmsOnt.Id) areEqual = false;
  95:                  else areEqual = true;
  96:              }
  97:   
  98:              return areEqual;
  99:          }
 100:   
 101:          ////////////////////////////////////////////////////////////////////////////
 102:   
 103:          /// <summary>
 104:          ///
 105:          /// </summary>
 106:          public static bool operator !=(Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo a, Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo b)
 107:          {
 108:              return !(a == b);
 109:          }
 110:   
 111:          ////////////////////////////////////////////////////////////////////////////
 112:   
 113:          /// <summary>
 114:          ///
 115:          /// </summary>
 116:          public bool Equals(EmsOntSipInfo emsOntSipInfo)
 117:          {
 118:              // below: this will not check the Id, Created, Updated fields
 119:              bool areEqual;
 120:   
 121:              if (ReferenceEquals(null, emsOntSipInfo)) areEqual = false;
 122:              else if (ReferenceEquals(this, emsOntSipInfo)) areEqual = true;
 123:              else
 124:              {
 125:                  if (this.SIPUSERNAME != emsOntSipInfo.SIPUSERNAME) areEqual = false;
 126:                  else if (this.SIPUSERPWD != emsOntSipInfo.SIPUSERPWD) areEqual = false;
 127:                  else if (this.SIPNAME != emsOntSipInfo.SIPNAME) areEqual = false;
 128:                  else if (this.TEL != emsOntSipInfo.TEL) areEqual = false;
 129:                  else if (this.EmsOnt.Id != emsOntSipInfo.EmsOnt.Id) areEqual = false;
 130:                  else areEqual = true;
 131:              }
 132:   
 133:              return areEqual;
 134:          }
 135:   
 136:          ////////////////////////////////////////////////////////////////////////////
 137:   
 138:          /// <summary>
 139:          ///
 140:          /// </summary>
 141:          public override bool Equals(object obj)
 142:          {
 143:              bool areEqual;
 144:   
 145:              if (ReferenceEquals(null, obj)) areEqual = false;
 146:              else if (ReferenceEquals(this, obj)) areEqual = true;
 147:              else
 148:              {
 149:                  areEqual = obj.GetType() == GetType() && Equals((EmsOntSipInfo)obj);
 150:              }
 151:   
 152:              return areEqual;
 153:          }
 154:   
 155:          ////////////////////////////////////////////////////////////////////////////
 156:   
 157:          /// <summary>
 158:          ///
 159:          /// </summary>
 160:          public override int GetHashCode()
 161:          {
 162:              unchecked
 163:              {
 164:                  int hashCode;
 165:                  
 166:                  hashCode = SIPUSERNAME.GetHashCode();
 167:                  hashCode = (hashCode * 397) ^ SIPUSERPWD.GetHashCode();
 168:                  hashCode = (hashCode * 397) ^ SIPNAME.GetHashCode();
 169:                  hashCode = (hashCode * 397) ^ TEL.GetHashCode();
 170:                  hashCode = (hashCode * 397) ^ EmsOnt.Id.GetHashCode();
 171:   
 172:                  return hashCode;
 173:              }
 174:          }
 175:          
 176:          ////////////////////////////////////////////////////////////////////////////
 177:   
 178:          /// <summary>
 179:          ///
 180:          /// </summary>
 181:          public bool Update(Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo updateItem)
 182:          {
 183:              // below: this will not update Id, Created
 184:              bool updated;
 185:   
 186:              updated = false;
 187:   
 188:              if (this.SIPUSERNAME != updateItem.SIPUSERNAME) { this.SIPUSERNAME = updateItem.SIPUSERNAME; updated = true; }
 189:              if (this.SIPUSERPWD != updateItem.SIPUSERPWD) { this.SIPUSERPWD = updateItem.SIPUSERPWD; updated = true; }
 190:              if (this.SIPNAME != updateItem.SIPNAME) { this.SIPNAME = updateItem.SIPNAME; updated = true; }
 191:              if (this.TEL != updateItem.TEL) { this.TEL = updateItem.TEL; updated = true; }
 192:              if (this.EmsOnt != updateItem.EmsOnt) { this.EmsOnt = updateItem.EmsOnt; updated = true; }
 193:   
 194:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
 195:   
 196:              return updated;
 197:          }
 198:   
 199:          ////////////////////////////////////////////////////////////////////////////
 200:          ////////////////////////////////////////////////////////////////////////////
 201:   
 202:          /// <summary>
 203:          ///
 204:          /// </summary>
 205:          public string ToSimpleTextString()
 206:          {
 207:              return Ia.Ngn.Cl.Model.Data.Huawei.OntSipInfo.ToSimpleTextString(this);
 208:          }
 209:   
 210:          ////////////////////////////////////////////////////////////////////////////
 211:          ////////////////////////////////////////////////////////////////////////////
 212:      }
 213:   
 214:      ////////////////////////////////////////////////////////////////////////////
 215:      ////////////////////////////////////////////////////////////////////////////
 216:  }