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

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

Access Management System (AMS) support class for Huawei's Fixed Telecommunications Network (FTN) data model.

    1: using Microsoft.EntityFrameworkCore;
    2: using System;
    3: using System.Collections.Generic;
    4: using System.Data;
    5: using System.Linq;
    6:  
    7: namespace Ia.Ftn.Cl.Models.Data.Huawei
    8: {
    9:     ////////////////////////////////////////////////////////////////////////////
   10:  
   11:     /// <summary publish="true">
   12:     /// Access Management System (AMS) support class for Huawei's Fixed Telecommunications Network (FTN) data model.
   13:     /// </summary>
   14:  
   15:     /// <remarks> 
   16:     /// Copyright © 2016-2022 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   17:     ///
   18:     /// 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
   19:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   20:     ///
   21:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   22:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   23:     /// 
   24:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   25:     /// 
   26:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   27:     /// </remarks> 
   28:     public class Ems
   29:     {
   30:         private static Dictionary<string, string> correlationTagDictionary = new Dictionary<string, string>(1000);
   31:  
   32:         /// <summary/>
   33:         public static Dictionary<string, string> CorrelationTagDictionary { get { return correlationTagDictionary; } set { correlationTagDictionary = value; } }
   34:  
   35:         ////////////////////////////////////////////////////////////////////////////
   36:  
   37:         /// <summary>
   38:         ///
   39:         /// </summary>
   40:         public Ems() { }
   41:  
   42:         ////////////////////////////////////////////////////////////////////////////
   43:  
   44:         /// <summary>
   45:         ///
   46:         /// </summary>
   47:         public static string BellcoreStateFromId(int stateId)
   48:         {
   49:             // see: ColoredBellcoreStateFromId()
   50:             string s;
   51:             Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState bellcoreState;
   52:  
   53:             bellcoreState = (Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState)stateId;
   54:  
   55:             /*
   56:              * IS-NR: (In-Service and Normal) The entity is fully operational and will perform as provisioned.
   57:              * OOS-AU: (Out-of-Service and Autonomous) The entity is not operational because of an autonomous event.
   58:              * OOS-AUMA: (Out-of-Service and Autonomous Management) The entity is not operational because of an autonomous event and has also been manually removed from service.
   59:              * OOS-MA: (Out-of-Service and Management) The entity has been manually removed from service.
   60:              */
   61:  
   62:             switch (bellcoreState)
   63:             {
   64:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.IsNr: s = "IS-NR"; break;
   65:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.OosAu: s = "OOS-AU"; break;
   66:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.OosAuma: s = "OOS-AUMA"; break;
   67:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.OosMa: s = "OOS-MA"; break;
   68:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.Unknown: s = "Unknown"; break;
   69:                 default: s = "Unknown"; break;
   70:             }
   71:  
   72:             return s;
   73:         }
   74:  
   75:         ////////////////////////////////////////////////////////////////////////////
   76:  
   77:         /// <summary>
   78:         ///
   79:         /// </summary>
   80:         public static string ColoredBellcoreStateFromId(int stateId)
   81:         {
   82:             // see: BellcoreStateFromId()
   83:             string s;
   84:             Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState bellcoreState;
   85:  
   86:             bellcoreState = (Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState)stateId;
   87:  
   88:             /*
   89:                 if (b) s = "<span style=\"color:Green\">Active</span>";
   90:                 else s = "<span style=\"color:DarkGoldenRod\">Idle</span>";             */
   91:             switch (bellcoreState)
   92:             {
   93:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.IsNr: s = "<span style=\"color:Green\">IS-NR</span>"; break;
   94:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.OosAu: s = "<span style=\"color:Red\">OOS-AU</span>"; break;
   95:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.OosAuma: s = "<span style=\"color:Red\">OOS-AUMA</span>"; break;
   96:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.OosMa: s = "<span style=\"color:Red\">OOS-MA</span>"; break;
   97:                 case Ia.Ftn.Cl.Models.Business.Huawei.Ems.BellcoreState.Unknown: s = "<span style=\"color:Red\">Unknown</span>"; break;
   98:                 default: s = "Unknown"; break;
   99:             }
  100:  
  101:             return s;
  102:         }
  103:  
  104:         ////////////////////////////////////////////////////////////////////////////
  105:  
  106:         /// <summary>
  107:         ///
  108:         /// </summary>
  109:         public static int NextVacantTelForOnt(Ia.Ftn.Cl.Models.Huawei.EmsOnt emsOnt)
  110:         {
  111:             int telPort;
  112:             List<int> list;
  113:  
  114:             list = Ia.Ftn.Cl.Models.Data.Huawei.Ems.UsedTelListForEmsOntId(emsOnt.Id);
  115:  
  116:             if (list.Count == 0) telPort = 1; // this means OntSipInfo does not exist for any number and the box is empty, and we should create number at 1
  117:             else
  118:             {
  119:                 list = Ia.Cl.Models.Default.ExcludedNumberListFromNumberListWithinRange(list, emsOnt.EquipmentType.TelPorts);
  120:  
  121:                 if (list.Count > 0) telPort = list[0];
  122:                 else telPort = Ia.Ftn.Cl.Models.Business.Default.PortUndefinedOrInvalidOrUnknown; // something went wrong
  123:             }
  124:  
  125:             return telPort;
  126:         }
  127:  
  128:         ////////////////////////////////////////////////////////////////////////////
  129:  
  130:         /// <summary>
  131:         ///
  132:         /// </summary>
  133:         private static List<int> UsedTelListForEmsOntId(string emsOntId)
  134:         {
  135:             List<int> list;
  136:  
  137:             using (var db = new Ia.Ftn.Cl.Db())
  138:             {
  139:                 list = (from eosi in db.EmsOntSipInfoes
  140:                         where eosi.EmsOnt.Id == emsOntId
  141:                         orderby eosi.TEL ascending
  142:                         select eosi.TEL).ToList<int>();
  143:             }
  144:  
  145:             return list;
  146:         }
  147:  
  148:         ////////////////////////////////////////////////////////////////////////////
  149:  
  150:         /// <summary>
  151:         ///
  152:         /// </summary>
  153:         public static List<int> VacantTelForOntList(Ia.Ftn.Cl.Models.Huawei.EmsOnt emsOnt)
  154:         {
  155:             List<int> usedlist, vacantList;
  156:  
  157:             usedlist = Ia.Ftn.Cl.Models.Data.Huawei.Ems.UsedTelListForEmsOntId(emsOnt.Id);
  158:  
  159:             vacantList = Ia.Cl.Models.Default.ExcludedNumberListFromNumberListWithinRange(usedlist, emsOnt.EquipmentType.TelPorts);
  160:  
  161:             return vacantList;
  162:         }
  163:  
  164:         ////////////////////////////////////////////////////////////////////////////
  165:         ////////////////////////////////////////////////////////////////////////////
  166:  
  167:         /// <summary>
  168:         ///
  169:         /// </summary>
  170:         public static Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort NextVacantMduFnSnPnForOnt(Ia.Ftn.Cl.Models.Business.Huawei.Dev.MduDev mdu, Ia.Ftn.Cl.Models.Huawei.EmsOnt emsOnt)
  171:         {
  172:             Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort fnSnPnPort;
  173:             List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> usedList, possibleList, list;
  174:  
  175:             usedList = Ia.Ftn.Cl.Models.Data.Huawei.Ems.UsedEmsVoipPstnUserFnSnPnListForEmsOntId(emsOnt.Id);
  176:  
  177:             if (usedList.Count == 0)
  178:             {
  179:                 fnSnPnPort = mdu.PossibleFnSnPnPortList[0]; // this means EmsVoipPstnUsers does not exist for any number and the box is empty, and we should create number at 0
  180:             }
  181:             else
  182:             {
  183:                 possibleList = mdu.PossibleFnSnPnPortList;
  184:  
  185:                 list = possibleList.Where(p => !usedList.Any(u => u.Fn == p.Fn && u.Sn == p.Sn && u.Pn == p.Pn)).ToList();
  186:  
  187:                 if (list.Count > 0) fnSnPnPort = list[0];
  188:                 else fnSnPnPort = null; // something went wrong
  189:             }
  190:  
  191:             return fnSnPnPort;
  192:         }
  193:  
  194:         ////////////////////////////////////////////////////////////////////////////
  195:  
  196:         /// <summary>
  197:         ///
  198:         /// </summary>
  199:         public static List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> VacantMduFnSnPnForOntList(Ia.Ftn.Cl.Models.Business.Huawei.Dev.MduDev mdu, Ia.Ftn.Cl.Models.Huawei.EmsOnt emsOnt)
  200:         {
  201:             List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> usedList, possibleList, vacantlist;
  202:  
  203:             usedList = Ia.Ftn.Cl.Models.Data.Huawei.Ems.UsedEmsVoipPstnUserFnSnPnListForEmsOntId(emsOnt.Id);
  204:  
  205:             possibleList = mdu.PossibleFnSnPnPortList;
  206:  
  207:             vacantlist = possibleList.Where(p => !usedList.Any(u => u.Fn == p.Fn && u.Sn == p.Sn && u.Pn == p.Pn)).ToList();
  208:  
  209:             return vacantlist;
  210:         }
  211:  
  212:         ////////////////////////////////////////////////////////////////////////////
  213:  
  214:         /// <summary>
  215:         ///
  216:         /// </summary>
  217:         private static List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> UsedEmsVoipPstnUserFnSnPnListForEmsOntId(string emsOntId)
  218:         {
  219:             List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> list;
  220:  
  221:             using (var db = new Ia.Ftn.Cl.Db())
  222:             {
  223:                 list = (from evpu in db.EmsVoipPstnUsers
  224:                         where evpu.EmsOnt != null && evpu.EmsOnt.Id == emsOntId
  225:                         // below select will produce "Exception: System.NotSupportedException: Only parameterless constructors and initializers are supported in LINQ to Entities."
  226:                         // select new Ia.Ftn.Cl.Model.Business.Huawei.Default.FnSnPnPort(evpu.FN, evpu.SN, evpu.PN)).ToList<Ia.Ftn.Cl.Model.Business.Huawei.Default.FnSnPnPort>();
  227:                         select new Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort { Fn = evpu.FN, Sn = evpu.SN, Pn = evpu.PN }).AsNoTracking().ToList<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort>();
  228:             }
  229:  
  230:             return list;
  231:         }
  232:  
  233:         ////////////////////////////////////////////////////////////////////////////
  234:         ////////////////////////////////////////////////////////////////////////////
  235:  
  236:         /// <summary>
  237:         ///
  238:         /// </summary>
  239:         public static Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort NextVacantMsanFnSnPnForMsanDev(Ia.Ftn.Cl.Models.Business.Huawei.Dev.MsanDev msanDev)
  240:         {
  241:             Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort fnSnPn;
  242:             List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> usedList, possibleList, list;
  243:  
  244:             usedList = Ia.Ftn.Cl.Models.Data.Huawei.Ems.UsedEmsVoipPstnUserFnSnPnListForMsanDevDid(msanDev.Did);
  245:  
  246:             if (usedList.Count == 0)
  247:             {
  248:                 fnSnPn = msanDev.PossibleFnSnPnList[0]; // this means EmsVoipPstnUsers does not exist for any number and the box is empty, and we should create number at 0
  249:             }
  250:             else
  251:             {
  252:                 possibleList = msanDev.PossibleFnSnPnList;
  253:  
  254:                 list = possibleList.Where(p => !usedList.Any(u => u.Fn == p.Fn && u.Sn == p.Sn && u.Pn == p.Pn)).ToList();
  255:  
  256:                 if (list.Count > 0) fnSnPn = list[0];
  257:                 else fnSnPn = null; // something went wrong
  258:             }
  259:  
  260:             return fnSnPn;
  261:         }
  262:  
  263:         ////////////////////////////////////////////////////////////////////////////
  264:  
  265:         /// <summary>
  266:         ///
  267:         /// </summary>
  268:         public static List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> VacantMsanFnSnPnListForMsanDev(Ia.Ftn.Cl.Models.Business.Huawei.Dev.MsanDev msanDev)
  269:         {
  270:             List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> usedList, possibleList, vacantlist;
  271:  
  272:             usedList = Ia.Ftn.Cl.Models.Data.Huawei.Ems.UsedEmsVoipPstnUserFnSnPnListForMsanDevDid(msanDev.Did);
  273:  
  274:             possibleList = msanDev.PossibleFnSnPnList;
  275:  
  276:             vacantlist = possibleList.Where(p => !usedList.Any(u => u.Fn == p.Fn && u.Sn == p.Sn && u.Pn == p.Pn)).ToList();
  277:  
  278:             return vacantlist;
  279:         }
  280:  
  281:         ////////////////////////////////////////////////////////////////////////////
  282:  
  283:         /// <summary>
  284:         ///
  285:         /// </summary>
  286:         private static List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> UsedEmsVoipPstnUserFnSnPnListForMsanDevDid(int msanDevDid)
  287:         {
  288:             List<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort> list;
  289:  
  290:             using (var db = new Ia.Ftn.Cl.Db())
  291:             {
  292:                 list = (from evpu in db.EmsVoipPstnUsers
  293:                         where evpu.EmsOnt == null && evpu.DID == msanDevDid
  294:                         select new Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort
  295:                         {
  296:                             Fn = evpu.FN,
  297:                             Sn = evpu.SN,
  298:                             Pn = evpu.PN
  299:                         }).AsNoTracking().ToList<Ia.Ftn.Cl.Models.Business.Huawei.Default.FnSnPnPort>();
  300:             }
  301:  
  302:             return list;
  303:         }
  304:  
  305:         ////////////////////////////////////////////////////////////////////////////
  306:         ////////////////////////////////////////////////////////////////////////////
  307:  
  308:         /// <summary>
  309:         ///
  310:         /// </summary>
  311:         public static string SendReadDevListByDt(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, string devType)
  312:         {
  313:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadDevListByDtCommand(devType);
  314:  
  315:             ems.SendQueue.Enqueue(command);
  316:  
  317:             return command;
  318:         }
  319:  
  320:         ////////////////////////////////////////////////////////////////////////////
  321:  
  322:         /// <summary>
  323:         ///
  324:         /// </summary>
  325:         public static string SendReadDevListByDev(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, string dev)
  326:         {
  327:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadDevListByDevCommand(dev);
  328:  
  329:             ems.SendQueue.Enqueue(command);
  330:  
  331:             return command;
  332:         }
  333:  
  334:         ////////////////////////////////////////////////////////////////////////////
  335:  
  336:         /// <summary>
  337:         ///
  338:         /// </summary>
  339:         public static string SendSaveDev(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Huawei.EmsDev emsDev)
  340:         {
  341:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.SaveDevCommand(emsDev.DEV);
  342:  
  343:             ems.SendQueue.Enqueue(command);
  344:  
  345:             return command;
  346:         }
  347:  
  348:         ////////////////////////////////////////////////////////////////////////////
  349:  
  350:         /// <summary>
  351:         ///
  352:         /// </summary>
  353:         public static string SendSaveDev(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.Huawei.Dev.MduDev mduDev)
  354:         {
  355:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.SaveDevCommand(mduDev);
  356:  
  357:             ems.SendQueue.Enqueue(command);
  358:  
  359:             return command;
  360:         }
  361:  
  362:         ////////////////////////////////////////////////////////////////////////////
  363:  
  364:         /// <summary>
  365:         ///
  366:         /// </summary>
  367:         public static string SendSaveDev(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.Huawei.Dev.MsanDev msanDev)
  368:         {
  369:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.SaveDevCommand(msanDev);
  370:  
  371:             ems.SendQueue.Enqueue(command);
  372:  
  373:             return command;
  374:         }
  375:  
  376:         ////////////////////////////////////////////////////////////////////////////
  377:  
  378:         /// <summary>
  379:         ///
  380:         /// </summary>
  381:         public static string SendSaveDev(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, string dev)
  382:         {
  383:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.SaveDevCommand(dev);
  384:  
  385:             ems.SendQueue.Enqueue(command);
  386:  
  387:             return command;
  388:         }
  389:  
  390:         ////////////////////////////////////////////////////////////////////////////
  391:         ////////////////////////////////////////////////////////////////////////////
  392:  
  393:         /// <summary>
  394:         ///
  395:         /// </summary>
  396:         public static string SendReadBoardList(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, string dev)
  397:         {
  398:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadBoardListCommand(dev);
  399:  
  400:             ems.SendQueue.Enqueue(command);
  401:  
  402:             return command;
  403:         }
  404:  
  405:         ////////////////////////////////////////////////////////////////////////////
  406:  
  407:         /// <summary>
  408:         ///
  409:         /// </summary>
  410:         public static string SendReadOntList(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, int did)
  411:         {
  412:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadOntListCommand(did);
  413:  
  414:             ems.SendQueue.Enqueue(command);
  415:  
  416:             return command;
  417:         }
  418:  
  419:         ////////////////////////////////////////////////////////////////////////////
  420:  
  421:         /// <summary>
  422:         ///
  423:         /// </summary>
  424:         public static string SendReadOnt(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont ont)
  425:         {
  426:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadOntCommand(ont);
  427:  
  428:             ems.SendQueue.Enqueue(command);
  429:  
  430:             return command;
  431:         }
  432:  
  433:         ////////////////////////////////////////////////////////////////////////////
  434:  
  435:         /// <summary>
  436:         ///
  437:         /// </summary>
  438:         public static string SendUpdateOntFromH248ToSip(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont ont)
  439:         {
  440:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.UpdateOntFromH248ToSipCommand(ont);
  441:  
  442:             ems.SendQueue.Enqueue(command);
  443:  
  444:             return command;
  445:         }
  446:  
  447:         ////////////////////////////////////////////////////////////////////////////
  448:         ////////////////////////////////////////////////////////////////////////////
  449:  
  450:         /// <summary>
  451:         ///
  452:         /// </summary>
  453:         public static string SendReadPortList(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, string dev, int fn, int sn)
  454:         {
  455:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadPortListCommand(dev, fn, sn);
  456:  
  457:             ems.SendQueue.Enqueue(command);
  458:  
  459:             return command;
  460:         }
  461:  
  462:         ////////////////////////////////////////////////////////////////////////////
  463:         ////////////////////////////////////////////////////////////////////////////
  464:  
  465:         /// <summary>
  466:         ///
  467:         /// </summary>
  468:         public static string SendCreateOntSipInfo(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string service, int telPort)
  469:         {
  470:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.CreateOrModifyOntSipInfoCommand(nddOnt, service, telPort);
  471:  
  472:             ems.SendQueue.Enqueue(command);
  473:  
  474:             return command;
  475:         }
  476:  
  477:         ////////////////////////////////////////////////////////////////////////////
  478:  
  479:         /// <summary>
  480:         ///
  481:         /// </summary>
  482:         public static string SendReadOntSipInfo(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt)
  483:         {
  484:             return Ia.Ftn.Cl.Models.Data.Huawei.Ems.SendReadOntSipInfo(ems, nddOnt, false);
  485:         }
  486:  
  487:         ////////////////////////////////////////////////////////////////////////////
  488:  
  489:         /// <summary>
  490:         ///
  491:         /// </summary>
  492:         public static string SendReadOntSipInfo(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, bool sendReadOntSipInfoCommandAgainAfterNSeconds)
  493:         {
  494:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadOntSipInfoCommand(nddOnt);
  495:  
  496:             ems.SendQueue.Enqueue(command);
  497:  
  498:             if (sendReadOntSipInfoCommandAgainAfterNSeconds)
  499:             {
  500:                 var command2 = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadOntSipInfoCommand(nddOnt);
  501:  
  502:                 ems.OntSipInfoCommandAgainAfterNSecondsToDateTimeDictionary[command2] = DateTime.UtcNow.AddHours(3);
  503:             }
  504:  
  505:             return command;
  506:         }
  507:  
  508:         ////////////////////////////////////////////////////////////////////////////
  509:  
  510:         /// <summary>
  511:         ///
  512:         /// </summary>
  513:         public static string SendVacateOntSipInfo(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string service, int telPort)
  514:         {
  515:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.VacateOntSipInfoCommand(nddOnt, service, telPort);
  516:  
  517:             ems.SendQueue.Enqueue(command);
  518:  
  519:             return command;
  520:         }
  521:  
  522:         ////////////////////////////////////////////////////////////////////////////
  523:         ////////////////////////////////////////////////////////////////////////////
  524:  
  525:         /// <summary>
  526:         ///
  527:         /// </summary>
  528:         public static string SendResetOnt(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt)
  529:         {
  530:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ResetOntCommand(nddOnt);
  531:  
  532:             ems.SendQueue.Enqueue(command);
  533:  
  534:             return command;
  535:         }
  536:  
  537:         ////////////////////////////////////////////////////////////////////////////
  538:         ////////////////////////////////////////////////////////////////////////////
  539:  
  540:         /// <summary>
  541:         ///
  542:         /// </summary>
  543:         public static string SendCreateVoipPstnUser(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.Huawei.Dev.MduDev mduDev, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string service, int sn, int port)
  544:         {
  545:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.CreateOrModifyVoipPstnUserCommand(mduDev, nddOnt, service, sn, port);
  546:  
  547:             ems.SendQueue.Enqueue(command);
  548:  
  549:             return command;
  550:         }
  551:  
  552:         ////////////////////////////////////////////////////////////////////////////
  553:  
  554:         /// <summary>
  555:         ///
  556:         /// </summary>
  557:         public static string SendCreateMsanVoipPstnUser(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.Huawei.Dev.MsanDev msanDev, int fn, int sn, int pn, string service)
  558:         {
  559:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.CreateOrModifyMsanVoipPstnUserCommand(msanDev, fn, sn, pn, service);
  560:  
  561:             ems.SendQueue.Enqueue(command);
  562:  
  563:             return command;
  564:         }
  565:  
  566:         ////////////////////////////////////////////////////////////////////////////
  567:  
  568:         /// <summary>
  569:         ///
  570:         /// </summary>
  571:         public static string SendReadVoipPstnUser(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, string dev, int sn, int pn)
  572:         {
  573:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadVoipPstnUserCommand(dev, sn, pn);
  574:  
  575:             ems.SendQueue.Enqueue(command);
  576:  
  577:             return command;
  578:         }
  579:  
  580:         ////////////////////////////////////////////////////////////////////////////
  581:  
  582:         /// <summary>
  583:         ///
  584:         /// </summary>
  585:         public static string SendReadVoipPstnUser(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, string service)
  586:         {
  587:             var list = Ia.Ftn.Cl.Models.Business.Huawei.Ems.EmsCommandsToRetriveOntNetworkElementDataByService(service);
  588:  
  589:             foreach (string s in list) ems.SendQueue.Enqueue(s);
  590:  
  591:             return string.Join(", ", list);
  592:         }
  593:  
  594:         ////////////////////////////////////////////////////////////////////////////
  595:  
  596:         /// <summary>
  597:         ///
  598:         /// </summary>
  599:         public static string SendDeleteVoipPstnUser(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.Huawei.Dev.MduDev mduDev, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string service, int sn, int telPort)
  600:         {
  601:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.DeleteVoipPstnUserCommand(mduDev, nddOnt, service, sn, telPort);
  602:  
  603:             ems.SendQueue.Enqueue(command);
  604:  
  605:             return command;
  606:         }
  607:  
  608:         ////////////////////////////////////////////////////////////////////////////
  609:  
  610:         /// <summary>
  611:         ///
  612:         /// </summary>
  613:         public static string SendDeleteVoipPstnUser(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, string dev, int fn, int sn, int pn)
  614:         {
  615:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.DeleteVoipPstnUserCommand(dev, fn, sn, pn);
  616:  
  617:             ems.SendQueue.Enqueue(command);
  618:  
  619:             return command;
  620:         }
  621:  
  622:         ////////////////////////////////////////////////////////////////////////////
  623:         ////////////////////////////////////////////////////////////////////////////
  624:  
  625:         /// <summary>
  626:         ///
  627:         /// </summary>
  628:         public static string SendCreateVoipPstnAccount(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.Huawei.Dev.MduDev mduDev, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string service, int sn, int telPort)
  629:         {
  630:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.CreateOrModifyVoipPstnAccountCommand(mduDev, nddOnt, service, sn, telPort);
  631:  
  632:             ems.SendQueue.Enqueue(command);
  633:  
  634:             return command;
  635:         }
  636:  
  637:         ////////////////////////////////////////////////////////////////////////////
  638:  
  639:         /// <summary>
  640:         ///
  641:         /// </summary>
  642:         public static string SendReadVoipPstnAccount(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt)
  643:         {
  644:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.ReadVoipPstnAccountCommand(nddOnt);
  645:  
  646:             ems.SendQueue.Enqueue(command);
  647:  
  648:             return command;
  649:         }
  650:  
  651:         ////////////////////////////////////////////////////////////////////////////
  652:  
  653:         /// <summary>
  654:         ///
  655:         /// </summary>
  656:         public static string SendVacateVoipPstnAccount(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, Ia.Ftn.Cl.Models.Business.Huawei.Dev.MduDev mduDev, Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Ont nddOnt, string service, int sn, int telPort)
  657:         {
  658:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.VacateVoipPstnAccountCommand(mduDev, nddOnt, service, sn, telPort);
  659:  
  660:             ems.SendQueue.Enqueue(command);
  661:  
  662:             return command;
  663:         }
  664:  
  665:         ////////////////////////////////////////////////////////////////////////////
  666:  
  667:         /// <summary>
  668:         ///
  669:         /// </summary>
  670:         public static string SendVacateVoipPstnAccount(Ia.Ftn.Cl.Models.Client.Huawei.Ems ems, string dev, int fn, int sn, int pn)
  671:         {
  672:             var command = Ia.Ftn.Cl.Models.Business.Huawei.Ems.VacateVoipPstnAccountCommand(dev, fn, sn, pn);
  673:  
  674:             ems.SendQueue.Enqueue(command);
  675:  
  676:             return command;
  677:         }
  678:  
  679:         ////////////////////////////////////////////////////////////////////////////
  680:         ////////////////////////////////////////////////////////////////////////////   
  681:     }
  682:  
  683:     ////////////////////////////////////////////////////////////////////////////
  684:     ////////////////////////////////////////////////////////////////////////////   
  685: }