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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Ims

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

Optical Fiber Network Management Intranet Portal (OFN) support class for Huawei's Next Generation Network (NGN) data model

   1:  using System;
   2:  using System.Linq;
   3:   
   4:  namespace Ia.Ngn.Cl.Model.Data.Huawei
   5:  {
   6:      ////////////////////////////////////////////////////////////////////////////
   7:   
   8:      /// <summary publish="true">
   9:      /// Optical Fiber Network Management Intranet Portal (OFN) support class for Huawei's Next Generation Network (NGN) data model
  10:      /// </summary>
  11:      /// 
  12:      /// <remarks> 
  13:      /// Copyright © 2014-2018 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  14:      ///
  15:      /// 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
  16:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  17:      ///
  18:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  19:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  20:      /// 
  21:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  22:      /// 
  23:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  24:      /// </remarks> 
  25:      public class Ims
  26:      {
  27:          ////////////////////////////////////////////////////////////////////////////
  28:   
  29:          /// <summary>
  30:          ///
  31:          /// </summary>
  32:          public Ims()
  33:          {
  34:          }
  35:   
  36:          ////////////////////////////////////////////////////////////////////////////
  37:   
  38:          /// <summary>
  39:          ///
  40:          /// </summary>
  41:          public static bool UpdateSbr(string impu, Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode resultCode, ref Ia.Ngn.Cl.Model.Huawei.HuSbr newHuSbr)
  42:          {
  43:              bool isOk;
  44:              Ia.Ngn.Cl.Model.Huawei.HuSbr huSbr;
  45:   
  46:              isOk = false;
  47:   
  48:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
  49:              {
  50:                  huSbr = (from s in db.HuSbrs where s.IMPU == impu select s).SingleOrDefault();
  51:   
  52:                  switch (resultCode)
  53:                  {
  54:                      case Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode.OperationSucceeded:
  55:                          {
  56:                              if (huSbr == null)
  57:                              {
  58:                                  newHuSbr.Created = newHuSbr.Updated = DateTime.UtcNow.AddHours(3);
  59:   
  60:                                  db.HuSbrs.Add(newHuSbr);
  61:                              }
  62:                              else
  63:                              {
  64:                                  if (huSbr.Update(newHuSbr))
  65:                                  {
  66:                                      db.HuSbrs.Attach(huSbr);
  67:                                      db.Entry(huSbr).State = System.Data.Entity.EntityState.Modified;
  68:                                  }
  69:                              }
  70:   
  71:                              break;
  72:                          }
  73:                      case Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode.TheSubscriberIsNotDefinedInTheHssOrAtsOrServiceDataIsNotConfiguredForTheSubscriber:
  74:                      case Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode.NoServiceData:
  75:                          {
  76:                              if (huSbr == null) { }
  77:                              else db.HuSbrs.Remove(huSbr);
  78:   
  79:                              break;
  80:                          }
  81:                      default:
  82:                          {
  83:                              throw new Exception("Undefined result code seen in Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode");
  84:                          }
  85:                  }
  86:   
  87:                  db.SaveChanges();
  88:   
  89:                  isOk = true;
  90:              }
  91:   
  92:              return isOk;
  93:          }
  94:   
  95:          ////////////////////////////////////////////////////////////////////////////
  96:   
  97:          /// <summary>
  98:          ///
  99:          /// </summary>
 100:          public static bool UpdateOwsbr(string impu, Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode resultCode, ref Ia.Ngn.Cl.Model.Huawei.Owsbr newOwsbr)
 101:          {
 102:              bool isOk;
 103:              Ia.Ngn.Cl.Model.Huawei.Owsbr owsbr;
 104:   
 105:              isOk = false;
 106:   
 107:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
 108:              {
 109:                  owsbr = (from o in db.Owsbrs where o.IMPU == impu select o).SingleOrDefault();
 110:   
 111:                  switch (resultCode)
 112:                  {
 113:                      case Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode.OperationSucceeded:
 114:                          {
 115:                              if (owsbr == null)
 116:                              {
 117:                                  newOwsbr.Created = newOwsbr.Updated = DateTime.UtcNow.AddHours(3);
 118:   
 119:                                  db.Owsbrs.Add(newOwsbr);
 120:                              }
 121:                              else
 122:                              {
 123:                                  if (owsbr.Update(newOwsbr))
 124:                                  {
 125:                                      db.Owsbrs.Attach(owsbr);
 126:                                      db.Entry(owsbr).State = System.Data.Entity.EntityState.Modified;
 127:                                  }
 128:                              }
 129:   
 130:                              break;
 131:                          }
 132:                      case Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode.TheSubscriberIsNotDefinedInTheHssOrAtsOrServiceDataIsNotConfiguredForTheSubscriber:
 133:                      case Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode.NoServiceData:
 134:                          {
 135:                              if (owsbr == null) { }
 136:                              else db.Owsbrs.Remove(owsbr);
 137:   
 138:                              break;
 139:                          }
 140:                      default:
 141:                          {
 142:                              throw new Exception("Undefined result code seen in Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode");
 143:                          }
 144:                  }
 145:   
 146:                  db.SaveChanges();
 147:   
 148:                  isOk = true;
 149:              }
 150:   
 151:              return isOk;
 152:          }
 153:   
 154:          ////////////////////////////////////////////////////////////////////////////
 155:   
 156:          /// <summary>
 157:          ///
 158:          /// </summary>
 159:          public static bool UpdateServiceForSbr(string impu, Ia.Ngn.Cl.Model.Huawei.HuSbr sbr, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt)
 160:          {
 161:              bool insert, update, delete;
 162:              int number, serviceType;
 163:              string serviceId, service, impi, impuAid, prividUser;
 164:              Ia.Ngn.Cl.Model.Service2 service2, newService;
 165:   
 166:              insert = update = delete = false;
 167:              //result = new Ia.Cl.Model.Result();
 168:   
 169:              number = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Number(impu);
 170:              impi = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Impi(impu);
 171:              impuAid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.ImpuAid(impu);
 172:   
 173:              service = number.ToString();
 174:   
 175:              serviceType = Ia.Ngn.Cl.Model.Business.Service.ServiceType.NgnService;
 176:              serviceId = Ia.Ngn.Cl.Model.Business.Service2.ServiceId(service, serviceType);
 177:   
 178:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
 179:              {
 180:                  if (sbr != null)
 181:                  {
 182:                      newService = new Ia.Ngn.Cl.Model.Service2();
 183:   
 184:                      newService.Id = serviceId;
 185:                      newService.AreaCode = Ia.Ngn.Cl.Model.Business.Service.CountryCode;
 186:                      newService.Service = service;
 187:                      newService.ServiceType = serviceType;
 188:   
 189:                      //newService.Port = "Hu?";
 190:   
 191:                      newService.AbbriviatedCalling = sbr.NSABRC;
 192:                      newService.CallerId = sbr.NSCLIP;
 193:                      newService.CallForwarding = sbr.NSCFU;
 194:                      newService.CallWaiting = sbr.NSCW;
 195:                      newService.ConferenceCall = sbr.NS3PTY;
 196:   
 197:                      newService.AlarmCall = sbr.NSWAKE_UP;
 198:                      newService.WakeupCall = sbr.NSWAKE_UP;
 199:   
 200:                      newService.InternationalCallingUserControlled = sbr.NSCBA;
 201:                      newService.InternationalCalling = sbr.ITT;
 202:   
 203:                      //newService.ServiceSuspension = sbr.NSWAKE_UP;
 204:   
 205:                      newService.Pin = (int.TryParse(sbr.COP, out int i)) ? i : 0;
 206:   
 207:                      // I will assume nddOnt is correct since it is passed as part of the provising if its not null
 208:                      if (nddOnt != null) newService.Access = (from a in db.Accesses where a.Id == nddOnt.Access.Id select a).SingleOrDefault();
 209:                      else
 210:                      {
 211:                          // find Huawei access information for number
 212:                          newService.Access = (from a in db.Accesses
 213:                                               join eo in db.EmsOnts on a.Id equals eo.Access.Id
 214:                                               join eosi in db.EmsOntSipInfos on eo.Id equals eosi.EmsOnt.Id
 215:                                               where eosi.SIPNAME == impi || eosi.SIPUSERNAME == impuAid
 216:                                               select a).FirstOrDefault(); //.SingleOrDefault();
 217:   
 218:                          // temporarily until I define the relation between number and access, if newService.Access is null I will read it as a Nokia access
 219:                          if (newService.Access == null)
 220:                          {
 221:                              prividUser = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PrividUser(service);
 222:   
 223:                              // Find Nokia access information for number
 224:                              newService.Access = (from a in db.Accesses
 225:                                                   join o in db.Onts on a.Id equals o.Access.Id
 226:                                                   join osv in db.OntServiceVoips on o.Id equals osv.Ont.Id
 227:                                                   join gr in db.AgcfGatewayRecords on osv.Ip equals gr.IP1
 228:                                                   join ep in db.AgcfEndpoints on gr.Id equals ep.AgcfGatewayRecord.Id
 229:                                                   where ep.PrividUser == prividUser
 230:                                                   select a).FirstOrDefault(); //.SingleOrDefault();
 231:                          }
 232:                          else newService.Access = null;
 233:                      }
 234:   
 235:                      service2 = (from s in db.Service2s
 236:                                  where s.ServiceType == Ia.Ngn.Cl.Model.Business.Service.ServiceType.NgnService && s.Id == newService.Id
 237:                                  select s).SingleOrDefault();
 238:   
 239:                      if (service2 == null)
 240:                      {
 241:                          newService.Created = newService.Updated = DateTime.UtcNow.AddHours(3);
 242:                          db.Service2s.Add(newService);
 243:   
 244:                          insert = true;
 245:                      }
 246:                      else
 247:                      {
 248:                          if (service2.Update(newService))
 249:                          {
 250:                              db.Service2s.Attach(service2);
 251:                              db.Entry(service2).State = System.Data.Entity.EntityState.Modified;
 252:   
 253:                              update = true;
 254:                          }
 255:                          else update = false;
 256:                      }
 257:                  }
 258:                  else
 259:                  {
 260:                      service2 = (from s in db.Service2s
 261:                                  where s.ServiceType == Ia.Ngn.Cl.Model.Business.Service.ServiceType.NgnService && s.Id == serviceId
 262:                                  select s).SingleOrDefault();
 263:   
 264:                      if (service2 != null)
 265:                      {
 266:                          db.Service2s.Remove(service2);
 267:   
 268:                          delete = true;
 269:                      }
 270:                  }
 271:   
 272:                  db.SaveChanges();
 273:              }
 274:   
 275:              //result.AddSuccess(service + ": state: " + Ia.Ngn.Cl.Model.Ui.Text.ExpressionOfInsertOrUpdateOrDelete(insert, update, delete));
 276:   
 277:              return insert || update || delete;
 278:          }
 279:   
 280:          ////////////////////////////////////////////////////////////////////////////
 281:   
 282:          /// <summary>
 283:          ///
 284:          /// </summary>
 285:          public static bool UpdateServiceServiceSuspensionForOwsbr(string impu, Ia.Ngn.Cl.Model.Huawei.Owsbr owsbr, out Ia.Cl.Model.Result result)
 286:          {
 287:              bool isOk, serviceSuspensionState;
 288:              int n, serviceType;
 289:              string serviceId;
 290:              Ia.Ngn.Cl.Model.Service2 service;
 291:   
 292:              isOk = false;
 293:              serviceType = Ia.Ngn.Cl.Model.Business.Service.ServiceType.NgnService;
 294:              result = new Ia.Cl.Model.Result();
 295:   
 296:              n = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Number(impu);
 297:              serviceId = Ia.Ngn.Cl.Model.Business.Service2.ServiceId(n.ToString(), serviceType);
 298:   
 299:              if (owsbr != null)
 300:              {
 301:                  using (var db = new Ia.Ngn.Cl.Model.Ngn())
 302:                  {
 303:                      service = (from s in db.Service2s
 304:                                 where s.ServiceType == Ia.Ngn.Cl.Model.Business.Service.ServiceType.NgnService && s.Id == serviceId
 305:                                 select s).SingleOrDefault();
 306:   
 307:                      if (service != null)
 308:                      {
 309:                          serviceSuspensionState = Ia.Ngn.Cl.Model.Business.Huawei.Owsbr.ServiceSuspensionState(owsbr);
 310:   
 311:                          if (service.ServiceSuspension != serviceSuspensionState)
 312:                          {
 313:                              service.ServiceSuspension = serviceSuspensionState;
 314:                              //service.UserId = userId;
 315:   
 316:                              db.Service2s.Attach(service);
 317:                              db.Entry(service).Property(x => x.ServiceSuspension).IsModified = true;
 318:   
 319:                              db.SaveChanges();
 320:   
 321:                              result.AddSuccess("ServiceSuspension updated. ");
 322:                          }
 323:                          else
 324:                          {
 325:                              result.AddWarning("Warning: ServiceRequestService ServiceSuspension value was not updated because its the same. ");
 326:                          }
 327:                      }
 328:                      else
 329:                      {
 330:                          result.AddError("Error: serviceRequestService is null. ");
 331:                      }
 332:   
 333:                      db.SaveChanges();
 334:   
 335:                      isOk = true;
 336:                  }
 337:              }
 338:              else
 339:              {
 340:                  result.AddError("Error: owsbr is null. ");
 341:              }
 342:   
 343:              return isOk;
 344:          }
 345:   
 346:          ////////////////////////////////////////////////////////////////////////////
 347:   
 348:          /// <summary>
 349:          ///
 350:          /// </summary>
 351:          public static bool CreateSubscriber(Ia.Ngn.Cl.Model.Client.Huawei.Ims ims, string service, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, out string result)
 352:          {
 353:              bool subscriberCreated;
 354:              string resultCodeString;
 355:   
 356:              subscriberCreated = false;
 357:   
 358:              result = resultCodeString = string.Empty;
 359:   
 360:              // ME:name=techss;
 361:              // ADD HSDAINF:IMPI="+96522220000@ims.moc.kw",HUSERNAME="+96522220000@ims.moc.kw",PWD=admin,REALM="ims.moc.kw";
 362:              ims.AddHsdainf(service, out Client.Huawei.Ims.ResultCode addHsdainfResultCode);
 363:              resultCodeString += "AddHsdainf: " + addHsdainfResultCode.ToString() + ", ";
 364:   
 365:              // ADD HSUB:SUBID="+96522220000@ims.moc.kw",IMPI="+96522220000@ims.moc.kw",IMPU="sip:+96522220000@ims.moc.kw";
 366:              ims.AddHsub(service, out Client.Huawei.Ims.ResultCode addHsubResultCode);
 367:              resultCodeString += "AddHsub: " + addHsubResultCode.ToString() + ", ";
 368:   
 369:              // ADD HIMPU:IMPI="+96522220000@ims.moc.kw",IMPU="tel:+96522220000";
 370:              ims.AddHimpu(service, out Client.Huawei.Ims.ResultCode addHimpuResultCode);
 371:              resultCodeString += "AddHimpu: " + addHimpuResultCode.ToString() + ", ";
 372:   
 373:              // SET HREGAUTH:IMPU="sip:+96522220000@ims.moc.kw",REGAUTH=TRUE;
 374:              ims.SetHregauth(service, out Client.Huawei.Ims.ResultCode setHregauthResultCode);
 375:              resultCodeString += "SetHregauth: " + setHregauthResultCode.ToString() + ", ";
 376:   
 377:              // SET HVNTPLID: IMPU="sip:+96522220000@ims.moc.kw", VNTPLID=0;
 378:              ims.SetHvntplidForImpuSipDomain(service, out Client.Huawei.Ims.ResultCode setHvntplidForImpuSipDomainResultCode);
 379:              resultCodeString += "SetHvntplidForImpuSipDomain: " + setHvntplidForImpuSipDomainResultCode.ToString() + ", ";
 380:   
 381:              // SET HVNTPLID: IMPU="tel:+96522220000", VNTPLID=0;
 382:              ims.SetHvntplidForImpu(service, out Client.Huawei.Ims.ResultCode setHvntplidForImpuResultCode);
 383:              resultCodeString += "SetHvntplidForImpu: " + setHvntplidForImpuResultCode.ToString() + ", ";
 384:   
 385:              // SET HIRS:IRSID=1,IMPULIST="\"sip:+96522220000@ims.moc.kw\"&\"tel:+96522220000\""; 
 386:              ims.SetHirs(service, out Client.Huawei.Ims.ResultCode setHirsResultCode);
 387:              resultCodeString += "SetHirs: " + setHirsResultCode.ToString() + ", ";
 388:   
 389:              // SET HDEFIMPU: IRSID=1, IMPU="sip:+96522220000@ims.moc.kw";
 390:              ims.SetHdefimpu(service, out Client.Huawei.Ims.ResultCode setHdefimpuResultCode);
 391:              resultCodeString += "SetHdefimpu: " + setHdefimpuResultCode.ToString() + ", ";
 392:   
 393:              // SET HSPSHARE:BASEIMPU="sip:+96522220000@ims.moc.kw",IMPU="tel:+96522220000";
 394:              ims.SetHspshare(service, out Client.Huawei.Ims.ResultCode setHspshareResultCode);
 395:              resultCodeString += "SetHspshare: " + setHspshareResultCode.ToString() + ", ";
 396:   
 397:              // SET HALIASPU:ALIASID=1,IMPULIST="\"sip:+96522220000@ims.moc.kw\"&\"tel:+96522220000\"";
 398:              ims.SetHaliaspu(service, out Client.Huawei.Ims.ResultCode setHaliaspuResultCode);
 399:              resultCodeString += "SetHaliaspu: " + setHaliaspuResultCode.ToString() + ", ";
 400:   
 401:              // ADD HSIFC:IMPU="sip:+96522220000@ims.moc.kw",SIFCID=1;
 402:              ims.AddHsifc(service, out Client.Huawei.Ims.ResultCode addHsifcResultCode);
 403:              resultCodeString += "AddHsifc: " + addHsifcResultCode.ToString() + ", ";
 404:   
 405:              // ME:name=tecats0; 
 406:              // ADD SBR:IMPU="sip:+96522xxxxxx@ims.moc.kw",TEMPLATEIDX=65535,DSPIDX=65534,LP=0,CSC=0,UTYPE=1,VCCFLAG=0,VTFLAG=0,NSCFU=0,NSCFUVM=0,NSCFB=0,NSCFBVM=0,NSCFNR=0,NSCFNRVM=0,NSCFNL=0,NSCFNLVM=0,NSCD=0,NSCDVM=0,NSCFNRC=0,NSCFNRCVM=0,NSCLIP=0,NSCIDCW=0,NSRIO=0,NSCNIP=0,NSCLIR=0,NSRIP=0,NSCNIR=0,NSRID=0,NSNRID=0,NSRND=0,NSNRND=0,NSCW=0,NSCCW=0,NSOIP=0,NSACRM=0,NSGOIR=0,NSMOIR=0,NSTIP=0,NSTIR=0,NSOTIR=0,NSCLIPNOSCREENING=0,NSCR=0,NSWAKE_UP=0,NSAOC_D=0,NSAOC_E=0,NSXEXH=0,NSXEGJ=0,NSCWCFNR=0,NSIIFC=0,NSDN_CALL_OUT_BAR=0,NSCCBS=0,NSCCNR=0,NSCCBSR=0,NSCCNRR=0,NS3PTY=0,NSNPTY=0,NSDND=0,NSMCR=0,NSCBA=0,NSTMP_LIN=0,NSCODEC_CNTRL=0,NSMWI=0,NSDC=0,NSHOLD=0,NSECT=0,NSCFTB=0,NSDAN=0,NSSTOP_SECRET=0,NSMCID=0,NSEBO=0,NSICO=0,NSOUTG=0,NSINQYH=0,NSUINFO=0,NSDN_CALL_OUT_ALLOW=0,NSSIC=0,NSSOC=0,NSSETCFNRTIME=0,NSCFS=0,NSCFSB=0,NSFAX=0,NSABRC=0,NSACRTOVM=0,NSPREPAID=0,NSCRBT=0,NSICB=0,NSMRINGING=0,NSCIS=0,NSCBEG=0,NSCOLP=0,NSCOLR=0,NSCOLPOVR=0,NSBAOC=0,NSBOIC=0,NSBOICEXHC=0,NSBAIC=0,NSBICROM=0,NSSPEED_DIAL=0,NSSD1D=0,NSSD2D=0,NSGRNCALL=0,NSCPARK=0,NSGAA=0,NSQSNS=0,NSMSN=0,NSHOTLINE=0,NSAOC_S=0,NSNIGHTSRV=0,NSBACKNUM=0,NSAUTOCON=0,NSCAMPON=0,NSCTD=0,NSCLICKHOLD=0,NSQUEUE=0,NSSANSWER=0,NSICENCF=0,NSCFGO=0,NSCECT=0,NSCTGO=0,NSCTIO=0,NSSETBUSY=0,NSOVERSTEP=0,NSABSENT=0,NSMONITOR=0,NSFMONITOR=0,NSDISCNT=0,NSFDISCNT=0,NSINSERT=0,NSFINSERT=0,NSASI=0,NSPWCB=0,NSRD=0,NSLCPS=0,NSNCPS=0,NSICPS=0,NSCBCLOCK=0,NSMINIBAR=0,NSMCN=0,NSDSTR=0,NSOPRREG=0,NSONEKEY=0,NSINBOUND=0,NSOUTBOUND=0,NSCALLERID=0,NSCUN=0,NSIPTVVC=0,NSNP=0,NSSEC=0,NSSECSTA=0,NSHRCN=0,NSSB=0,LCO=1,LC=1,LCT=1,NTT=1,ITT=0,ICTX=1,OCTX=1,INTT=0,IITT=0,ICLT=0,ICDDD=0,ICIDD=0,IOLT=0,CTLCO=1,CTLCT=1,CTLD=1,CTINTNANP=1,CTINTWORLD=1,CTDA=1,CTOSM=1,CTOSP=0,CTOSP1=0,CCO1=0,CCO2=0,CCO3=0,CCO4=0,CCO5=0,CCO6=0,CCO7=0,CCO8=0,CCO9=0,CCO10=0,CCO11=0,CCO12=0,CCO13=0,CCO14=0,CCO15=0,CCO16=0,HIGHENTCO=0,OPERATOR=1,SUPYSRV=1,IDDCI=1,NTCI=1,LTCI=1,RSC=65535,CIG=4294967295,OUTRST=0,INRST=0,NOAT=20,VMAIND=65535,VDMAIND=65535,TGRP=65534,TIDHLD=28,TIDCW=23,SCF=0,LMTGRP=65534,FLBGRP=65535,SLBGRP=65535,COP="0000",G711_64K_A_LAW=1,G711_64K_U_LAW=1,G722=1,G723=1,G726=1,G728=1,G729=1,CODEC_MP4A=1,CODEC2833=1,CODEC2198=1,G726_40=1,G726_32=1,G726_24=1,G726_16=1,AMR=1,CLEARMODE=1,ILBC=1,SPEEX=1,G729EV=1,EVRC=1,EVRCB=1,H261=1,H263=1,CODEC_MP4V=1,H264=1,T38=1,T120=1,G711A_VBD=1,G711U_VBD=1,G726_VBD=1,G726_40_VBD=1,G726_32_VBD=1,G726_24_VBD=1,G726_16_VBD=1,WIND_BAND_AMR=1,GSM610=1,H263_2000=1,BROADVOICE_32=1,UNKNOWN_CODEC=1,ACODEC=255,VCODEC=255,POLIDX=255,NCPI=255,ICPI=255,EBOCL=0,EBOPL=0,EBOIT=2,RM=0,CPC=0,PCHG=65535,TFPT=4,CHT=0,MCIDMODE=0,MCIDCMODE=255,MCIDAMODE=0,PREPAIDIDX=65535,CRBTID=65535,ODBBICTYPE=0,ODBBOCTYPE=0,ODBBARTYPE=0,ODBSS=0,ODBBRCFTYPE=0,PNOTI=0,MAXPARACALL=1,ATSDTMBUSY=1,CALLCOUNT=1,CDNOTICALLER=0,ISCHGFLAG=0,CHC=0,CUSER=0,STCF=0,CHARSC=65535,REGUIDX=0,SOCBFUNC=255,SOCBPTONEIDX=65535,ADMINCBA=0,ADCONTROL_DIVERSION=0,CPCRUS=255,CUSCAT=0,SPT100REL=1;
 407:              ims.AddSbr(service, out Client.Huawei.Ims.ResultCode addSbrResultCode);
 408:              resultCodeString += "AddSbr: " + addSbrResultCode.ToString() + ", ";
 409:   
 410:              // ME:name=tecens; 
 411:              // ADD DNAPTRREC: NAME="0.0.0.0.2.2.2.2.5.6.9.e164.arpa", ZONENAME="5.6.9.e164.arpa", ORDER=0, PREFERENCE=10, FLAGS="U", SERVICE="E2U+sip", REGEXP="!^..*$!sip:+96522220000@ims.moc.kw!", REPLACEMENT="ims.moc.kw.";
 412:              ims.AddDnaptrrec(service, out Client.Huawei.Ims.ResultCode addDnaptrrecResultCode);
 413:              resultCodeString += "AddDnaptrrec: " + addDnaptrrecResultCode.ToString();
 414:   
 415:              if (true) // check that all is OK in CreateH248Subscriber part
 416:              {
 417:                  subscriberCreated = true;
 418:              }
 419:              else
 420:              {
 421:   
 422:              }
 423:   
 424:              result = "Create subscriber: " + service + ", resultCodeString: " + resultCodeString + ". ";
 425:   
 426:              return subscriberCreated;
 427:          }
 428:   
 429:          ////////////////////////////////////////////////////////////////////////////
 430:   
 431:          /// <summary>
 432:          ///
 433:          /// </summary>
 434:          public static void DeleteSubscriber(Ia.Ngn.Cl.Model.Client.Huawei.Ims ims, string service, out string result)
 435:          {
 436:              string resultCodeString;
 437:              Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode rmvDnaptrrecResultCode, rmvSbrResultCode, rmvHsubResultCode, rmvHsdainfResultCode;
 438:   
 439:              result = resultCodeString = string.Empty;
 440:   
 441:              // ME:name=tecens; 
 442:              // RMV DNAPTRREC: NAME="0.0.0.0.2.2.2.2.5.6.9.e164.arpa";
 443:              ims.RmvDnaptrrec(service, out rmvDnaptrrecResultCode);
 444:              resultCodeString += "RmvDnaptrrec: " + rmvDnaptrrecResultCode.ToString() + ", ";
 445:   
 446:              // ME:name=tecats0; 
 447:              // RMV SBR: IMPU="tel:+96522220000";
 448:              ims.RmvSbr(service, out rmvSbrResultCode);
 449:              resultCodeString += "RmvSbr: " + rmvSbrResultCode.ToString() + ", ";
 450:   
 451:              // ME:name=techss; 
 452:              // RMV HSUB: SUBID="+96522220000@ims.moc.kw";
 453:              ims.RmvHsub(service, out rmvHsubResultCode);
 454:              resultCodeString += "RmvHsub: " + rmvHsubResultCode.ToString() + ", ";
 455:   
 456:              // RMV HSDAINF: IMPI="+96522220000@ims.moc.kw";
 457:              ims.RmvHsdainf(service, out rmvHsdainfResultCode);
 458:              resultCodeString += "RmvHsdainf: " + rmvHsdainfResultCode.ToString();
 459:   
 460:              result = service + ", delete subscriber: " + resultCodeString + ". ";
 461:          }
 462:   
 463:          ////////////////////////////////////////////////////////////////////////////
 464:   
 465:          /// <summary>
 466:          ///
 467:          /// </summary>
 468:          public static void AssignSupplementaryService(Ia.Ngn.Cl.Model.Client.Huawei.Ims ims, string service, Ia.Ngn.Cl.Model.Business.Service.SupplementaryService supplementaryService, bool supplementaryServiceState, out string result)
 469:          {
 470:              string impu;
 471:              Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode resultCode;
 472:   
 473:              result = string.Empty;
 474:   
 475:              impu = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.ImpuSipDomain(service);
 476:   
 477:              switch (supplementaryService)
 478:              {
 479:                  //newService.ServiceSuspension =;
 480:                  // newService.Pin = (int.TryParse(huSbr.COP, out i)) ? i : 0;
 481:   
 482:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.AbbriviatedCalling):
 483:                      {
 484:                          ims.ModSbrNsabrc(service, supplementaryServiceState, out resultCode);
 485:                          result = service + ",AbbriviatedCalling: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 486:                          break;
 487:                      }
 488:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.CallerId):
 489:                      {
 490:                          ims.ModSbrNsclip(service, supplementaryServiceState, out resultCode);
 491:                          result = service + ",CallerId: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 492:                          break;
 493:                      }
 494:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.CallForwarding):
 495:                      {
 496:                          ims.ModSbrNscfu(service, supplementaryServiceState, out resultCode);
 497:                          result = service + ",CallForwarding: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 498:                          break;
 499:                      }
 500:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.CallWaiting):
 501:                      {
 502:                          ims.ModSbrNscw(service, supplementaryServiceState, out resultCode);
 503:                          result = service + ",CallWaiting: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 504:                          break;
 505:                      }
 506:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.ConferenceCall):
 507:                      {
 508:                          ims.ModSbrNs3pty(service, supplementaryServiceState, out resultCode);
 509:                          result = service + ",ConferenceCall: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 510:                          break;
 511:                      }
 512:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.WakeupCall):
 513:                      {
 514:                          ims.ModSbrNswakeup(service, supplementaryServiceState, out resultCode);
 515:                          result = service + ",WakeupCall: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 516:                          break;
 517:                      }
 518:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.InternationalCallingUserControlled):
 519:                      {
 520:                          ims.ModSbrNscba(service, supplementaryServiceState, out resultCode);
 521:                          result = service + ",InternationalCallingUserControlled: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 522:                          break;
 523:                      }
 524:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.InternationalCalling):
 525:                      {
 526:                          ims.ModSbrItt(service, supplementaryServiceState, out resultCode);
 527:                          result = service + ",InternationalCalling: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 528:                          break;
 529:                      }
 530:                  default:
 531:                      {
 532:                          result = service + ",unknown SupplementaryService: " + supplementaryServiceState.ToString().ToLower();
 533:                          break;
 534:                      }
 535:              }
 536:          }
 537:   
 538:          ////////////////////////////////////////////////////////////////////////////
 539:   
 540:          /// <summary>
 541:          ///
 542:          /// </summary>
 543:          public static void AssignServiceSuspensionStateToServiceSubscriber(Ia.Ngn.Cl.Model.Client.Huawei.Ims client, string service, bool serviceSuspensionState, out string result)
 544:          {
 545:              Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode resultCode;
 546:   
 547:              client.SetOwSbr(service, serviceSuspensionState, out resultCode);
 548:   
 549:              result = service + ",service suspension: " + serviceSuspensionState.ToString().ToLower() + "," + resultCode.ToString();
 550:          }
 551:   
 552:          ////////////////////////////////////////////////////////////////////////////
 553:          ////////////////////////////////////////////////////////////////////////////
 554:      }
 555:   
 556:      ////////////////////////////////////////////////////////////////////////////
 557:      ////////////////////////////////////////////////////////////////////////////
 558:  }