예제 #1
0
        public static void GenerateOutgoingSIPTrunkConfiguration(string name)
        {
            OutgoingSIPTrunk          ost   = OutgoingSIPTrunk.Load(name);
            sDeployedOutgoingSipTrunk trunk = new sDeployedOutgoingSipTrunk(ost);

            Lock();
            bool add = true;
            List <sDeployedOutgoingSipTrunk> tks = trunks;

            for (int x = 0; x < tks.Count; x++)
            {
                if (tks[x].Name == trunk.Name)
                {
                    add    = false;
                    tks[x] = trunk;
                    break;
                }
            }
            if (add)
            {
                tks.Add(trunk);
            }
            trunks = tks;
            UnLock();
            _deployer.DeployOutgoingSipTrunk(trunk);
            EventController.TriggerEvent(new OutgoingSIPTrunkDeploymentEvent(trunk));
            Log.Trace("Config file for outgoing SIP trunk " + ost.Name + " has been successfully created");
        }
예제 #2
0
 public sDeployedOutgoingSipTrunk(OutgoingSIPTrunk trunk)
 {
     _name          = trunk.Name;
     _userName      = trunk.UserName;
     _password      = trunk.Password;
     _register      = trunk.Register;
     _regType       = trunk.RegistrationType;
     _context       = trunk.Profile.Context.Name;
     _pingInterval  = trunk.PingInterval;
     _retrySeconds  = trunk.RetrySeconds;
     _fromUser      = trunk.FromUser;
     _fromDomain    = trunk.FromDomain;
     _extension     = trunk.Extension;
     _proxy         = trunk.Proxy;
     _registerProxy = trunk.RegisterProxy;
     _expireSeconds = trunk.ExpireSeconds;
     _realm         = trunk.Realm;
     _profileName   = trunk.Profile.Name;
 }