コード例 #1
0
 public Call(CiscoCodec codec, int id)
 {
     this.Codec     = codec;
     this.ID        = id;
     this.StartTime = DateTime.Now;
     this.Ghost     = false;
 }
コード例 #2
0
 internal Audio(CiscoCodec codec)
 {
     Codec = codec;
     Codec.FeedbackServer.ReceivedData += new CodecFeedbackServerReceiveEventHandler(FeedbackServer_ReceivedData);
     Codec.HasConnected += new CodecConnectedEventHandler(Codec_HasConnected);
     Microphones         = new Microphones(codec);
 }
コード例 #3
0
        void Codec_HasConnected(CiscoCodec codec)
        {
            foreach (XElement element in Codec.RequestPath("Status/Audio").Elements().Where(e => !e.HasElements))
            {
                switch (element.XName.LocalName)
                {
                case "Volume": _Volume = int.Parse(element.Value); break;

                case "VolumeMute":

                    if (element.Value == "On")
                    {
                        _Mute = true;
                    }
                    else
                    {
                        _Mute = false;
                    }
                    break;
                }
            }
#if DEBUG
            CrestronConsole.PrintLine("Volume = {0}", Volume);
            CrestronConsole.PrintLine("Volume Mute = {0}", Mute);
#endif
        }
コード例 #4
0
 void FeedbackServer_IncomingCallEvent(CiscoCodec codec, CodecIncomingCallEventArgs args)
 {
     if (IncomingCall != null)
     {
         IncomingCall(this, args);
     }
 }
コード例 #5
0
        void Codec_HasConnected(CiscoCodec codec)
        {
            try
            {
                IEnumerable <XElement> status = Codec.RequestPath("Status/Cameras/SpeakerTrack");

                if (status != null)
                {
                    foreach (XElement element in status.FirstOrDefault().Elements())
                    {
                        if (element.HasElements)
                        {
                            if (element.XName.LocalName == "LeftCamera")
                            {
                                LeftCamera = new SpeakerTrackCamera(uint.Parse(element.Element("VideoInputConnector").Value));
                            }
                            else if (element.XName.LocalName == "RightCamera")
                            {
                                RightCamera = new SpeakerTrackCamera(uint.Parse(element.Element("VideoInputConnector").Value));
                            }
                        }
                        else
                        {
#if DEBUG
                            CrestronConsole.PrintLine("Status.Cameras.SpeakerTrack.{0} = {1}", element.XName.LocalName, element.Value);
#endif

                            switch (element.XName.LocalName)
                            {
                            case "Availability": Availability = (SpeakerTrackAvailability)Enum.Parse(typeof(SpeakerTrackAvailability), element.Value, true); break;

                            case "Status": if (element.Value.ToLower() == "active")
                                {
                                    this.Active = true;
                                }
                                else
                                {
                                    this.Active = false;
                                } break;
                            }
                        }
                    }

#if DEBUG
                    if (LeftCamera != null)
                    {
                        CrestronConsole.PrintLine("Status.Cameras.SpeakerTrack.LeftCamera.VideoInputConnector = {0}", LeftCamera.VideoInputConnector);
                    }
                    if (RightCamera != null)
                    {
                        CrestronConsole.PrintLine("Status.Cameras.SpeakerTrack.RightCamera.VideoInputConnector = {0}", RightCamera.VideoInputConnector);
                    }
#endif
                }
            }
            catch (Exception e)
            {
                ErrorLog.Error("Error in {0}.Codec_HasConnected, {1}", this.GetType(), e.Message);
            }
        }
コード例 #6
0
 void FeedbackServer_WidgetActionEvent(CiscoCodec codec, CodecUserInterfaceWidgetActionEventArgs args)
 {
     if (this.WidgetActionEvent != null)
     {
         this.WidgetActionEvent(codec, args);
     }
 }
コード例 #7
0
        void Codec_HasConnected(CiscoCodec codec)
        {
            try
            {
                foreach (XElement element in Codec.RequestPath("Status/Capabilities/Conference").Elements().Where(e => !e.HasElements))
                {
#if DEBUG
                    CrestronConsole.PrintLine("Capabilities.Conference.{0} = {1}", element.XName.LocalName, element.Value);
#endif
                    switch (element.XName.LocalName)
                    {
                    case "MaxActiveCalls": MaxActiveCalls = int.Parse(element.Value); break;

                    case "MaxAudioCalls": MaxAudioCalls = int.Parse(element.Value); break;

                    case "MaxCalls": MaxCalls = int.Parse(element.Value); break;

                    case "MaxVideoCalls": MaxVideoCalls = int.Parse(element.Value); break;
                    }
                }
            }
            catch (Exception e)
            {
                ErrorLog.Exception("Error in Conference.Capabilities.Codec_HasConnected", e);
            }
        }
コード例 #8
0
ファイル: Video.cs プロジェクト: uxav/UX-Simpl-Sharp
        void Codec_HasConnected(CiscoCodec codec)
        {
            try
            {
                XElement element = Codec.RequestPath("Status/Video/SelfView").Elements().FirstOrDefault();
                XElement s       = element.Elements().Where(x => x.XName.LocalName == "Selfview").FirstOrDefault();

#if DEBUG
                CrestronConsole.PrintLine("Selfview Status:\r\n{0}", s.ToString());
#endif

                foreach (XElement e in s.Elements())
                {
                    switch (e.XName.LocalName)
                    {
                    case "Mode": _SelfViewMode = (SelfViewMode)Enum.Parse(typeof(SelfViewMode), e.Value, false);
                        break;

                    case "FullscreenMode": _SelfViewFullscreenMode = (SelfViewFullscreenMode)Enum.Parse(typeof(SelfViewFullscreenMode), e.Value, false);
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                ErrorLog.Exception("Error in Video.Codec_HasConnected", e);
            }
        }
コード例 #9
0
 public PhonebookContact(CiscoCodec codec, string contactID, string name)
 {
     ItemType = PhonebookItemType.Contact;
     Codec    = codec;
     ID       = contactID;
     Name     = name;
     ParentID = string.Empty;
 }
コード例 #10
0
 public PhonebookFolder(CiscoCodec codec, string folderID, string name)
 {
     ItemType = PhonebookItemType.Folder;
     Codec    = codec;
     ID       = folderID;
     Name     = name;
     ParentID = string.Empty;
 }
コード例 #11
0
ファイル: SystemUnit.cs プロジェクト: uxav/UX-Simpl-Sharp
 internal SystemUnit(CiscoCodec codec)
 {
     Codec = codec;
     Codec.FeedbackServer.ReceivedData += new CodecFeedbackServerReceiveEventHandler(FeedbackServer_ReceivedData);
     Codec.HasConnected += new CodecConnectedEventHandler(Codec_HasConnected);
     Software            = new SystemUnitSoftware(Codec);
     Hardware            = new SystemUnitHardware(Codec);
     State = new SystemUnitState(Codec);
 }
コード例 #12
0
ファイル: Camera.cs プロジェクト: uxav/UX-Simpl-Sharp
 internal Camera(CiscoCodec codec, uint id, bool connected, string manufacturer, string model)
 {
     this.Codec     = codec;
     this.ID        = id;
     this.Connected = connected;
     //this.MacAddress = macAddress;
     this.Manufacturer = manufacturer;
     this.Model        = model;
     //this.SerialNumber = serialNumber;
     //this.SoftwareID = softwareID;
 }
コード例 #13
0
ファイル: Standby.cs プロジェクト: uxav/UX-Simpl-Sharp
 void Codec_HasConnected(CiscoCodec codec)
 {
     try
     {
         string standbyStatus = codec.RequestPath("Status/Standby").FirstOrDefault().Elements().FirstOrDefault().Value;
         _StandbyState = (StandbyState)Enum.Parse(typeof(StandbyState), standbyStatus, true);
     }
     catch (Exception e)
     {
         ErrorLog.Exception("Error in CiscoCodec.Standby.Codec_HasConnected", e);
     }
 }
コード例 #14
0
ファイル: SystemUnit.cs プロジェクト: uxav/UX-Simpl-Sharp
        void Codec_HasConnected(CiscoCodec codec)
        {
            foreach (XElement element in Codec.RequestPath("Status/SystemUnit").Elements().Where(e => !e.HasElements))
            {
#if DEBUG
                CrestronConsole.PrintLine("SystemUnit.{0} = {1}", element.XName.LocalName, element.Value);
#endif
                switch (element.XName.LocalName)
                {
                case "ProductId": ProductId = element.Value; break;

                case "ProductPlatform": ProductPlatform = element.Value; break;

                case "ProductType": ProductType = element.Value; break;

                case "Uptime": Uptime = TimeSpan.FromSeconds(double.Parse(element.Value)); break;
                }
            }
        }
コード例 #15
0
        void Codec_HasConnected(CiscoCodec codec)
        {
            foreach (XElement element in Codec.RequestPath("Status/SystemUnit/State").Elements().Where(e => !e.HasElements))
            {
#if DEBUG
                CrestronConsole.PrintLine("SystemUnit.State.{0} = {1}", element.XName.LocalName, element.Value);
#endif
                switch (element.XName.LocalName)
                {
                case "NumberOfActiveCalls": NumberOfActiveCalls = int.Parse(element.Value); break;

                case "NumberOfInProgressCalls": NumberOfInProgressCalls = int.Parse(element.Value); break;

                case "NumberOfSuspendedCalls": NumberOfSuspendedCalls = int.Parse(element.Value); break;

                case "System": System = (SystemState)Enum.Parse(typeof(SystemState), element.Value, false); break;
                }
            }
        }
コード例 #16
0
ファイル: Microphones.cs プロジェクト: uxav/UX-Simpl-Sharp
        void Codec_HasConnected(CiscoCodec codec)
        {
            XElement element = Codec.RequestPath("Status/Audio/Microphones").Elements().FirstOrDefault();

            if (element.XName.LocalName == "Mute")
            {
                if (element.Value == "On")
                {
                    _Mute = true;
                }
                else
                {
                    _Mute = false;
                }
            }
#if DEBUG
            CrestronConsole.PrintLine("Mic Mute = {0}", Mute);
#endif
        }
コード例 #17
0
        public CodecFeedbackServer(CiscoCodec codec, EthernetAdapterType ethernetAdapter, int feedbackListenerPort)
        {
            AdapterForIPAddress = ethernetAdapter;
            Codec              = codec;
            server             = new HttpServer(OnReceivedData, EthernetAdapterType.EthernetUnknownAdapter);
            server.Port        = feedbackListenerPort;
            server.ServerName  = "Cisco Codec Feedback Listener";
            server.Active      = true;
            server.KeepAlive   = true;
            server.EnableNagle = true;
#if DEBUG
            CrestronConsole.PrintLine("Created Codec Feedback HttpServer");
            CrestronConsole.PrintLine("  {0,50} = {1}", "server.EthernetAdapterToBindTo", server.EthernetAdapterToBindTo);
            CrestronConsole.PrintLine("  {0,50} = {1}", "server.ServerName", server.ServerName);
            CrestronConsole.PrintLine("  {0,50} = {1}", "server.ValidateRequests", server.ValidateRequests);
            CrestronConsole.PrintLine("  {0,50} = {1}", "server.BindV4", server.BindV4);
            CrestronConsole.PrintLine("  {0,50} = {1}", "server.BindingV4.BindingAddress", server.BindingV4.BindingAddress);
            CrestronConsole.PrintLine("  {0,50} = {1}", "server.BindingV4.EnableNagle", server.BindingV4.EnableNagle);
            CrestronConsole.PrintLine("  {0,50} = {1}", "server.BindingV4.EndPointAddress", server.BindingV4.EndPointAddress);
            CrestronConsole.PrintLine("  {0,50} = {1}", "server.BindingV4.EndPointPortNumber", server.BindingV4.EndPointPortNumber);
            CrestronConsole.PrintLine("  {0,50} = {1}", "server.BindingV4.Port", server.BindingV4.Port);
#endif
        }
コード例 #18
0
ファイル: UserInterface.cs プロジェクト: uxav/UX-Simpl-Sharp
        void Codec_HasConnected(CiscoCodec codec)
        {
            foreach (XElement element in Codec.RequestPath("Status/UserInterface").Elements())
            {
                switch (element.XName.LocalName)
                {
                case "ContactInfo":
                    foreach (XElement contactInfoElement in element.Elements())
                    {
                        switch (contactInfoElement.XName.LocalName)
                        {
                        case "Name": this.ContactInfo.Name = contactInfoElement.Value; break;

                        case "ContactMethod":
                            uint index = uint.Parse(contactInfoElement.Attribute("item").Value);
                            this.ContactInfo._ContactMethods[index] = new UserInterfaceContactInfoMethod(contactInfoElement.Element("Number").Value);
                            break;
                        }
                    }
                    break;
                }
            }
        }
コード例 #19
0
        void Codec_HasConnected(CiscoCodec codec)
        {
            foreach (XElement element in Codec.RequestPath("Status/SystemUnit/Hardware")
                     .Elements().Where(e => !e.HasElements))
            {
#if DEBUG
                CrestronConsole.PrintLine("SystemUnit.Software.{0} = {1}", element.XName.LocalName, element.Value);
#endif
                switch (element.XName.LocalName)
                {
                case "Hardware":
                    foreach (XElement e in element.Element("Module").Elements())
                    {
                        if (e.XName.LocalName == "SerialNumber")
                        {
                            ModuleSerialNumber = e.Value;
                        }
                    }
                    Codec.FusionUpdate();
                    break;
                }
            }
        }
コード例 #20
0
        void Codec_HasConnected(CiscoCodec codec)
        {
            foreach (XElement element in Codec.RequestPath("Status/SystemUnit/Software")
                     .Elements().Where(e => !e.HasElements))
            {
#if DEBUG
                CrestronConsole.PrintLine("SystemUnit.Software.{0} = {1}", element.XName.LocalName, element.Value);
#endif
                switch (element.XName.LocalName)
                {
                case "Application": Application = element.Value; break;

                case "MaxAudioCalls": MaxAudioCalls = int.Parse(element.Value); break;

                case "MaxVideoCalls": MaxVideoCalls = int.Parse(element.Value); break;

                case "Name": Name = element.Value; break;

                case "ReleaseDate": ReleaseDate = DateTime.Parse(element.Value); break;

                case "Version": Version = element.Value; break;
                }
            }
        }
コード例 #21
0
 public CallHistoryItem(CiscoCodec codec, int callHistoryID, int callID)
 {
     this.Codec  = codec;
     this.ID     = callHistoryID;
     this.CallID = callID;
 }
コード例 #22
0
 public PhonebookContact(CiscoCodec codec, string contactID, string name, string folderID)
     : this(codec, contactID, name)
 {
     ParentID = folderID;
 }
コード例 #23
0
 public SystemUnitSoftware(CiscoCodec codec)
 {
     Codec = codec;
     Codec.HasConnected += new CodecConnectedEventHandler(Codec_HasConnected);
 }
コード例 #24
0
 internal SystemUnitHardware(CiscoCodec codec)
 {
     Codec = codec;
     Codec.HasConnected += new CodecConnectedEventHandler(Codec_HasConnected);
 }
コード例 #25
0
 public Phonebook(CiscoCodec codec)
 {
     Codec = codec;
 }
コード例 #26
0
 public Site(CiscoCodec codec, int id)
 {
     Codec        = codec;
     ID           = id;
     Capabilities = new SiteCapabilities(this);
 }
コード例 #27
0
        void State_SystemStateChange(CiscoCodec Codec, SystemState State)
        {
#if DEBUG
            CrestronConsole.PrintLine("Codec State.{0}", State.ToString());
#endif
        }
コード例 #28
0
ファイル: Standby.cs プロジェクト: uxav/UX-Simpl-Sharp
 internal Standby(CiscoCodec codec)
 {
     Codec = codec;
     Codec.HasConnected += new CodecConnectedEventHandler(Codec_HasConnected);
     Codec.FeedbackServer.ReceivedData += new CodecFeedbackServerReceiveEventHandler(FeedbackServer_ReceivedData);
 }
コード例 #29
0
        public CallHistory(CiscoCodec codec, int limit)
        {
            this.Codec = codec;

            CommandArgs args = new CommandArgs();

            args.Add("Filter", "All");
            args.Add("DetailLevel", "Full");
            args.Add("Limit", limit);

            XDocument xml;

            try
            {
                xml = Codec.SendCommand("Command/CallHistory/Get", args);

                if (xml == null)
                {
                    ErrorLog.Error("Error getting Call History from codec, xml == null");
                }
            }
            catch (Exception e)
            {
                ErrorLog.Exception("Error getting Call history data", e);
                return;
            }
#if DEBUG
            CrestronConsole.PrintLine("Callhistory: \r\n{0}", xml.ToString());
#endif
            foreach (XElement item in xml.Root.Elements().Elements("Entry"))
            {
                CallHistoryItem call = new CallHistoryItem(Codec,
                                                           int.Parse(item.Element("CallHistoryId").Value),
                                                           int.Parse(item.Element("CallId").Value));

                calls.Add(call.ID, call);

                if (item.Element("CallbackNumber") != null)
                {
                    call.CallbackNumber = item.Element("CallbackNumber").Value;
                }
                if (item.Element("RemoteNumber") != null)
                {
                    call.RemoteNumber = item.Element("RemoteNumber").Value;
                }
                if (item.Element("DisplayName") != null)
                {
                    call.DisplayName = item.Element("DisplayName").Value;
                }
                if (item.Element("Direction") != null)
                {
                    call.Direction = (CallDirection)Enum.Parse(
                        typeof(CallDirection), item.Element("Direction").Value, false);
                }
                if (item.Element("CallType") != null)
                {
                    call.Type = (CallType)Enum.Parse(
                        typeof(CallType), item.Element("CallType").Value, false);
                }
                if (item.Element("OccurrenceType") != null)
                {
                    call.OccurrenceType = (CallOccurrenceType)Enum.Parse(
                        typeof(CallOccurrenceType), item.Element("OccurrenceType").Value, false);
                }
                if (item.Element("Protocol") != null)
                {
                    call.Protocol = item.Element("Protocol").Value;
                }
                if (item.Element("StartTime") != null)
                {
                    call.StartTime = DateTime.Parse(item.Element("StartTime").Value);
                }
                if (item.Element("EndTime") != null)
                {
                    call.EndTime = DateTime.Parse(item.Element("EndTime").Value);
                }
                if (item.Element("DisconnectCause") != null)
                {
                    call.DisconnectCause = item.Element("DisconnectCause").Value;
                }
                if (item.Element("DisconnectCauseType") != null)
                {
                    call.DisconnectCauseType = (CallDisconnectCauseType)Enum.Parse(
                        typeof(CallDisconnectCauseType), item.Element("DisconnectCauseType").Value, false);
                }
            }
        }
コード例 #30
0
ファイル: Capabilities.cs プロジェクト: uxav/UX-Simpl-Sharp
 internal Capabilities(CiscoCodec codec)
 {
     Codec      = codec;
     Conference = new CapabilitiesConference(codec);
 }