)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » EmsOntSipInfo (Ia.Ftn.Cl.Models.Huawei)

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 Fixed Telecommunications Network (FTN) entity model.

    1: using System;
    2: using System.ComponentModel.DataAnnotations;
    3: using System.ComponentModel.DataAnnotations.Schema;
    4: using System.Linq;
    5: using System.Threading;
    6: using System.Threading.Tasks;
    7:  
    8: namespace Ia.Ftn.Cl.Models.Huawei
    9: {
   10:     ////////////////////////////////////////////////////////////////////////////
   11:  
   12:     /// <summary publish="true">
   13:     /// Huawei's EMS ONT SIP INFO Entity Framework class for Fixed Telecommunications Network (FTN) entity model.
   14:     /// </summary>
   15:     /// 
   16:     /// <remarks> 
   17:     /// Copyright © 2006-2021 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   18:     ///
   19:     /// 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
   20:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   21:     ///
   22:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   23:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   24:     /// 
   25:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   26:     /// 
   27:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   28:     /// </remarks> 
   29:     public class EmsOntSipInfo : IEquatable<EmsOntSipInfo>
   30:     {
   31:         /*
   32:          * iManager_NCE_V200R014C60_TL1_NBI_User_Guide_13.pdf
   33:          * 
   34:          * 14.7.24 Querying ONT SIP User Accounts (LST-ONTSIPINFO)
   35:          * 
   36:          * 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
   37:          *  
   38:          */
   39:  
   40:         /// <summary/>
   41:         //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 }
   42:  
   43:         /// <summary/>
   44:         public EmsOntSipInfo() { }
   45:  
   46:         /// <summary/>
   47:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   48:         public string Id { get; set; }
   49:  
   50:         /// <summary>
   51:         /// Last ResultCode of device
   52:         /// </summary>
   53:         public long ResultCode { get; set; }
   54:  
   55:         /// <summary>
   56:         /// Operational state ID of the device
   57:         /// </summary>
   58:         public int StateId { get; set; }
   59:  
   60:         /// <summary>        
   61:         /// SIPUSERNAME OCTET STRING SIZE (64) Indicates the registration user name of a SIP user port. This value is a phone number.
   62:         /// </summary>
   63:         public string SIPUSERNAME { get; set; }
   64:  
   65:         /// <summary>        
   66:         /// SIPUSERPWD OCTET STRING SIZE (64) Indicates the password of a SIP user port.
   67:         /// </summary>
   68:         public string SIPUSERPWD { get; set; }
   69:  
   70:         /// <summary>        
   71:         /// SIPNAME OCTET STRING SIZE (64) Indicates the authentication user name of a SIP user port.
   72:         /// </summary>
   73:         public string SIPNAME { get; set; }
   74:  
   75:         /// <summary>        
   76:         /// Tel designation used to speficity the POT
   77:         /// </summary>
   78:         public int TEL { get; set; }
   79:  
   80:         /// <summary/>
   81:         public DateTime Created { get; set; }
   82:  
   83:         /// <summary/>
   84:         public DateTime Updated { get; set; }
   85:  
   86:         /// <summary/>
   87:         [ForeignKey("EmsOnt_Id")]
   88:         public virtual Ia.Ftn.Cl.Models.Huawei.EmsOnt EmsOnt { get; set; }
   89:  
   90:         ////////////////////////////////////////////////////////////////////////////
   91:  
   92:         /// <summary>
   93:         ///
   94:         /// </summary>
   95:         [NotMapped]
   96:         public string ResultCodeString
   97:         {
   98:             get
   99:             {
  100:                 return this.ResultCode.ToString();
  101:             }
  102:         }
  103:  
  104:         ////////////////////////////////////////////////////////////////////////////
  105:  
  106:         /// <summary>
  107:         ///
  108:         /// </summary>
  109:         [NotMapped]
  110:         public string State
  111:         {
  112:             get
  113:             {
  114:                 return Ia.Ftn.Cl.Models.Data.Huawei.Ems.BellcoreStateFromId(this.StateId);
  115:             }
  116:         }
  117:  
  118:         ////////////////////////////////////////////////////////////////////////////
  119:  
  120:         /// <summary>
  121:         ///
  122:         /// </summary>
  123:         public static bool operator ==(Ia.Ftn.Cl.Models.Huawei.EmsOntSipInfo a, Ia.Ftn.Cl.Models.Huawei.EmsOntSipInfo b)
  124:         {
  125:             bool areEqual;
  126:  
  127:             if (ReferenceEquals(a, b)) areEqual = true;
  128:             else if (ReferenceEquals(a, null)) areEqual = false;
  129:             else if (ReferenceEquals(b, null)) areEqual = false;
  130:             else
  131:             {
  132:                 if (a.ResultCode != b.ResultCode) areEqual = false;
  133:                 else if (a.StateId != b.StateId) areEqual = false;
  134:                 else if (a.SIPUSERNAME != b.SIPUSERNAME) areEqual = false;
  135:                 else if (a.SIPUSERPWD != b.SIPUSERPWD) areEqual = false;
  136:                 else if (a.SIPNAME != b.SIPNAME) areEqual = false;
  137:                 else if (a.TEL != b.TEL) areEqual = false;
  138:                 else if (a.EmsOnt.Id != b.EmsOnt.Id) areEqual = false;
  139:                 else areEqual = true;
  140:             }
  141:  
  142:             return areEqual;
  143:         }
  144:  
  145:         ////////////////////////////////////////////////////////////////////////////
  146:  
  147:         /// <summary>
  148:         ///
  149:         /// </summary>
  150:         public static bool operator !=(Ia.Ftn.Cl.Models.Huawei.EmsOntSipInfo a, Ia.Ftn.Cl.Models.Huawei.EmsOntSipInfo b)
  151:         {
  152:             return !(a == b);
  153:         }
  154:  
  155:         ////////////////////////////////////////////////////////////////////////////
  156:  
  157:         /// <summary>
  158:         ///
  159:         /// </summary>
  160:         public bool Equals(EmsOntSipInfo emsOntSipInfo)
  161:         {
  162:             // below: this will not check the Id, Created, Updated fields
  163:             bool areEqual;
  164:  
  165:             if (ReferenceEquals(null, emsOntSipInfo)) areEqual = false;
  166:             else if (ReferenceEquals(this, emsOntSipInfo)) areEqual = true;
  167:             else
  168:             {
  169:                 if (this.ResultCode != emsOntSipInfo.ResultCode) areEqual = false;
  170:                 else if (this.StateId != emsOntSipInfo.StateId) areEqual = false;
  171:                 else if (this.SIPUSERNAME != emsOntSipInfo.SIPUSERNAME) areEqual = false;
  172:                 else if (this.SIPUSERPWD != emsOntSipInfo.SIPUSERPWD) areEqual = false;
  173:                 else if (this.SIPNAME != emsOntSipInfo.SIPNAME) areEqual = false;
  174:                 else if (this.TEL != emsOntSipInfo.TEL) areEqual = false;
  175:                 else if (this.EmsOnt.Id != emsOntSipInfo.EmsOnt.Id) areEqual = false;
  176:                 else areEqual = true;
  177:             }
  178:  
  179:             return areEqual;
  180:         }
  181:  
  182:         ////////////////////////////////////////////////////////////////////////////
  183:  
  184:         /// <summary>
  185:         ///
  186:         /// </summary>
  187:         public override bool Equals(object obj)
  188:         {
  189:             bool areEqual;
  190:  
  191:             if (ReferenceEquals(null, obj)) areEqual = false;
  192:             else if (ReferenceEquals(this, obj)) areEqual = true;
  193:             else
  194:             {
  195:                 areEqual = obj.GetType() == GetType() && Equals((EmsOntSipInfo)obj);
  196:             }
  197:  
  198:             return areEqual;
  199:         }
  200:  
  201:         ////////////////////////////////////////////////////////////////////////////
  202:  
  203:         /// <summary>
  204:         ///
  205:         /// </summary>
  206:         public override int GetHashCode()
  207:         {
  208:             unchecked
  209:             {
  210:                 int hashCode;
  211:  
  212:                 hashCode = ResultCode.GetHashCode();
  213:                 hashCode = (hashCode * 397) ^ StateId.GetHashCode();
  214:                 hashCode = (hashCode * 397) ^ SIPUSERNAME.GetHashCode();
  215:                 hashCode = (hashCode * 397) ^ SIPUSERPWD.GetHashCode();
  216:                 hashCode = (hashCode * 397) ^ SIPNAME.GetHashCode();
  217:                 hashCode = (hashCode * 397) ^ TEL.GetHashCode();
  218:                 hashCode = (hashCode * 397) ^ EmsOnt.Id.GetHashCode();
  219:  
  220:                 return hashCode;
  221:             }
  222:         }
  223:  
  224:         ////////////////////////////////////////////////////////////////////////////
  225:  
  226:         /// <summary>
  227:         ///
  228:         /// </summary>
  229:         public bool Update(Ia.Ftn.Cl.Models.Huawei.EmsOntSipInfo updatedItem)
  230:         {
  231:             // below: this will not update Id, Created
  232:             bool updated;
  233:  
  234:             updated = false;
  235:  
  236:             if (this.ResultCode != updatedItem.ResultCode) { this.ResultCode = updatedItem.ResultCode; updated = true; }
  237:             if (this.StateId != updatedItem.StateId) { this.StateId = updatedItem.StateId; updated = true; }
  238:             if (this.SIPUSERNAME != updatedItem.SIPUSERNAME) { this.SIPUSERNAME = updatedItem.SIPUSERNAME; updated = true; }
  239:             if (this.SIPUSERPWD != updatedItem.SIPUSERPWD) { this.SIPUSERPWD = updatedItem.SIPUSERPWD; updated = true; }
  240:             if (this.SIPNAME != updatedItem.SIPNAME) { this.SIPNAME = updatedItem.SIPNAME; updated = true; }
  241:             if (this.TEL != updatedItem.TEL) { this.TEL = updatedItem.TEL; updated = true; }
  242:             if (this.EmsOnt != updatedItem.EmsOnt) { this.EmsOnt = updatedItem.EmsOnt; updated = true; }
  243:  
  244:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  245:  
  246:             return updated;
  247:         }
  248:  
  249:         ////////////////////////////////////////////////////////////////////////////
  250:         ////////////////////////////////////////////////////////////////////////////
  251:  
  252:         /// <summary>
  253:         ///
  254:         /// </summary>
  255:         public string ToSimpleTextString()
  256:         {
  257:             return Ia.Ftn.Cl.Models.Data.Huawei.OntSipInfo.ToSimpleTextString(this);
  258:         }
  259:  
  260:         ////////////////////////////////////////////////////////////////////////////
  261:         ////////////////////////////////////////////////////////////////////////////
  262:     }
  263:  
  264:     ////////////////////////////////////////////////////////////////////////////
  265:     ////////////////////////////////////////////////////////////////////////////
  266: }