Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
Skip Navigation LinksHome » Code Library » AgcfGatewayRecordTemp

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:  using System.Linq;
   4:  using System.Web;
   5:  using System.Web.Security;
   6:  using System.ComponentModel.DataAnnotations;
   7:  using System.ComponentModel.DataAnnotations.Schema;
   8:  using System.Text.RegularExpressions;
   9:  using System.Data.Entity;
  10:   
  11:  namespace Ia.Ngn.Cl.Model.Business.Nokia
  12:  {
  13:      ////////////////////////////////////////////////////////////////////////////
  14:   
  15:      /// <summary publish="true">
  16:      /// AGCF Gateway Records support class for Nokia's Next Generation Network (NGN) business model.
  17:      /// </summary>
  18:      /// 
  19:      /// <remarks> 
  20:      /// Copyright � 2014-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  21:      ///
  22:      /// 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
  23:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  24:      ///
  25:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  26:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  27:      /// 
  28:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  29:      /// 
  30:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  31:      /// </remarks> 
  32:      public partial class AgcfGatewayRecordTemp
  33:      {
  34:          public AgcfGatewayRecordTemp() { }
  35:   
  36:          ////////////////////////////////////////////////////////////////////////////
  37:   
  38:          /// <summary>
  39:          ///
  40:          /// </summary>
  41:          public static int RandomUnusedGwId()
  42:          {
  43:              int randomGwId;
  44:              Random r;
  45:              List<int> unusedGwIdList;
  46:   
  47:              r = new Random();
  48:              unusedGwIdList = Ia.Ngn.Cl.Model.Data.Nokia.AgcfGatewayRecord.ReadUnusedGwIdList();
  49:   
  50:              randomGwId = unusedGwIdList[r.Next(unusedGwIdList.Count)];
  51:   
  52:              return randomGwId;        
  53:          }
  54:   
  55:          ////////////////////////////////////////////////////////////////////////////
  56:   
  57:          /// <summary>
  58:          ///
  59:          /// </summary>
  60:          public static Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecordTemp ParseFromDictionary(Dictionary<string, string> parameterDictionary)
  61:          {
  62:              int i, gwId, tableId;
  63:              long l;
  64:              Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecordTemp agcfGatewayRecord;
  65:   
  66:              agcfGatewayRecord = new Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecordTemp();
  67:   
  68:              gwId = int.Parse(parameterDictionary["GwId"].ToString());
  69:              tableId = int.Parse(parameterDictionary["TableId"].ToString());
  70:   
  71:              agcfGatewayRecord.Id = Ia.Ngn.Cl.Model.Nokia.AgcfGatewayRecord.AgcfGatewayRecordId(tableId, gwId);
  72:   
  73:              agcfGatewayRecord.NgcfAgcfGatewayRecordAid = parameterDictionary["NgcfAgcfGatewayRecordAid"].ToString();
  74:              agcfGatewayRecord.GwId = gwId;
  75:              agcfGatewayRecord.TableId = tableId;
  76:   
  77:              agcfGatewayRecord.AgcfSipIaPort = parameterDictionary["AgcfSipIaPort"].ToString();
  78:              agcfGatewayRecord.ConnectionType = (parameterDictionary["ConnectionType"].ToString() == "UDP/IP") ? true : false;
  79:              agcfGatewayRecord.ContextAudits = (parameterDictionary["ContextAudits"].ToString() == "None") ? true : false;
  80:              agcfGatewayRecord.GwDigitMapId = int.TryParse(parameterDictionary["GwDigitMapId"].ToString(), out i) ? i : 0;
  81:              agcfGatewayRecord.EnableChannelStatusAudits = Convert.ToBoolean(parameterDictionary["EnableChannelStatusAudits"].ToString());
  82:              agcfGatewayRecord.GwUserId = parameterDictionary["GwUserId"].ToString();
  83:              agcfGatewayRecord.GwDomain = parameterDictionary["GwDomain"].ToString();
  84:              agcfGatewayRecord.GwName = parameterDictionary["GwName"].ToString();
  85:              agcfGatewayRecord.GwPrivId = parameterDictionary["GwPrivId"].ToString();
  86:              agcfGatewayRecord.IP1 = parameterDictionary["IP1"].ToString();
  87:              agcfGatewayRecord.IP2 = parameterDictionary["IP2"].ToString();
  88:              agcfGatewayRecord.LocalTermTypePrefix = parameterDictionary["LocalTermTypePrefix"].ToString();
  89:              agcfGatewayRecord.LocalTermTypeAnalogPrefix = parameterDictionary["LocalTermTypeAnalogPrefix"].ToString();
  90:              agcfGatewayRecord.IsLocalTermTypeTDMAnalog = Convert.ToBoolean(parameterDictionary["IsLocalTermTypeTDMAnalog"].ToString());
  91:              agcfGatewayRecord.NetTermTypePrefix = parameterDictionary["NetTermTypePrefix"].ToString();
  92:              agcfGatewayRecord.IsNetTermTypeRTPUDP = Convert.ToBoolean(parameterDictionary["IsNetTermTypeRTPUDP"].ToString());
  93:              agcfGatewayRecord.PhysicalTermIdScheme = parameterDictionary["PhysicalTermIdScheme"].ToString();
  94:              agcfGatewayRecord.SendCompactMessages = Convert.ToBoolean(parameterDictionary["SendCompactMessages"].ToString());
  95:              agcfGatewayRecord.SendEphemeralPrefix = Convert.ToBoolean(parameterDictionary["SendEphemeralPrefix"].ToString());
  96:              agcfGatewayRecord.UdpPort = int.TryParse(parameterDictionary["UdpPort"].ToString(), out i) ? i : 0;
  97:              agcfGatewayRecord.GwVariantId = int.TryParse(parameterDictionary["GwVariantId"].ToString(), out i) ? i : 0;
  98:              agcfGatewayRecord.AreaId = int.TryParse(parameterDictionary["AreaId"].ToString(), out i) ? i : 0;
  99:              agcfGatewayRecord.ComfortNoise = Convert.ToBoolean(parameterDictionary["ComfortNoise"].ToString());
 100:              agcfGatewayRecord.Dtmf = Convert.ToBoolean(parameterDictionary["Dtmf"].ToString());
 101:              agcfGatewayRecord.FaxEvents = Convert.ToBoolean(parameterDictionary["FaxEvents"].ToString());
 102:              agcfGatewayRecord.ModemEvents = Convert.ToBoolean(parameterDictionary["ModemEvents"].ToString());
 103:              agcfGatewayRecord.TextTelephonyEvents = Convert.ToBoolean(parameterDictionary["TextTelephonyEvents"].ToString());
 104:              agcfGatewayRecord.AllCodecDataStr = parameterDictionary["AllCodecDataStr"].ToString();
 105:              agcfGatewayRecord.AgwIuaIpAddress = parameterDictionary["AgwIuaIpAddress"].ToString();
 106:              agcfGatewayRecord.AgwIuaSctpPort = int.TryParse(parameterDictionary["AgwIuaSctpPort"].ToString(), out i) ? i : 0;
 107:              agcfGatewayRecord.AgcfLocalSctpPort = int.TryParse(parameterDictionary["AgcfLocalSctpPort"].ToString(), out i) ? i : 0;
 108:              agcfGatewayRecord.SctpProfile = int.TryParse(parameterDictionary["SctpProfile"].ToString(), out i) ? i : 0;
 109:              agcfGatewayRecord.IuaIIDMapScheme = parameterDictionary["IuaIIDMapScheme"].ToString();
 110:              agcfGatewayRecord.LocalTermTypeIsdnPrefix = parameterDictionary["LocalTermTypeIsdnPrefix"].ToString();
 111:              agcfGatewayRecord.AuditAllActiveIsdnCalls = Convert.ToBoolean(parameterDictionary["AuditAllActiveIsdnCalls"].ToString());
 112:              agcfGatewayRecord.MateSite = int.TryParse(parameterDictionary["MateSite"].ToString(), out i) ? i : 0;
 113:   
 114:              agcfGatewayRecord.IsPrimary = Convert.ToBoolean(parameterDictionary["IsPrimary"].ToString());
 115:              agcfGatewayRecord.MateExternalIPAddr = parameterDictionary["MateExternalIPAddr"].ToString();
 116:   
 117:              agcfGatewayRecord.MateExternalIPAddr = Ia.Ngn.Cl.Model.Business.Nokia.Ims.AssigneCorrectMateExternalIPAddrForIsPrimary(agcfGatewayRecord.IsPrimary, agcfGatewayRecord.MateExternalIPAddr);
 118:   
 119:   
 120:              agcfGatewayRecord.AddtionalDigitMapList = parameterDictionary["AddtionalDigitMapList"].ToString();
 121:              agcfGatewayRecord.AuthTimer = int.TryParse(parameterDictionary["AuthTimer"].ToString(), out i) ? i : 0;
 122:              agcfGatewayRecord.SharedBasNumber = long.TryParse(parameterDictionary["SharedBasNumber"].ToString(), out l) ? l : 0;
 123:              agcfGatewayRecord.SharedPriNumber = int.TryParse(parameterDictionary["SharedPriNumber"].ToString(), out i) ? i : 0;
 124:              agcfGatewayRecord.MgID = parameterDictionary["MgID"].ToString();
 125:              agcfGatewayRecord.EnnableMD5DigAuteh = Convert.ToBoolean(parameterDictionary["EnnableMD5DigAuteh"].ToString());
 126:              agcfGatewayRecord.ChannelAudits = int.TryParse(parameterDictionary["ChannelAudits"].ToString(), out i) ? i : 0;
 127:              agcfGatewayRecord.GroupId = int.TryParse(parameterDictionary["GroupId"].ToString(), out i) ? i : 0;
 128:              agcfGatewayRecord.AgcfGateWayType = int.TryParse(parameterDictionary["AgcfGateWayType"].ToString(), out i) ? i : 0;
 129:   
 130:              agcfGatewayRecord.Created = DateTime.UtcNow.AddHours(3);
 131:              agcfGatewayRecord.Updated = DateTime.UtcNow.AddHours(3);
 132:              agcfGatewayRecord.UserId = Guid.Empty;
 133:   
 134:              return agcfGatewayRecord;
 135:          }
 136:   
 137:          ////////////////////////////////////////////////////////////////////////////
 138:          ////////////////////////////////////////////////////////////////////////////
 139:      }
 140:   
 141:      ////////////////////////////////////////////////////////////////////////////
 142:      ////////////////////////////////////////////////////////////////////////////
 143:  }