Exemple #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");
        }
Exemple #2
0
        public void DeployOutgoingSipTrunk(sDeployedOutgoingSipTrunk trunk)
        {
            DirectoryInfo di = new DirectoryInfo(Settings.Current[Constants.BASE_PATH_NAME].ToString() + Path.DirectorySeparatorChar + Constants.DEFAULT_CONF_DIR +
                                                 Path.DirectorySeparatorChar + Constants.DEFAULT_SIP_PROFILES_PATH + Path.DirectorySeparatorChar + trunk.ProfileName);
            string str = Utility.ReadEmbeddedResource("Org.Reddragonit.FreeSwitchConfig.DataCore.Generators.resources.SIPTrunk.External.st");

            Log.Trace("Generating config file for outgoing sip trunk " + trunk.Name);
            Template st = new Template(str);

            st.SetAttribute("trunk", trunk);
            FileStream fs = new FileStream(di.FullName + Path.DirectorySeparatorChar + trunk.Name + ".xml", FileMode.Create, FileAccess.Write, FileShare.None);

            st.WriteToStream(fs);
            fs.Close();
        }
Exemple #3
0
 internal OutgoingSIPTrunkDeploymentEvent(sDeployedOutgoingSipTrunk trunk)
 {
     _pars.Add("Trunk", trunk);
 }
Exemple #4
0
 public void DeployOutgoingSipTrunk(sDeployedOutgoingSipTrunk trunk)
 {
 }