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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » AgcfGatewayRecord

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

AGCF Gateway Records support class for Nokia's Next Generation Network (NGN) business model.

   1:  using System;
   2:  using System.Collections.Generic;
   3:   
   4:  namespace Ia.Ngn.Cl.Model.Business.Nokia
   5:  {
   6:      ////////////////////////////////////////////////////////////////////////////
   7:   
   8:      /// <summary publish="true">
   9:      /// AGCF Gateway Records support class for Nokia's Next Generation Network (NGN) business model.
  10:      /// </summary>
  11:      /// 
  12:      /// <remarks> 
  13:      /// Copyright � 2014-2017 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 partial class AgcfGatewayRecord
  26:      {
  27:          public AgcfGatewayRecord() { }
  28:   
  29:          ////////////////////////////////////////////////////////////////////////////
  30:   
  31:          /// <summary>
  32:          ///
  33:          /// </summary>
  34:          public static int RandomUnusedGwId()
  35:          {
  36:              int randomGwId;
  37:              Random r;
  38:              List<int> unusedGwIdList;
  39:   
  40:              r = new Random();
  41:              unusedGwIdList = Ia.Ngn.Cl.Model.Data.Nokia.AgcfGatewayRecord.ReadUnusedGwIdList();
  42:   
  43:              randomGwId = unusedGwIdList[r.Next(unusedGwIdList.Count)];
  44:   
  45:              return randomGwId;
  46:          }
  47:   
  48:          ////////////////////////////////////////////////////////////////////////////
  49:   
  50:          /// <summary>
  51:          ///
  52:          /// </summary>
  53:          public static Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecord ParseFromDictionary(Dictionary<string, string> parameterDictionary)
  54:          {
  55:              int i, gwId, tableId;
  56:              long l;
  57:              Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecord agcfGatewayRecord;
  58:   
  59:              agcfGatewayRecord = new Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecord();
  60:   
  61:              gwId = int.Parse(parameterDictionary["GwId"].ToString());
  62:              tableId = int.Parse(parameterDictionary["TableId"].ToString());
  63:   
  64:              agcfGatewayRecord.Id = Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecord.AgcfGatewayRecordId(tableId, gwId);
  65:   
  66:              agcfGatewayRecord.NgcfAgcfGatewayRecordAid = parameterDictionary["NgcfAgcfGatewayRecordAid"].ToString();
  67:              agcfGatewayRecord.GwId = gwId;
  68:              agcfGatewayRecord.TableId = tableId;
  69:   
  70:              agcfGatewayRecord.AgcfSipIaPort = parameterDictionary["AgcfSipIaPort"].ToString();
  71:              agcfGatewayRecord.ConnectionType = (parameterDictionary["ConnectionType"].ToString() == "UDP/IP") ? true : false;
  72:              agcfGatewayRecord.ContextAudits = (parameterDictionary["ContextAudits"].ToString() == "None") ? true : false;
  73:              agcfGatewayRecord.GwDigitMapId = int.TryParse(parameterDictionary["GwDigitMapId"].ToString(), out i) ? i : 0;
  74:              agcfGatewayRecord.EnableChannelStatusAudits = Convert.ToBoolean(parameterDictionary["EnableChannelStatusAudits"].ToString());
  75:              agcfGatewayRecord.GwUserId = parameterDictionary["GwUserId"].ToString();
  76:              agcfGatewayRecord.GwDomain = parameterDictionary["GwDomain"].ToString();
  77:              agcfGatewayRecord.GwName = parameterDictionary["GwName"].ToString();
  78:              agcfGatewayRecord.GwPrivId = parameterDictionary["GwPrivId"].ToString();
  79:              agcfGatewayRecord.IP1 = parameterDictionary["IP1"].ToString();
  80:              agcfGatewayRecord.IP2 = parameterDictionary["IP2"].ToString();
  81:              agcfGatewayRecord.LocalTermTypePrefix = parameterDictionary["LocalTermTypePrefix"].ToString();
  82:              agcfGatewayRecord.LocalTermTypeAnalogPrefix = parameterDictionary["LocalTermTypeAnalogPrefix"].ToString();
  83:              agcfGatewayRecord.IsLocalTermTypeTDMAnalog = Convert.ToBoolean(parameterDictionary["IsLocalTermTypeTDMAnalog"].ToString());
  84:              agcfGatewayRecord.NetTermTypePrefix = parameterDictionary["NetTermTypePrefix"].ToString();
  85:              agcfGatewayRecord.IsNetTermTypeRTPUDP = Convert.ToBoolean(parameterDictionary["IsNetTermTypeRTPUDP"].ToString());
  86:              agcfGatewayRecord.PhysicalTermIdScheme = parameterDictionary["PhysicalTermIdScheme"].ToString();
  87:              agcfGatewayRecord.SendCompactMessages = Convert.ToBoolean(parameterDictionary["SendCompactMessages"].ToString());
  88:              agcfGatewayRecord.SendEphemeralPrefix = Convert.ToBoolean(parameterDictionary["SendEphemeralPrefix"].ToString());
  89:              agcfGatewayRecord.UdpPort = int.TryParse(parameterDictionary["UdpPort"].ToString(), out i) ? i : 0;
  90:              agcfGatewayRecord.GwVariantId = int.TryParse(parameterDictionary["GwVariantId"].ToString(), out i) ? i : 0;
  91:              agcfGatewayRecord.AreaId = int.TryParse(parameterDictionary["AreaId"].ToString(), out i) ? i : 0;
  92:              agcfGatewayRecord.ComfortNoise = Convert.ToBoolean(parameterDictionary["ComfortNoise"].ToString());
  93:              agcfGatewayRecord.Dtmf = Convert.ToBoolean(parameterDictionary["Dtmf"].ToString());
  94:              agcfGatewayRecord.FaxEvents = Convert.ToBoolean(parameterDictionary["FaxEvents"].ToString());
  95:              agcfGatewayRecord.ModemEvents = Convert.ToBoolean(parameterDictionary["ModemEvents"].ToString());
  96:              agcfGatewayRecord.TextTelephonyEvents = Convert.ToBoolean(parameterDictionary["TextTelephonyEvents"].ToString());
  97:              agcfGatewayRecord.AllCodecDataStr = parameterDictionary["AllCodecDataStr"].ToString();
  98:              agcfGatewayRecord.AgwIuaIpAddress = parameterDictionary["AgwIuaIpAddress"].ToString();
  99:              agcfGatewayRecord.AgwIuaSctpPort = int.TryParse(parameterDictionary["AgwIuaSctpPort"].ToString(), out i) ? i : 0;
 100:              agcfGatewayRecord.AgcfLocalSctpPort = int.TryParse(parameterDictionary["AgcfLocalSctpPort"].ToString(), out i) ? i : 0;
 101:              agcfGatewayRecord.SctpProfile = int.TryParse(parameterDictionary["SctpProfile"].ToString(), out i) ? i : 0;
 102:              agcfGatewayRecord.IuaIIDMapScheme = parameterDictionary["IuaIIDMapScheme"].ToString();
 103:              agcfGatewayRecord.LocalTermTypeIsdnPrefix = parameterDictionary["LocalTermTypeIsdnPrefix"].ToString();
 104:              agcfGatewayRecord.AuditAllActiveIsdnCalls = Convert.ToBoolean(parameterDictionary["AuditAllActiveIsdnCalls"].ToString());
 105:              agcfGatewayRecord.MateSite = int.TryParse(parameterDictionary["MateSite"].ToString(), out i) ? i : 0;
 106:   
 107:              agcfGatewayRecord.IsPrimary = Convert.ToBoolean(parameterDictionary["IsPrimary"].ToString());
 108:              agcfGatewayRecord.MateExternalIPAddr = parameterDictionary["MateExternalIPAddr"].ToString();
 109:   
 110:              agcfGatewayRecord.MateExternalIPAddr = Ia.Ngn.Cl.Model.Business.Nokia.Ims.AssigneCorrectMateExternalIPAddrForIsPrimary(agcfGatewayRecord.IsPrimary, agcfGatewayRecord.MateExternalIPAddr);
 111:   
 112:   
 113:              agcfGatewayRecord.AddtionalDigitMapList = parameterDictionary["AddtionalDigitMapList"].ToString();
 114:              agcfGatewayRecord.AuthTimer = int.TryParse(parameterDictionary["AuthTimer"].ToString(), out i) ? i : 0;
 115:              agcfGatewayRecord.SharedBasNumber = long.TryParse(parameterDictionary["SharedBasNumber"].ToString(), out l) ? l : 0;
 116:              agcfGatewayRecord.SharedPriNumber = int.TryParse(parameterDictionary["SharedPriNumber"].ToString(), out i) ? i : 0;
 117:              agcfGatewayRecord.MgID = parameterDictionary["MgID"].ToString();
 118:              agcfGatewayRecord.EnnableMD5DigAuteh = Convert.ToBoolean(parameterDictionary["EnnableMD5DigAuteh"].ToString());
 119:              agcfGatewayRecord.ChannelAudits = int.TryParse(parameterDictionary["ChannelAudits"].ToString(), out i) ? i : 0;
 120:              agcfGatewayRecord.GroupId = int.TryParse(parameterDictionary["GroupId"].ToString(), out i) ? i : 0;
 121:              agcfGatewayRecord.AgcfGateWayType = int.TryParse(parameterDictionary["AgcfGateWayType"].ToString(), out i) ? i : 0;
 122:   
 123:              agcfGatewayRecord.Created = DateTime.UtcNow.AddHours(3);
 124:              agcfGatewayRecord.Updated = DateTime.UtcNow.AddHours(3);
 125:              agcfGatewayRecord.UserId = Guid.Empty;
 126:   
 127:              return agcfGatewayRecord;
 128:          }
 129:   
 130:          ////////////////////////////////////////////////////////////////////////////
 131:          ////////////////////////////////////////////////////////////////////////////
 132:      }
 133:   
 134:      ////////////////////////////////////////////////////////////////////////////
 135:      ////////////////////////////////////////////////////////////////////////////
 136:  }