internal static void SetCurrentContext(Context context)
 {
     if (HttpRequest.CurrentRequest != null)
     {
         if (HttpRequest.CurrentRequest.Session != null)
         {
             HttpRequest.CurrentRequest.Session[SESSION_ID] = context;
         }
     }
 }
 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;
 }
Beispiel #3
0
 internal static CDR Create(string domainName,string callerIDName,string callerIDNumber,string DestinationNumber,
     DateTime callStart,DateTime? answerTime,DateTime endTime,long duration,long billableSecs,
     Context context,string uniqueID,string coreUUID,string hangupCause,Extension internalExtension,string pin)
 {
     CDR ret = new CDR();
     ret.OwningDomain = Domain.Load(domainName);
     ret.CallerIDName = callerIDName;
     ret.CallerIDNumber = callerIDNumber;
     ret.DestinationNumber = DestinationNumber;
     ret.CallStart = callStart;
     ret.CallAnswerTime = answerTime;
     ret.CallEndTime = endTime;
     ret.Duration = duration;
     ret.BillableDuration = billableSecs;
     ret.CallContext = context;
     ret.UniqueID = uniqueID;
     ret.CoreUUID = coreUUID;
     ret.InternalExtension = internalExtension;
     ret.HangupCause = hangupCause;
     ret.Pin = pin;
     Connection conn = ConnectionPoolManager.GetConnection(typeof(CDR));
     ret = (CDR)conn.Save(ret);
     conn.Commit();
     conn.CloseConnection();
     return ret;
 }
 public sDeployedContext(Context cont)
 {
     _name = cont.Name;
 }