Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
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 isOk;
 162:              int i, number, serviceType;
 163:              string serviceId, impi, impuAid, prividUser;
 164:              Ia.Ngn.Cl.Model.Service2 service, newService;
 165:   
 166:              isOk = false;
 167:              serviceType = 1;
 168:   
 169:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
 170:              {
 171:                  number = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Number(impu);
 172:                  impi = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Impi(impu);
 173:                  impuAid = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.ImpuAid(impu);
 174:                  serviceId = Ia.Ngn.Cl.Model.Business.Service2.ServiceId(number.ToString(), serviceType);
 175:   
 176:                  if (sbr != null)
 177:                  {
 178:                      newService = new Ia.Ngn.Cl.Model.Service2();
 179:   
 180:                      newService.Id = serviceId;
 181:                      newService.AreaCode = Ia.Ngn.Cl.Model.Business.Service.CountryCode;
 182:                      newService.Service = number.ToString();
 183:                      newService.ServiceType = serviceType;
 184:   
 185:                      //newService.LineCard = "Hu?";
 186:   
 187:                      newService.AbbriviatedCalling = sbr.NSABRC;
 188:                      newService.CallerId = sbr.NSCLIP;
 189:                      newService.CallForwarding = sbr.NSCFU;
 190:                      newService.CallWaiting = sbr.NSCW;
 191:                      newService.ConferenceCall = sbr.NS3PTY;
 192:   
 193:                      newService.AlarmCall = sbr.NSWAKE_UP;
 194:                      newService.WakeupCall = sbr.NSWAKE_UP;
 195:   
 196:                      newService.InternationalCallingUserControlled = sbr.NSCBA;
 197:                      newService.InternationalCalling = sbr.ITT;
 198:   
 199:                      //newService.ServiceSuspension = sbr.NSWAKE_UP;
 200:   
 201:                      newService.Pin = (int.TryParse(sbr.COP, out i)) ? i : 0;
 202:   
 203:                      // I will assume nddOnt is correct since it is passed as part of the provising if its not null
 204:                      if (nddOnt != null) newService.Access = (from a in db.Accesses where a.Id == nddOnt.Access.Id select a).SingleOrDefault();
 205:                      else
 206:                      {
 207:                          // find Huawei access information for number
 208:                          newService.Access = (from a in db.Accesses
 209:                                               join eo in db.EmsOnts on a.Id equals eo.Access.Id
 210:                                               join eosi in db.EmsOntSipInfos on eo.Id equals eosi.EmsOnt.Id
 211:                                               where eosi.SIPNAME == impi || eosi.SIPUSERNAME == impuAid
 212:                                               select a).FirstOrDefault(); //.SingleOrDefault();
 213:   
 214:                          // temporarily until I define the relation between number and access, if newService.Access is null I will read it as a Nokia access
 215:                          if (newService.Access == null)
 216:                          {
 217:                              prividUser = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.PrividUser(number.ToString());
 218:   
 219:                              // Find Nokia access information for number
 220:                              newService.Access = (from a in db.Accesses
 221:                                                   join o in db.Onts on a.Id equals o.Access.Id
 222:                                                   join osv in db.OntServiceVoips on o.Id equals osv.Ont.Id
 223:                                                   join gr in db.AgcfGatewayRecords on osv.Ip equals gr.IP1
 224:                                                   join ep in db.AgcfEndpoints on gr.Id equals ep.AgcfGatewayRecord.Id
 225:                                                   where ep.PrividUser == prividUser
 226:                                                   select a).FirstOrDefault(); //.SingleOrDefault();
 227:                          }
 228:                          else newService.Access = null;
 229:                      }
 230:   
 231:                      service = (from s in db.Service2s where s.Id == newService.Id select s).SingleOrDefault();
 232:   
 233:                      if (service == null)
 234:                      {
 235:                          newService.Created = newService.Updated = DateTime.UtcNow.AddHours(3);
 236:   
 237:                          db.Service2s.Add(newService);
 238:                      }
 239:                      else
 240:                      {
 241:                          if (service.Update(newService))
 242:                          {
 243:                              db.Service2s.Attach(service);
 244:                              db.Entry(service).State = System.Data.Entity.EntityState.Modified;
 245:                          }
 246:                      }
 247:                  }
 248:                  else
 249:                  {
 250:                      service = (from s in db.Service2s where s.Id == serviceId select s).SingleOrDefault();
 251:   
 252:                      if (service != null) db.Service2s.Remove(service);
 253:                  }
 254:   
 255:                  db.SaveChanges();
 256:   
 257:                  isOk = true;
 258:              }
 259:   
 260:              return isOk;
 261:          }
 262:   
 263:          ////////////////////////////////////////////////////////////////////////////
 264:   
 265:          /// <summary>
 266:          ///
 267:          /// </summary>
 268:          public static bool UpdateServiceServiceSuspensionForOwsbr(string impu, Ia.Ngn.Cl.Model.Huawei.Owsbr owsbr, out Ia.Cl.Model.Result result)
 269:          {
 270:              bool isOk, serviceSuspensionState;
 271:              int n, serviceType;
 272:              string serviceId;
 273:              Ia.Ngn.Cl.Model.Service2 service;
 274:   
 275:              isOk = false;
 276:              serviceType = 1;
 277:              result = new Ia.Cl.Model.Result();
 278:   
 279:              n = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Number(impu);
 280:              serviceId = Ia.Ngn.Cl.Model.Business.Service2.ServiceId(n.ToString(), serviceType);
 281:   
 282:              if (owsbr != null)
 283:              {
 284:                  using (var db = new Ia.Ngn.Cl.Model.Ngn())
 285:                  {
 286:                      service = (from s in db.Service2s where s.Id == serviceId select s).SingleOrDefault();
 287:   
 288:                      if (service != null)
 289:                      {
 290:                          serviceSuspensionState = Ia.Ngn.Cl.Model.Business.Huawei.Owsbr.ServiceSuspensionState(owsbr);
 291:   
 292:                          if (service.ServiceSuspension != serviceSuspensionState)
 293:                          {
 294:                              service.ServiceSuspension = serviceSuspensionState;
 295:                              //service.UserId = userId;
 296:   
 297:                              db.Service2s.Attach(service);
 298:                              db.Entry(service).Property(x => x.ServiceSuspension).IsModified = true;
 299:   
 300:                              db.SaveChanges();
 301:   
 302:                              result.AddSuccess("ServiceSuspension updated. ");
 303:                          }
 304:                          else
 305:                          {
 306:                              result.AddWarning("Warning: ServiceRequestService ServiceSuspension value was not updated because its the same. ");
 307:                          }
 308:                      }
 309:                      else
 310:                      {
 311:                          result.AddError("Error: serviceRequestService is null. ");
 312:                      }
 313:   
 314:                      db.SaveChanges();
 315:   
 316:                      isOk = true;
 317:                  }
 318:              }
 319:              else
 320:              {
 321:                  result.AddError("Error: owsbr is null. ");
 322:              }
 323:   
 324:              return isOk;
 325:          }
 326:   
 327:          ////////////////////////////////////////////////////////////////////////////
 328:   
 329:          /// <summary>
 330:          ///
 331:          /// </summary>
 332:          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)
 333:          {
 334:              bool subscriberCreated;
 335:              string resultCodeString;
 336:              Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode addHsdainfResultCode, addHsubResultCode, addHimpuResultCode, setHregauthResultCode, setHvntplidForImpuSipDomainResultCode, setHvntplidForImpuResultCode, setHirsResultCode, setHdefimpuResultCode, setHspshareResultCode, setHaliaspuResultCode, addHsifcResultCode, addSbrResultCode, addDnaptrrecResultCode;
 337:   
 338:              subscriberCreated = false;
 339:   
 340:              result = resultCodeString = string.Empty;
 341:   
 342:              // ME:name=techss;
 343:              // ADD HSDAINF:IMPI="+96522220000@ims.moc.kw",HUSERNAME="+96522220000@ims.moc.kw",PWD=admin,REALM="ims.moc.kw";
 344:              ims.AddHsdainf(service, out addHsdainfResultCode);
 345:              resultCodeString += "AddHsdainf: " + addHsdainfResultCode.ToString() + ", ";
 346:   
 347:              // ADD HSUB:SUBID="+96522220000@ims.moc.kw",IMPI="+96522220000@ims.moc.kw",IMPU="sip:+96522220000@ims.moc.kw";
 348:              ims.AddHsub(service, out addHsubResultCode);
 349:              resultCodeString += "AddHsub: " + addHsubResultCode.ToString() + ", ";
 350:   
 351:              // ADD HIMPU:IMPI="+96522220000@ims.moc.kw",IMPU="tel:+96522220000";
 352:              ims.AddHimpu(service, out addHimpuResultCode);
 353:              resultCodeString += "AddHimpu: " + addHimpuResultCode.ToString() + ", ";
 354:   
 355:              // SET HREGAUTH:IMPU="sip:+96522220000@ims.moc.kw",REGAUTH=TRUE;
 356:              ims.SetHregauth(service, out setHregauthResultCode);
 357:              resultCodeString += "SetHregauth: " + setHregauthResultCode.ToString() + ", ";
 358:   
 359:              // SET HVNTPLID: IMPU="sip:+96522220000@ims.moc.kw", VNTPLID=0;
 360:              ims.SetHvntplidForImpuSipDomain(service, out setHvntplidForImpuSipDomainResultCode);
 361:              resultCodeString += "SetHvntplidForImpuSipDomain: " + setHvntplidForImpuSipDomainResultCode.ToString() + ", ";
 362:   
 363:              // SET HVNTPLID: IMPU="tel:+96522220000", VNTPLID=0;
 364:              ims.SetHvntplidForImpu(service, out setHvntplidForImpuResultCode);
 365:              resultCodeString += "SetHvntplidForImpu: " + setHvntplidForImpuResultCode.ToString() + ", ";
 366:   
 367:              // SET HIRS:IRSID=1,IMPULIST="\"sip:+96522220000@ims.moc.kw\"&\"tel:+96522220000\""; 
 368:              ims.SetHirs(service, out setHirsResultCode);
 369:              resultCodeString += "SetHirs: " + setHirsResultCode.ToString() + ", ";
 370:   
 371:              // SET HDEFIMPU: IRSID=1, IMPU="sip:+96522220000@ims.moc.kw";
 372:              ims.SetHdefimpu(service, out setHdefimpuResultCode);
 373:              resultCodeString += "SetHdefimpu: " + setHdefimpuResultCode.ToString() + ", ";
 374:   
 375:              // SET HSPSHARE:BASEIMPU="sip:+96522220000@ims.moc.kw",IMPU="tel:+96522220000";
 376:              ims.SetHspshare(service, out setHspshareResultCode);
 377:              resultCodeString += "SetHspshare: " + setHspshareResultCode.ToString() + ", ";
 378:   
 379:              // SET HALIASPU:ALIASID=1,IMPULIST="\"sip:+96522220000@ims.moc.kw\"&\"tel:+96522220000\"";
 380:              ims.SetHaliaspu(service, out setHaliaspuResultCode);
 381:              resultCodeString += "SetHaliaspu: " + setHaliaspuResultCode.ToString() + ", ";
 382:   
 383:              // ADD HSIFC:IMPU="sip:+96522220000@ims.moc.kw",SIFCID=1;
 384:              ims.AddHsifc(service, out addHsifcResultCode);
 385:              resultCodeString += "AddHsifc: " + addHsifcResultCode.ToString() + ", ";
 386:   
 387:              // ME:name=tecats0; 
 388:              // 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;
 389:              ims.AddSbr(service, out addSbrResultCode);
 390:              resultCodeString += "AddSbr: " + addSbrResultCode.ToString() + ", ";
 391:   
 392:              // ME:name=tecens; 
 393:              // 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.";
 394:              ims.AddDnaptrrec(service, out addDnaptrrecResultCode);
 395:              resultCodeString += "AddDnaptrrec: " + addDnaptrrecResultCode.ToString();
 396:   
 397:              if (true) // check that all is OK in CreateH248Subscriber part
 398:              {
 399:                  subscriberCreated = true;
 400:              }
 401:              else
 402:              {
 403:   
 404:              }
 405:   
 406:              result = service + ", create subscriber: " + resultCodeString + ". ";
 407:   
 408:              return subscriberCreated;
 409:          }
 410:   
 411:          ////////////////////////////////////////////////////////////////////////////
 412:   
 413:          /// <summary>
 414:          ///
 415:          /// </summary>
 416:          public static void DeleteSubscriber(Ia.Ngn.Cl.Model.Client.Huawei.Ims ims, string service, out string result)
 417:          {
 418:              string resultCodeString;
 419:              Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode rmvDnaptrrecResultCode, rmvSbrResultCode, rmvHsubResultCode, rmvHsdainfResultCode;
 420:   
 421:              result = resultCodeString = string.Empty;
 422:   
 423:              // ME:name=tecens; 
 424:              // RMV DNAPTRREC: NAME="0.0.0.0.2.2.2.2.5.6.9.e164.arpa";
 425:              ims.RmvDnaptrrec(service, out rmvDnaptrrecResultCode);
 426:              resultCodeString += "RmvDnaptrrec: " + rmvDnaptrrecResultCode.ToString() + ", ";
 427:   
 428:              // ME:name=tecats0; 
 429:              // RMV SBR: IMPU="tel:+96522220000";
 430:              ims.RmvSbr(service, out rmvSbrResultCode);
 431:              resultCodeString += "RmvSbr: " + rmvSbrResultCode.ToString() + ", ";
 432:   
 433:              // ME:name=techss; 
 434:              // RMV HSUB: SUBID="+96522220000@ims.moc.kw";
 435:              ims.RmvHsub(service, out rmvHsubResultCode);
 436:              resultCodeString += "RmvHsub: " + rmvHsubResultCode.ToString() + ", ";
 437:   
 438:              // RMV HSDAINF: IMPI="+96522220000@ims.moc.kw";
 439:              ims.RmvHsdainf(service, out rmvHsdainfResultCode);
 440:              resultCodeString += "RmvHsdainf: " + rmvHsdainfResultCode.ToString();
 441:   
 442:              result = service + ", delete subscriber: " + resultCodeString + ". ";
 443:          }
 444:   
 445:          ////////////////////////////////////////////////////////////////////////////
 446:   
 447:          /// <summary>
 448:          ///
 449:          /// </summary>
 450:          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)
 451:          {
 452:              string impu;
 453:              Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode resultCode;
 454:   
 455:              result = "";
 456:   
 457:              impu = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.ImpuSipDomain(service);
 458:   
 459:              switch (supplementaryService)
 460:              {
 461:                  //newService.ServiceSuspension =;
 462:                  // newService.Pin = (int.TryParse(huSbr.COP, out i)) ? i : 0;
 463:   
 464:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.AbbriviatedCalling):
 465:                      {
 466:                          ims.ModSbrNsabrc(service, supplementaryServiceState, out resultCode);
 467:                          result = service + ",AbbriviatedCalling: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 468:                          break;
 469:                      }
 470:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.CallerId):
 471:                      {
 472:                          ims.ModSbrNsclip(service, supplementaryServiceState, out resultCode);
 473:                          result = service + ",CallerId: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 474:                          break;
 475:                      }
 476:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.CallForwarding):
 477:                      {
 478:                          ims.ModSbrNscfu(service, supplementaryServiceState, out resultCode);
 479:                          result = service + ",CallForwarding: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 480:                          break;
 481:                      }
 482:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.CallWaiting):
 483:                      {
 484:                          ims.ModSbrNscw(service, supplementaryServiceState, out resultCode);
 485:                          result = service + ",CallWaiting: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 486:                          break;
 487:                      }
 488:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.ConferenceCall):
 489:                      {
 490:                          ims.ModSbrNs3pty(service, supplementaryServiceState, out resultCode);
 491:                          result = service + ",ConferenceCall: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 492:                          break;
 493:                      }
 494:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.WakeupCall):
 495:                      {
 496:                          ims.ModSbrNswakeup(service, supplementaryServiceState, out resultCode);
 497:                          result = service + ",WakeupCall: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 498:                          break;
 499:                      }
 500:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.InternationalCallingUserControlled):
 501:                      {
 502:                          ims.ModSbrNscba(service, supplementaryServiceState, out resultCode);
 503:                          result = service + ",InternationalCallingUserControlled: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 504:                          break;
 505:                      }
 506:                  case (Ia.Ngn.Cl.Model.Business.Service.SupplementaryService.InternationalCalling):
 507:                      {
 508:                          ims.ModSbrItt(service, supplementaryServiceState, out resultCode);
 509:                          result = service + ",InternationalCalling: " + supplementaryServiceState.ToString().ToLower() + "," + resultCode.ToString();
 510:                          break;
 511:                      }
 512:                  default:
 513:                      {
 514:                          result = service + ",unknown SupplementaryService: " + supplementaryServiceState.ToString().ToLower();
 515:                          break;
 516:                      }
 517:              }
 518:          }
 519:   
 520:          ////////////////////////////////////////////////////////////////////////////
 521:   
 522:          /// <summary>
 523:          ///
 524:          /// </summary>
 525:          public static void AssignServiceSuspensionStateToServiceSubscriber(Ia.Ngn.Cl.Model.Client.Huawei.Ims client, string service, bool serviceSuspensionState, out string result)
 526:          {
 527:              Ia.Ngn.Cl.Model.Client.Huawei.Ims.ResultCode resultCode;
 528:   
 529:              client.SetOwSbr(service, serviceSuspensionState, out resultCode);
 530:   
 531:              result = service + ",service suspension: " + serviceSuspensionState.ToString().ToLower() + "," + resultCode.ToString();
 532:          }
 533:   
 534:          ////////////////////////////////////////////////////////////////////////////
 535:          ////////////////////////////////////////////////////////////////////////////
 536:      }
 537:   
 538:      ////////////////////////////////////////////////////////////////////////////
 539:      ////////////////////////////////////////////////////////////////////////////
 540:  }