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

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

Fixed Telecommunications Network's Operations Support System Management Intranet (FTN OSS) support class for Huawei's Fixed Telecommunications Network (FTN) business model

    1: using System.Collections.Generic;
    2: using System.Configuration;
    3: using System.Linq;
    4:  
    5: namespace Ia.Ftn.Cl.Models.Business.Huawei
    6: {
    7:     ////////////////////////////////////////////////////////////////////////////
    8:  
    9:     /// <summary publish="true">
   10:     /// Fixed Telecommunications Network's Operations Support System Management Intranet (FTN OSS) support class for Huawei's Fixed Telecommunications Network (FTN) business model
   11:     /// </summary>
   12:     /// 
   13:     /// <value>
   14:     ///   <appSettings>
   15:     ///     <add key="imsHuaweiServerHost" value="https://*" />
   16:     ///     <add key="imsHuaweiServerPort" value="*" />
   17:     ///     <add key="imsHuaweiServerServiceUrl" value="*" />
   18:     ///     <add key="imsHuaweiServerUser" value="*" />
   19:     ///     <add key="imsHuaweiServerUserPassword" value="*" />
   20:     ///   </appSettings>
   21:     /// </value>
   22:     /// 
   23:     /// <remarks> 
   24:     /// Copyright © 2014-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   25:     /// </remarks> 
   26:     public class Ims
   27:     {
   28:         //private static int serviceRequestServiceServiceOfUnmatchedServicesListIndex;
   29:         private const string sipSubscriberRegistrationPassword = "admin"; // as per Huawei spec
   30:  
   31:         private static List<int> allPossibleServiceWithinHuaweiSwitchList = new List<int>();
   32:  
   33:         /// <summary/>
   34:         public static string BaseAddress { get { return Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:ImsHuaweiServerHost") + ":" + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:ImsHuaweiServerPort"); } }
   35:  
   36:         /// <summary/>
   37:         public static string ServiceUrl { get { return Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:ImsHuaweiServerServiceUrl"); } }
   38:  
   39:         /// <summary/>
   40:         public static string UserName { get { return Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:ImsHuaweiServerUser"); } }
   41:  
   42:         /// <summary/>
   43:         public static string Password { get { return Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:ImsHuaweiServerUserPassword"); } }
   44:  
   45:         /// <summary/>
   46:         public class ImsBasicService
   47:         {
   48:             public string MgcIp;
   49:             public string MgcSecondaryIp;
   50:             public string MgcSubnetMask;
   51:             public int Service;
   52:             public string Fsdb;
   53:             public string PrimarySwitch;
   54:         }
   55:  
   56:         /// <summary/>
   57:         public static ImsBasicService[] ImsBasicServiceList =
   58:             {
   59:             new ImsBasicService { MgcIp="10.10.9.10", MgcSecondaryIp="10.10.13.10", MgcSubnetMask="255.255.248.0", Service=0, Fsdb=string.Empty, PrimarySwitch=string.Empty },
   60:             new ImsBasicService { MgcIp="10.10.13.10", MgcSecondaryIp="10.10.9.10", MgcSubnetMask="255.255.248.0", Service=0, Fsdb=string.Empty, PrimarySwitch=string.Empty },
   61:             new ImsBasicService { MgcIp="10.10.9.253", MgcSecondaryIp="10.10.13.253", MgcSubnetMask="255.255.248.0", Service=0, Fsdb=string.Empty, PrimarySwitch=string.Empty },
   62:             new ImsBasicService { MgcIp="10.10.9.254", MgcSecondaryIp="10.10.13.254", MgcSubnetMask="255.255.248.0", Service=0, Fsdb=string.Empty, PrimarySwitch=string.Empty },
   63:             new ImsBasicService { MgcIp="10.133.0.1", MgcSecondaryIp="10.133.13.1", MgcSubnetMask="255.255.248.0", Service=0, Fsdb=string.Empty, PrimarySwitch=string.Empty },
   64:             new ImsBasicService { MgcIp="10.16.5.142", MgcSecondaryIp="10.16.0.142", MgcSubnetMask="255.255.248.0", Service=0, Fsdb=string.Empty, PrimarySwitch=string.Empty },
   65:         };
   66:  
   67:         /// <summary/>
   68:         public static string SipSubscriberRegistrationPassword { get { return sipSubscriberRegistrationPassword; } }
   69:  
   70:         ////////////////////////////////////////////////////////////////////////////
   71:  
   72:         /// <summary>
   73:         ///
   74:         /// </summary>
   75:         public Ims()
   76:         {
   77:         }
   78:  
   79:         ////////////////////////////////////////////////////////////////////////////
   80:  
   81:         /// <summary>
   82:         /// Return the IMS basic service for given MGC IP
   83:         /// </summary>
   84:         public static ImsBasicService ImsBasicServiceItem(string mgcIp)
   85:         {
   86:             ImsBasicService imsBasicService;
   87:  
   88:             imsBasicService = (from ibs in ImsBasicServiceList where ibs.MgcIp == mgcIp select ibs).Single();
   89:  
   90:             return imsBasicService;
   91:         }
   92:  
   93:         ////////////////////////////////////////////////////////////////////////////
   94:  
   95:         /// <summary>
   96:         ///
   97:         /// </summary>
   98:         public static string ServiceToReadServiceData(ref int referenceIndex, out int itemIndex, out int listCount)
   99:         {
  100:             if (allPossibleServiceWithinHuaweiSwitchList.JustStartedOrRolledOver())
  101:             {
  102:                 allPossibleServiceWithinHuaweiSwitchList = Ia.Ftn.Cl.Models.Data.Service.AllPossibleServiceNumberListWithinHuaweiSwitch;
  103:             }
  104:  
  105:             var service = allPossibleServiceWithinHuaweiSwitchList.Next(ref referenceIndex, out itemIndex, out listCount);
  106:  
  107:             return service.ToString();
  108:         }
  109:  
  110:         ////////////////////////////////////////////////////////////////////////////
  111:  
  112:         /// <summary>
  113:         ///
  114:         /// </summary>
  115:         public static void ReadSbrForService(Ia.Ftn.Cl.Models.Client.Huawei.Ims client, string service, out string result)
  116:         {
  117:             ReadUpdateSbrAndServiceForService(client, service, null, out result);
  118:         }
  119:  
  120:         ////////////////////////////////////////////////////////////////////////////
  121:  
  122:         /// <summary>
  123:         ///
  124:         /// </summary>
  125:         public static void ReadUpdateSbrAndServiceForService(Ia.Ftn.Cl.Models.Client.Huawei.Ims client, string service, string accessId, out string result)
  126:         {
  127:             bool sbrUpdated, owSbrUpdated, serviceSbrUpdated, serviceOwSbrUpdated;
  128:             string impuSipDomain;
  129:             Ia.Ftn.Cl.Models.Huawei.Owsbr owsbr;
  130:             Ia.Ftn.Cl.Models.Huawei.Sbr sbr;
  131:  
  132:             result = "service: " + service + " ";
  133:  
  134:             sbr = client.LstSbr(service, out Client.Huawei.Ims.ResultCode lstSbrResultCode);
  135:  
  136:             if (lstSbrResultCode == Ia.Ftn.Cl.Models.Client.Huawei.Ims.ResultCode.OperationSucceeded
  137:                 || lstSbrResultCode == Ia.Ftn.Cl.Models.Client.Huawei.Ims.ResultCode.TheSubscriberIsNotDefinedInTheHssOrAtsOrServiceDataIsNotConfiguredForTheSubscriber
  138:                 || lstSbrResultCode == Ia.Ftn.Cl.Models.Client.Huawei.Ims.ResultCode.NoServiceData)
  139:             {
  140:                 impuSipDomain = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.ImpuSipDomain(service);
  141:  
  142:                 sbrUpdated = Ia.Ftn.Cl.Models.Data.Huawei.Ims.UpdateSbr(impuSipDomain, sbr, lstSbrResultCode);
  143:  
  144:                 serviceSbrUpdated = Ia.Ftn.Cl.Models.Data.Huawei.Ims.UpdateServiceForSbr(impuSipDomain, accessId);
  145:  
  146:                 owsbr = client.LstOwSbr(service, out Client.Huawei.Ims.ResultCode lstOwSbrResultCode);
  147:  
  148:                 if (lstOwSbrResultCode == Ia.Ftn.Cl.Models.Client.Huawei.Ims.ResultCode.OperationSucceeded
  149:                     || lstOwSbrResultCode == Ia.Ftn.Cl.Models.Client.Huawei.Ims.ResultCode.TheSubscriberIsNotDefinedInTheHssOrAtsOrServiceDataIsNotConfiguredForTheSubscriber
  150:                     || lstOwSbrResultCode == Ia.Ftn.Cl.Models.Client.Huawei.Ims.ResultCode.NoServiceData)
  151:                 {
  152:                     owSbrUpdated = Ia.Ftn.Cl.Models.Data.Huawei.Ims.UpdateOwsbr(impuSipDomain, owsbr, lstSbrResultCode);
  153:                     serviceOwSbrUpdated = Ia.Ftn.Cl.Models.Data.Huawei.Ims.UpdateServiceServiceSuspensionForOwsbr(impuSipDomain, out Ia.Cl.Models.Result result2);
  154:  
  155:                     result += "sbr: " + lstSbrResultCode.ToString() + ", owsbr: " + lstOwSbrResultCode.ToString();
  156:                 }
  157:                 else
  158:                 {
  159:                     result += " error: owsbr: " + lstOwSbrResultCode.ToString();
  160:                 }
  161:             }
  162:             else
  163:             {
  164:                 result += " error: sbr: " + lstSbrResultCode.ToString();
  165:             }
  166:         }
  167:  
  168:         ////////////////////////////////////////////////////////////////////////////
  169:         ////////////////////////////////////////////////////////////////////////////
  170:     }
  171:  
  172:     ////////////////////////////////////////////////////////////////////////////
  173:     ////////////////////////////////////////////////////////////////////////////
  174: }