Пример #1
0
        public static VoiceChanStateItem CreateItem(ChanState info)
        {
            VoiceChanStateItem item = new VoiceChanStateItem();

            item.ChanObjID       = info.ObjID;
            item.ChanID          = info.ChanID;
            item.VoiceID         = info.ServerID;
            item.Extension       = info.Extension;
            item.AgentID         = info.AgentID;
            item.LoginState      = info.LoginState;
            item.CallState       = info.CallState;
            item.RecordState     = info.RecordState;
            item.RecordReference = info.RecordReference;
            item.DirectionFlag   = info.DirectionFlag;
            item.CallerID        = info.CallerID;
            item.CalledID        = info.CalledID;
            item.StartRecordTime = info.StartRecordTime;
            item.StopRecordTime  = info.StopRecordTime;
            item.RecordLength    = info.RecordLength;

            item.StrLoginState      = item.LoginState.ToString();
            item.StrCallState       = item.CallState.ToString();
            item.StrRecordState     = item.RecordState.ToString();
            item.StrDirection       = item.DirectionFlag.ToString();
            item.StrStartRecordTime = item.StartRecordTime.ToString("yyyy-MM-dd HH:mm:ss");
            item.StrStopRecordTime  = item.StopRecordTime.ToString("yyyy-MM-dd HH:mm:ss");
            item.StrRecordLength    = item.RecordLength.ToString();

            item.Info = info;

            return(item);
        }
Пример #2
0
 private void InitChannelInfos()
 {
     mListVoiceChanStateItems.Clear();
     for (int i = 0; i < 10; i++)
     {
         MonitorObject obj = new MonitorObject();
         obj.MonType = MonitorType.State;
         obj.ObjID   = i + 2250000000000000001;
         obj.ObjType = ConstValue.RESOURCE_VOICECHANNEL;
         VoiceChanStateItem item = new VoiceChanStateItem();
         item.ChanObjID     = obj.ObjID;
         item.MonitorObject = obj;
         mListVoiceChanStateItems.Add(item);
     }
 }