public sDeployedVoicemail(VoiceMail vm,string number,string domain)
 {
     _password = vm.Password;
     _maxMessages = vm.MaxMessage;
     _copyTo = null;
     if (vm.CopyTo != null)
         _copyTo = vm.CopyTo.Number + "@" + vm.CopyTo.Domain.Name;
     _email = vm.Email;
     _attachToEmail = vm.AttachToEmail;
     _number = number;
     _domain = domain;
 }
Ejemplo n.º 2
0
        internal static VoiceMail Load(string number, Context context)
        {
            VoiceMail  ret  = null;
            Connection conn = ConnectionPoolManager.GetConnection(typeof(VoiceMail));
            List <Org.Reddragonit.Dbpro.Structure.Table> tmp = conn.Select(typeof(VoiceMail),
                                                                           new SelectParameter[] { new EqualParameter("Number", number),
                                                                                                   new EqualParameter("Context", context) });

            if (tmp.Count > 0)
            {
                ret = (VoiceMail)tmp[0];
            }
            conn.CloseConnection();
            if ((ret != null) && (!ret.ResetVMPassword))
            {
                List <Dictionary <string, string> > tpass = Utility.SelectFromFreeswitchDB(VM_DB, string.Format(VM_DB_PASS_SELECT, number));
                if (tpass.Count > 0)
                {
                    ret.Password = tpass[0]["password"];
                    ret.Update();
                }
            }
            return(ret);
        }