예제 #1
0
        public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
        {
            appServerController.RemoveAction(MessagePath + "/fullStatus");
            appServerController.RemoveAction(MessagePath + "/source");

            EISC.SetStringSigAction(JoinStart + StringJoin.CurrentSource, null);
        }
 protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
 {
     appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendAtcFullMessageObject));
     appServerController.AddAction(MessagePath + "/dial", new Action <string>(s => Codec.Dial(s)));
     appServerController.AddAction(MessagePath + "/endCallById", new Action <string>(s =>
     {
         var call = GetCallWithId(s);
         if (call != null)
         {
             Codec.EndCall(call);
         }
     }));
     appServerController.AddAction(MessagePath + "/endAllCalls", new Action(Codec.EndAllCalls));
     appServerController.AddAction(MessagePath + "/dtmf", new Action <string>(s => Codec.SendDtmf(s)));
     appServerController.AddAction(MessagePath + "/rejectById", new Action <string>(s =>
     {
         var call = GetCallWithId(s);
         if (call != null)
         {
             Codec.RejectCall(call);
         }
     }));
     appServerController.AddAction(MessagePath + "/acceptById", new Action <string>(s =>
     {
         var call = GetCallWithId(s);
         if (call != null)
         {
             Codec.AcceptCall(call);
         }
     }));
 }
        public static void UnlinkActions(this ISetTopBoxControls dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.RemoveAction(prefix + "dvrList");
            controller.RemoveAction(prefix + "replay");
        }
예제 #4
0
        public static void LinkActions(this IDvr dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.AddAction(prefix + "dvrlist", new PressAndHoldAction(dev.DvrList));
            controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
        }
예제 #5
0
        public static void UnlinkActions(this IDvr dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.RemoveAction(prefix + "dvrlist");
            controller.RemoveAction(prefix + "record");
        }
예제 #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="appServerController"></param>
        protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
        {
            //EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));

            EISC.SetStringSigAction(SHookState, s =>
            {
                CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
                //GetCurrentCallList();
                SendFullStatus();
            });

            EISC.SetStringSigAction(SCurrentCallNumber, s =>
            {
                CurrentCallItem.Number = s;
                SendCallsList();
            });

            EISC.SetStringSigAction(SCurrentCallName, s =>
            {
                CurrentCallItem.Name = s;
                SendCallsList();
            });

            EISC.SetStringSigAction(SCallDirection, s =>
            {
                CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
                SendCallsList();
            });

            // Add press and holds using helper
            Action <string, uint> addPHAction = (s, u) =>
                                                AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));

            // Add straight pulse calls
            Action <string, uint> addAction = (s, u) =>
                                              AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));

            addAction("/endCallById", BDialHangupOnHook);
            addAction("/endAllCalls", BDialHangupOnHook);
            addAction("/acceptById", BIncomingAnswer);
            addAction("/rejectById", BIncomingReject);
            addAction("/speedDial1", BSpeedDial1);
            addAction("/speedDial2", BSpeedDial2);
            addAction("/speedDial3", BSpeedDial3);
            addAction("/speedDial4", BSpeedDial4);

            // Get status
            AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatus));
            // Dial on string
            AppServerController.AddAction(MessagePath + "/dial", new Action <string>(s => EISC.SetString(SCurrentDialString, s)));
            // Pulse DTMF
            AppServerController.AddAction(MessagePath + "/dtmf", new Action <string>(s =>
            {
                if (DTMFMap.ContainsKey(s))
                {
                    EISC.PulseBool(DTMFMap[s], 100);
                }
            }));
        }
예제 #7
0
        /// <summary>
        /// Called from base's RegisterWithAppServer method
        /// </summary>
        /// <param name="appServerController"></param>
        protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
        {
            appServerController.AddAction("/device/videoCodec/isReady", new Action(SendIsReady));
            appServerController.AddAction("/device/videoCodec/fullStatus", new Action(SendVtcFullMessageObject));
            appServerController.AddAction("/device/videoCodec/dial", new Action <string>(s => Codec.Dial(s)));
            appServerController.AddAction("/device/videoCodec/endCallById", new Action <string>(s =>
            {
                var call = GetCallWithId(s);
                if (call != null)
                {
                    Codec.EndCall(call);
                }
            }));
            appServerController.AddAction(MessagePath + "/endAllCalls", new Action(Codec.EndAllCalls));
            appServerController.AddAction(MessagePath + "/dtmf", new Action <string>(s => Codec.SendDtmf(s)));
            appServerController.AddAction(MessagePath + "/rejectById", new Action <string>(s =>
            {
                var call = GetCallWithId(s);
                if (call != null)
                {
                    Codec.RejectCall(call);
                }
            }));
            appServerController.AddAction(MessagePath + "/acceptById", new Action <string>(s =>
            {
                var call = GetCallWithId(s);
                if (call != null)
                {
                    Codec.AcceptCall(call);
                }
            }));

            // Directory actions
            var dirCodec = Codec as IHasDirectory;

            if (dirCodec != null)
            {
                appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot));
                appServerController.AddAction(MessagePath + "/directoryById", new Action <string>(s => GetDirectory(s)));
                appServerController.AddAction(MessagePath + "/directorySearch", new Action <string>(s => DirectorySearch(s)));
                appServerController.AddAction(MessagePath + "/directoryBack", new Action(GetPreviousDirectory));
            }

            // History actions
            var recCodec = Codec as IHasCallHistory;

            if (recCodec != null)
            {
                appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory));
            }

            appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn));
            appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff));
            appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle));
            appServerController.AddAction(MessagePath + "/sharingStart", new Action(Codec.StartSharing));
            appServerController.AddAction(MessagePath + "/sharingStop", new Action(Codec.StopSharing));
            appServerController.AddAction(MessagePath + "/standbyOn", new Action(Codec.StandbyActivate));
            appServerController.AddAction(MessagePath + "/standbyOff", new Action(Codec.StandbyDeactivate));
        }
예제 #8
0
        public static void UnlinkActions(this IPower dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.RemoveAction(prefix + "powerOn");
            controller.RemoveAction(prefix + "powerOff");
            controller.RemoveAction(prefix + "powerToggle");
        }
예제 #9
0
        public static void LinkActions(this IPower dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.AddAction(prefix + "powerOn", new Action(dev.PowerOn));
            controller.AddAction(prefix + "powerOff", new Action(dev.PowerOff));
            controller.AddAction(prefix + "powerToggle", new Action(dev.PowerToggle));
        }
예제 #10
0
        public static void LinkActions(this IColor dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.AddAction(prefix + "red", new PressAndHoldAction(dev.Red));
            controller.AddAction(prefix + "green", new PressAndHoldAction(dev.Green));
            controller.AddAction(prefix + "yellow", new PressAndHoldAction(dev.Yellow));
            controller.AddAction(prefix + "blue", new PressAndHoldAction(dev.Blue));
        }
예제 #11
0
        public static void UnlinkActions(this IColor dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.RemoveAction(prefix + "red");
            controller.RemoveAction(prefix + "green");
            controller.RemoveAction(prefix + "yellow");
            controller.RemoveAction(prefix + "blue");
        }
예제 #12
0
        /// <summary>
        /// Registers this messenger with appserver controller
        /// </summary>
        /// <param name="appServerController"></param>
        public void RegisterWithAppServer(MobileControlSystemController appServerController)
        {
            if (appServerController == null)
            {
                throw new ArgumentNullException("appServerController");
            }

            AppServerController = appServerController;
            CustomRegisterWithAppServer(AppServerController);
        }
예제 #13
0
        public static void LinkActions(this IChannel dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.AddAction(prefix + "chanUp", new PressAndHoldAction(dev.ChannelUp));
            controller.AddAction(prefix + "chanDown", new PressAndHoldAction(dev.ChannelDown));
            controller.AddAction(prefix + "lastChan", new PressAndHoldAction(dev.LastChannel));
            controller.AddAction(prefix + "guide", new PressAndHoldAction(dev.Guide));
            controller.AddAction(prefix + "info", new PressAndHoldAction(dev.Info));
            controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
        }
예제 #14
0
        public static void UnlinkActions(this IChannel dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.RemoveAction(prefix + "chanUp");
            controller.RemoveAction(prefix + "chanDown");
            controller.RemoveAction(prefix + "lastChan");
            controller.RemoveAction(prefix + "guide");
            controller.RemoveAction(prefix + "info");
            controller.RemoveAction(prefix + "exit");
        }
예제 #15
0
        public static void UnlinkActions(this IDPad dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.RemoveAction(prefix + "up");
            controller.RemoveAction(prefix + "down");
            controller.RemoveAction(prefix + "left");
            controller.RemoveAction(prefix + "right");
            controller.RemoveAction(prefix + "select");
            controller.RemoveAction(prefix + "menu");
            controller.RemoveAction(prefix + "exit");
        }
예제 #16
0
        protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
        {
            appServerController.AddAction(MessagePath + "/fullStatus", new Action(() =>
            {
                SendRoutingFullMessageObject(EISC.GetString(JoinStart + StringJoin.CurrentSource));
            }));

            appServerController.AddAction(MessagePath + "/source", new Action <SourceSelectMessageContent>(c =>
            {
                EISC.SetString(JoinStart + StringJoin.CurrentSource, c.SourceListItem);
            }));
        }
예제 #17
0
        public static void LinkActions(this IDPad dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.AddAction(prefix + "up", new PressAndHoldAction(dev.Up));
            controller.AddAction(prefix + "down", new PressAndHoldAction(dev.Down));
            controller.AddAction(prefix + "left", new PressAndHoldAction(dev.Left));
            controller.AddAction(prefix + "right", new PressAndHoldAction(dev.Right));
            controller.AddAction(prefix + "select", new PressAndHoldAction(dev.Select));
            controller.AddAction(prefix + "menu", new PressAndHoldAction(dev.Menu));
            controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
        }
예제 #18
0
        public static void UnlinkActions(this ITransport dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.RemoveAction(prefix + "play");
            controller.RemoveAction(prefix + "pause");
            controller.RemoveAction(prefix + "stop");
            controller.RemoveAction(prefix + "prevTrack");
            controller.RemoveAction(prefix + "nextTrack");
            controller.RemoveAction(prefix + "rewind");
            controller.RemoveAction(prefix + "ffwd");
            controller.RemoveAction(prefix + "record");
        }
예제 #19
0
        public static void LinkActions(this ITransport dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.AddAction(prefix + "play", new PressAndHoldAction(dev.Play));
            controller.AddAction(prefix + "pause", new PressAndHoldAction(dev.Pause));
            controller.AddAction(prefix + "stop", new PressAndHoldAction(dev.Stop));
            controller.AddAction(prefix + "prevTrack", new PressAndHoldAction(dev.ChapPlus));
            controller.AddAction(prefix + "nextTrack", new PressAndHoldAction(dev.ChapMinus));
            controller.AddAction(prefix + "rewind", new PressAndHoldAction(dev.Rewind));
            controller.AddAction(prefix + "ffwd", new PressAndHoldAction(dev.FFwd));
            controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
        }
예제 #20
0
        public static void UnlinkActions(this INumericKeypad dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.RemoveAction(prefix + "num0");
            controller.RemoveAction(prefix + "num1");
            controller.RemoveAction(prefix + "num2");
            controller.RemoveAction(prefix + "num3");
            controller.RemoveAction(prefix + "num4");
            controller.RemoveAction(prefix + "num5");
            controller.RemoveAction(prefix + "num6");
            controller.RemoveAction(prefix + "num7");
            controller.RemoveAction(prefix + "num8");
            controller.RemoveAction(prefix + "num9");
            controller.RemoveAction(prefix + "numDash");
            controller.RemoveAction(prefix + "numEnter");
        }
예제 #21
0
        public static void LinkActions(this INumericKeypad dev, MobileControlSystemController controller)
        {
            var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);

            controller.AddAction(prefix + "num0", new PressAndHoldAction(dev.Digit0));
            controller.AddAction(prefix + "num1", new PressAndHoldAction(dev.Digit1));
            controller.AddAction(prefix + "num2", new PressAndHoldAction(dev.Digit2));
            controller.AddAction(prefix + "num3", new PressAndHoldAction(dev.Digit3));
            controller.AddAction(prefix + "num4", new PressAndHoldAction(dev.Digit4));
            controller.AddAction(prefix + "num5", new PressAndHoldAction(dev.Digit5));
            controller.AddAction(prefix + "num6", new PressAndHoldAction(dev.Digit6));
            controller.AddAction(prefix + "num7", new PressAndHoldAction(dev.Digit0));
            controller.AddAction(prefix + "num8", new PressAndHoldAction(dev.Digit0));
            controller.AddAction(prefix + "num9", new PressAndHoldAction(dev.Digit0));
            controller.AddAction(prefix + "numDash", new PressAndHoldAction(dev.KeypadAccessoryButton1));
            controller.AddAction(prefix + "numEnter", new PressAndHoldAction(dev.KeypadAccessoryButton2));
            // Deal with the Accessory functions on the numpad later
        }
        protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
        {
            appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendRoutingFullMessageObject));

            appServerController.AddAction(MessagePath + "/source", new Action <SourceSelectMessageContent>(c =>
            {
                RoutingDevice.RunRouteAction(c.SourceListItem, c.SourceListKey);
            }));

            var sinkDevice = RoutingDevice as IRoutingSinkNoSwitching;

            if (sinkDevice != null)
            {
                sinkDevice.CurrentSourceChange += new SourceInfoChangeHandler((o, a) =>
                {
                    SendRoutingFullMessageObject();
                });
            }
        }
예제 #23
0
        public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
        {
            appServerController.RemoveAction(MessagePath + "/fullStatus");

            appServerController.RemoveAction(MessagePath + "/cameraUp");
            appServerController.RemoveAction(MessagePath + "/cameraDown");
            appServerController.RemoveAction(MessagePath + "/cameraLeft");
            appServerController.RemoveAction(MessagePath + "/cameraRight");
            appServerController.RemoveAction(MessagePath + "/cameraZoomIn");
            appServerController.RemoveAction(MessagePath + "/cameraZoomOut");
            appServerController.RemoveAction(MessagePath + "/cameraModeAuto");
            appServerController.RemoveAction(MessagePath + "/cameraModeManual");
            appServerController.RemoveAction(MessagePath + "/cameraModeOff");

            EISC.SetUShortSigAction(JoinMap.NumberOfPresets.JoinNumber, null);

            EISC.SetBoolSigAction(JoinMap.CameraModeAuto.JoinNumber, null);
            EISC.SetBoolSigAction(JoinMap.CameraModeManual.JoinNumber, null);
            EISC.SetBoolSigAction(JoinMap.CameraModeOff.JoinNumber, null);
        }
예제 #24
0
        protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
        {
            var asc = appServerController;

            asc.AddAction(MessagePath + "/fullStatus", new Action(SendCameraFullMessageObject));

            // Add press and holds using helper action
            Action <string, uint> addPHAction = (s, u) =>
                                                asc.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));

            addPHAction("/cameraUp", JoinMap.TiltUp.JoinNumber);
            addPHAction("/cameraDown", JoinMap.TiltDown.JoinNumber);
            addPHAction("/cameraLeft", JoinMap.PanLeft.JoinNumber);
            addPHAction("/cameraRight", JoinMap.PanRight.JoinNumber);
            addPHAction("/cameraZoomIn", JoinMap.ZoomIn.JoinNumber);
            addPHAction("/cameraZoomOut", JoinMap.ZoomOut.JoinNumber);

            Action <string, uint> addAction = (s, u) =>
                                              asc.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));

            addAction("/cameraModeAuto", JoinMap.CameraModeAuto.JoinNumber);
            addAction("/cameraModeManual", JoinMap.CameraModeManual.JoinNumber);
            addAction("/cameraModeOff", JoinMap.CameraModeOff.JoinNumber);

            var presetStart = JoinMap.PresetRecallStart.JoinNumber;
            var presetEnd   = JoinMap.PresetRecallStart.JoinNumber + JoinMap.PresetRecallStart.JoinSpan;

            int presetId = 1;

            // camera presets
            for (uint i = presetStart; i <= presetEnd; i++)
            {
                addAction("/cameraPreset" + (presetId), i);
                presetId++;
            }
        }
예제 #25
0
        /// <summary>
        /// Called from base's RegisterWithAppServer method
        /// </summary>
        /// <param name="appServerController"></param>
        protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
        {
            appServerController.AddAction("/device/videoCodec/isReady", new Action(SendIsReady));
            appServerController.AddAction("/device/videoCodec/fullStatus", new Action(SendVtcFullMessageObject));
            appServerController.AddAction("/device/videoCodec/dial", new Action <string>(s => Codec.Dial(s)));
            appServerController.AddAction("/device/videoCodec/endCallById", new Action <string>(s =>
            {
                var call = GetCallWithId(s);
                if (call != null)
                {
                    Codec.EndCall(call);
                }
            }));
            appServerController.AddAction(MessagePath + "/endAllCalls", new Action(Codec.EndAllCalls));
            appServerController.AddAction(MessagePath + "/dtmf", new Action <string>(s => Codec.SendDtmf(s)));
            appServerController.AddAction(MessagePath + "/rejectById", new Action <string>(s =>
            {
                var call = GetCallWithId(s);
                if (call != null)
                {
                    Codec.RejectCall(call);
                }
            }));
            appServerController.AddAction(MessagePath + "/acceptById", new Action <string>(s =>
            {
                var call = GetCallWithId(s);
                if (call != null)
                {
                    Codec.AcceptCall(call);
                }
            }));

            // Directory actions
            var dirCodec = Codec as IHasDirectory;

            if (dirCodec != null)
            {
                appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot));
                appServerController.AddAction(MessagePath + "/directoryById", new Action <string>(s => GetDirectory(s)));
                appServerController.AddAction(MessagePath + "/directorySearch", new Action <string>(s => DirectorySearch(s)));
                appServerController.AddAction(MessagePath + "/directoryBack", new Action(GetPreviousDirectory));
            }

            // History actions
            var recCodec = Codec as IHasCallHistory;

            if (recCodec != null)
            {
                appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory));
            }
            var cameraCodec = Codec as IHasCodecCameras;

            if (cameraCodec != null)
            {
                Debug.Console(2, this, "Adding IHasCodecCameras Actions");

                cameraCodec.CameraSelected += new EventHandler <CameraSelectedEventArgs>(cameraCodec_CameraSelected);

                appServerController.AddAction(MessagePath + "/cameraSelect", new Action <string>(s => cameraCodec.SelectCamera(s)));

                MapCameraActions();

                var presetsCodec = Codec as IHasCodecRoomPresets;
                if (presetsCodec != null)
                {
                    Debug.Console(2, this, "Adding IHasCodecRoomPresets Actions");

                    presetsCodec.CodecRoomPresetsListHasChanged += new EventHandler <EventArgs>(presetsCodec_CameraPresetsListHasChanged);

                    appServerController.AddAction(MessagePath + "/cameraPreset", new Action <int>(u => presetsCodec.CodecRoomPresetSelect(u)));
                    appServerController.AddAction(MessagePath + "/cameraPresetStore", new Action <CodecRoomPreset>(p => presetsCodec.CodecRoomPresetStore(p.ID, p.Description)));
                }

                var speakerTrackCodec = Codec as IHasCameraAutoMode;
                if (speakerTrackCodec != null)
                {
                    Debug.Console(2, this, "Adding IHasCameraAutoMode Actions");

                    speakerTrackCodec.CameraAutoModeIsOnFeedback.OutputChange += new EventHandler <PepperDash.Essentials.Core.FeedbackEventArgs>(CameraAutoModeIsOnFeedback_OutputChange);

                    appServerController.AddAction(MessagePath + "/cameraAuto", new Action(speakerTrackCodec.CameraAutoModeOn));
                    appServerController.AddAction(MessagePath + "/cameraManual", new Action(speakerTrackCodec.CameraAutoModeOff));
                }
            }

            var selfViewCodec = Codec as IHasCodecSelfView;

            if (selfViewCodec != null)
            {
                Debug.Console(2, this, "Adding IHasCodecSelfView Actions");

                appServerController.AddAction(MessagePath + "/cameraSelfView", new Action(selfViewCodec.SelfViewModeToggle));
            }

            var layoutsCodec = Codec as IHasCodecLayouts;

            if (layoutsCodec != null)
            {
                Debug.Console(2, this, "Adding IHasCodecLayouts Actions");

                appServerController.AddAction(MessagePath + "/cameraRemoteView", new Action(layoutsCodec.LocalLayoutToggle));
            }

            Debug.Console(2, this, "Adding Privacy & Standby Actions");

            appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn));
            appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff));
            appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle));
            appServerController.AddAction(MessagePath + "/sharingStart", new Action(Codec.StartSharing));
            appServerController.AddAction(MessagePath + "/sharingStop", new Action(Codec.StopSharing));
            appServerController.AddAction(MessagePath + "/standbyOn", new Action(Codec.StandbyActivate));
            appServerController.AddAction(MessagePath + "/standbyOff", new Action(Codec.StandbyDeactivate));
        }
예제 #26
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="appServerController"></param>
        protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
        {
            var asc = appServerController;

            EISC.SetStringSigAction(JoinMap.HookState.JoinNumber, s =>
            {
                CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
                PostFullStatus();                 // SendCallsList();
            });

            EISC.SetStringSigAction(JoinMap.CurrentCallNumber.JoinNumber, s =>
            {
                CurrentCallItem.Number = s;
                PostCallsList();
            });

            EISC.SetStringSigAction(JoinMap.CurrentCallName.JoinNumber, s =>
            {
                CurrentCallItem.Name = s;
                PostCallsList();
            });

            EISC.SetStringSigAction(JoinMap.CallDirection.JoinNumber, s =>
            {
                CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
                PostCallsList();
            });

            EISC.SetBoolSigAction(JoinMap.IncomingCall.JoinNumber, b =>
            {
                if (b)
                {
                    var ica = new CodecActiveCallItem()
                    {
                        Direction = eCodecCallDirection.Incoming,
                        Id        = "-video-incoming",
                        Name      = EISC.GetString(JoinMap.IncomingCallName.JoinNumber),
                        Number    = EISC.GetString(JoinMap.IncomingCallNumber.JoinNumber),
                        Status    = eCodecCallStatus.Ringing,
                        Type      = eCodecCallType.Video
                    };
                    IncomingCallItem = ica;
                }
                else
                {
                    IncomingCallItem = null;
                }
                PostCallsList();
            });

            EISC.SetBoolSigAction(JoinMap.CameraSupportsAutoMode.JoinNumber, b =>
            {
                PostStatusMessage(new
                {
                    cameraSupportsAutoMode = b
                });
            });
            EISC.SetBoolSigAction(JoinMap.CameraSupportsOffMode.JoinNumber, b =>
            {
                PostStatusMessage(new
                {
                    cameraSupportsOffMode = b
                });
            });

            // Directory insanity
            EISC.SetUShortSigAction(JoinMap.DirectoryRowCount.JoinNumber, u =>
            {
                // The length of the list comes in before the list does.
                // Splice the sig change operation onto the last string sig that will be changing
                // when the directory entries make it through.
                if (PreviousDirectoryLength > 0)
                {
                    EISC.ClearStringSigAction(JoinMap.DirectoryEntriesStart.JoinNumber + PreviousDirectoryLength - 1);
                }
                EISC.SetStringSigAction(JoinMap.DirectoryEntriesStart.JoinNumber + u - 1, s => PostDirectory());
                PreviousDirectoryLength = u;
            });

            EISC.SetStringSigAction(JoinMap.DirectoryEntrySelectedName.JoinNumber, s =>
            {
                PostStatusMessage(new
                {
                    directoryContactSelected = new
                    {
                        name = EISC.GetString(JoinMap.DirectoryEntrySelectedName.JoinNumber),
                    }
                });
            });

            EISC.SetStringSigAction(JoinMap.DirectoryEntrySelectedNumber.JoinNumber, s =>
            {
                PostStatusMessage(new
                {
                    directoryContactSelected = new
                    {
                        number = EISC.GetString(JoinMap.DirectoryEntrySelectedNumber.JoinNumber),
                    }
                });
            });

            EISC.SetStringSigAction(JoinMap.DirectorySelectedFolderName.JoinNumber, s => PostStatusMessage(new
            {
                directorySelectedFolderName = EISC.GetString(JoinMap.DirectorySelectedFolderName.JoinNumber)
            }));

            EISC.SetSigTrueAction(JoinMap.CameraModeAuto.JoinNumber, () => PostCameraMode());
            EISC.SetSigTrueAction(JoinMap.CameraModeManual.JoinNumber, () => PostCameraMode());
            EISC.SetSigTrueAction(JoinMap.CameraModeOff.JoinNumber, () => PostCameraMode());

            EISC.SetBoolSigAction(JoinMap.CameraSelfView.JoinNumber, b => PostStatusMessage(new
            {
                cameraSelfView = b
            }));

            EISC.SetUShortSigAction(JoinMap.CameraNumberSelect.JoinNumber, (u) => PostSelectedCamera());


            // Add press and holds using helper action
            Action <string, uint> addPHAction = (s, u) =>
                                                AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));

            addPHAction("/cameraUp", JoinMap.CameraTiltUp.JoinNumber);
            addPHAction("/cameraDown", JoinMap.CameraTiltDown.JoinNumber);
            addPHAction("/cameraLeft", JoinMap.CameraPanLeft.JoinNumber);
            addPHAction("/cameraRight", JoinMap.CameraPanRight.JoinNumber);
            addPHAction("/cameraZoomIn", JoinMap.CameraZoomIn.JoinNumber);
            addPHAction("/cameraZoomOut", JoinMap.CameraZoomOut.JoinNumber);

            // Add straight pulse calls using helper action
            Action <string, uint> addAction = (s, u) =>
                                              AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));

            addAction("/endCallById", JoinMap.EndCall.JoinNumber);
            addAction("/endAllCalls", JoinMap.EndCall.JoinNumber);
            addAction("/acceptById", JoinMap.IncomingAnswer.JoinNumber);
            addAction("/rejectById", JoinMap.IncomingReject.JoinNumber);

            var speeddialStart = JoinMap.SpeedDialStart.JoinNumber;
            var speeddialEnd   = JoinMap.SpeedDialStart.JoinNumber + JoinMap.SpeedDialStart.JoinSpan;

            var speedDialIndex = 1;

            for (uint i = speeddialStart; i < speeddialEnd; i++)
            {
                addAction(string.Format("/speedDial{0}", speedDialIndex), i);
                speedDialIndex++;
            }

            addAction("/cameraModeAuto", JoinMap.CameraModeAuto.JoinNumber);
            addAction("/cameraModeManual", JoinMap.CameraModeManual.JoinNumber);
            addAction("/cameraModeOff", JoinMap.CameraModeOff.JoinNumber);
            addAction("/cameraSelfView", JoinMap.CameraSelfView.JoinNumber);
            addAction("/cameraLayout", JoinMap.CameraLayout.JoinNumber);

            asc.AddAction("/cameraSelect", new Action <string>(SelectCamera));

            // camera presets
            for (uint i = 0; i < 6; i++)
            {
                addAction("/cameraPreset" + (i + 1), JoinMap.CameraPresetStart.JoinNumber + i);
            }

            asc.AddAction(MessagePath + "/isReady", new Action(PostIsReady));
            // Get status
            asc.AddAction(MessagePath + "/fullStatus", new Action(PostFullStatus));
            // Dial on string
            asc.AddAction(MessagePath + "/dial", new Action <string>(s =>
                                                                     EISC.SetString(JoinMap.CurrentDialString.JoinNumber, s)));
            // Pulse DTMF
            AppServerController.AddAction(MessagePath + "/dtmf", new Action <string>(s =>
            {
                var join = JoinMap.Joins[s];
                if (join != null)
                {
                    if (join.JoinNumber > 0)
                    {
                        EISC.PulseBool(join.JoinNumber, 100);
                    }
                }
            }));

            // Directory madness
            asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(JoinMap.DirectoryRoot.JoinNumber)));
            asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(JoinMap.DirectoryFolderBack.JoinNumber)));
            asc.AddAction(MessagePath + "/directoryById", new Action <string>(s =>
            {
                // the id should contain the line number to forward to simpl
                try
                {
                    var u = ushort.Parse(s);
                    EISC.SetUshort(JoinMap.DirectorySelectRow.JoinNumber, u);
                    EISC.PulseBool(JoinMap.DirectoryLineSelected.JoinNumber);
                }
                catch (Exception)
                {
                    Debug.Console(1, this, Debug.ErrorLogLevel.Warning,
                                  "/directoryById request contains non-numeric ID incompatible with DDVC bridge");
                }
            }));
            asc.AddAction(MessagePath + "/directorySelectContact", new Action <string>(s =>
            {
                try
                {
                    var u = ushort.Parse(s);
                    EISC.SetUshort(JoinMap.DirectorySelectRow.JoinNumber, u);
                    EISC.PulseBool(JoinMap.DirectoryLineSelected.JoinNumber);
                }
                catch
                {
                }
            }));
            asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => {
                EISC.PulseBool(JoinMap.DirectoryDialSelectedLine.JoinNumber);
            }));
            asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
            {
                if (EISC.GetUshort(JoinMap.DirectoryRowCount.JoinNumber) > 0)
                {
                    PostDirectory();
                }
                else
                {
                    EISC.PulseBool(JoinMap.DirectoryRoot.JoinNumber);
                }
            }));
        }
예제 #27
0
 protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
 {
     AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatusMessage));
 }
예제 #28
0
 protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
 {
     appServerController.AddAction(MessagePath + "/updateConfig", new Action <string>(s => GetConfigFile(s)));
 }
예제 #29
0
        protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
        {
            appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendCameraFullMessageObject));

            var ptzCamera = Camera as IHasCameraPtzControl;

            if (ptzCamera != null)
            {
                //  Need to evaluate how to pass through these P&H actions.  Need a method that takes a bool maybe?
                AppServerController.AddAction(MessagePath + "/cameraUp", new PressAndHoldAction((b) =>
                {
                    if (b)
                    {
                        ptzCamera.TiltUp();
                    }
                    else
                    {
                        ptzCamera.TiltStop();
                    }
                }));
                AppServerController.AddAction(MessagePath + "/cameraDown", new PressAndHoldAction((b) =>
                {
                    if (b)
                    {
                        ptzCamera.TiltDown();
                    }
                    else
                    {
                        ptzCamera.TiltStop();
                    }
                }));
                AppServerController.AddAction(MessagePath + "/cameraLeft", new PressAndHoldAction((b) =>
                {
                    if (b)
                    {
                        ptzCamera.PanLeft();
                    }
                    else
                    {
                        ptzCamera.PanStop();
                    }
                }));
                AppServerController.AddAction(MessagePath + "/cameraRight", new PressAndHoldAction((b) =>
                {
                    if (b)
                    {
                        ptzCamera.PanRight();
                    }
                    else
                    {
                        ptzCamera.PanStop();
                    }
                }));
                AppServerController.AddAction(MessagePath + "/cameraZoomIn", new PressAndHoldAction((b) =>
                {
                    if (b)
                    {
                        ptzCamera.ZoomIn();
                    }
                    else
                    {
                        ptzCamera.ZoomStop();
                    }
                }));
                AppServerController.AddAction(MessagePath + "/cameraZoomOut", new PressAndHoldAction((b) =>
                {
                    if (b)
                    {
                        ptzCamera.ZoomOut();
                    }
                    else
                    {
                        ptzCamera.ZoomStop();
                    }
                }));
            }

            if (Camera is IHasCameraAutoMode)
            {
                appServerController.AddAction(MessagePath + "/cameraModeAuto", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOn));
                appServerController.AddAction(MessagePath + "/cameraModeManual", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOff));
            }

            if (Camera is IPower)
            {
                appServerController.AddAction(MessagePath + "/cameraModeOff", new Action((Camera as IPower).PowerOff));
            }

            var presetsCamera = Camera as IHasCameraPresets;

            if (presetsCamera != null)
            {
                for (int i = 1; i <= 6; i++)
                {
                    var preset = i;
                    appServerController.AddAction(MessagePath + "/cameraPreset" + i, new Action <int>((p) => presetsCamera.PresetSelect(preset)));
                }
            }
        }
예제 #30
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="appServerController"></param>
        protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
        {
            var asc = appServerController;

            EISC.SetStringSigAction(SHookState, s =>
            {
                CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
                PostFullStatus();                 // SendCallsList();
            });

            EISC.SetStringSigAction(SCurrentCallNumber, s =>
            {
                CurrentCallItem.Number = s;
                PostCallsList();
            });

            EISC.SetStringSigAction(SCurrentCallName, s =>
            {
                CurrentCallItem.Name = s;
                PostCallsList();
            });

            EISC.SetStringSigAction(SCallDirection, s =>
            {
                CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
                PostCallsList();
            });

            EISC.SetBoolSigAction(BCallIncoming, b =>
            {
                if (b)
                {
                    var ica = new CodecActiveCallItem()
                    {
                        Direction = eCodecCallDirection.Incoming,
                        Id        = "-video-incoming",
                        Name      = EISC.GetString(SIncomingCallName),
                        Number    = EISC.GetString(SIncomingCallNumber),
                        Status    = eCodecCallStatus.Ringing,
                        Type      = eCodecCallType.Video
                    };
                    IncomingCallItem = ica;
                }
                else
                {
                    IncomingCallItem = null;
                }
                PostCallsList();
            });

            EISC.SetBoolSigAction(BCameraSupportsAutoMode, b =>
            {
                PostStatusMessage(new
                {
                    cameraSupportsAutoMode = b
                });
            });
            EISC.SetBoolSigAction(BCameraSupportsOffMode, b =>
            {
                PostStatusMessage(new
                {
                    cameraSupportsOffMode = b
                });
            });

            // Directory insanity
            EISC.SetUShortSigAction(UDirectoryRowCount, u =>
            {
                // The length of the list comes in before the list does.
                // Splice the sig change operation onto the last string sig that will be changing
                // when the directory entries make it through.
                if (PreviousDirectoryLength > 0)
                {
                    EISC.ClearStringSigAction(SDirectoryEntriesStart + PreviousDirectoryLength - 1);
                }
                EISC.SetStringSigAction(SDirectoryEntriesStart + u - 1, s => PostDirectory());
                PreviousDirectoryLength = u;
            });

            EISC.SetStringSigAction(SDirectoryEntrySelectedName, s =>
            {
                PostStatusMessage(new
                {
                    directoryContactSelected = new
                    {
                        name = EISC.GetString(SDirectoryEntrySelectedName),
                    }
                });
            });

            EISC.SetStringSigAction(SDirectoryEntrySelectedNumber, s =>
            {
                PostStatusMessage(new
                {
                    directoryContactSelected = new
                    {
                        number = EISC.GetString(SDirectoryEntrySelectedNumber),
                    }
                });
            });

            EISC.SetStringSigAction(SDirectorySelectedFolderName, s => PostStatusMessage(new
            {
                directorySelectedFolderName = EISC.GetString(SDirectorySelectedFolderName)
            }));

            EISC.SetSigTrueAction(BCameraModeAuto, () => PostCameraMode());
            EISC.SetSigTrueAction(BCameraModeManual, () => PostCameraMode());
            EISC.SetSigTrueAction(BCameraModeOff, () => PostCameraMode());

            EISC.SetBoolSigAction(BCameraSelfView, b => PostStatusMessage(new
            {
                cameraSelfView = b
            }));

            EISC.SetUShortSigAction(UCameraNumberSelect, (u) => PostSelectedCamera());


            // Add press and holds using helper action
            Action <string, uint> addPHAction = (s, u) =>
                                                AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));

            addPHAction("/cameraUp", BCameraControlUp);
            addPHAction("/cameraDown", BCameraControlDown);
            addPHAction("/cameraLeft", BCameraControlLeft);
            addPHAction("/cameraRight", BCameraControlRight);
            addPHAction("/cameraZoomIn", BCameraControlZoomIn);
            addPHAction("/cameraZoomOut", BCameraControlZoomOut);

            // Add straight pulse calls using helper action
            Action <string, uint> addAction = (s, u) =>
                                              AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));

            addAction("/endCallById", BDialHangup);
            addAction("/endAllCalls", BDialHangup);
            addAction("/acceptById", BIncomingAnswer);
            addAction("/rejectById", BIncomingReject);
            addAction("/speedDial1", BSpeedDial1);
            addAction("/speedDial2", BSpeedDial2);
            addAction("/speedDial3", BSpeedDial3);
            addAction("/speedDial4", BSpeedDial4);
            addAction("/cameraModeAuto", BCameraModeAuto);
            addAction("/cameraModeManual", BCameraModeManual);
            addAction("/cameraModeOff", BCameraModeOff);
            addAction("/cameraSelfView", BCameraSelfView);
            addAction("/cameraLayout", BCameraLayout);

            asc.AddAction("/cameraSelect", new Action <string>(SelectCamera));

            // camera presets
            for (uint i = 0; i < 6; i++)
            {
                addAction("/cameraPreset" + (i + 1), BCameraPresetStart + i);
            }

            asc.AddAction(MessagePath + "/isReady", new Action(PostIsReady));
            // Get status
            asc.AddAction(MessagePath + "/fullStatus", new Action(PostFullStatus));
            // Dial on string
            asc.AddAction(MessagePath + "/dial", new Action <string>(s =>
                                                                     EISC.SetString(SCurrentDialString, s)));
            // Pulse DTMF
            asc.AddAction(MessagePath + "/dtmf", new Action <string>(s =>
            {
                if (DTMFMap.ContainsKey(s))
                {
                    EISC.PulseBool(DTMFMap[s], 100);
                }
            }));

            // Directory madness
            asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(BDirectoryRoot)));
            asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(BDirectoryFolderBack)));
            asc.AddAction(MessagePath + "/directoryById", new Action <string>(s =>
            {
                // the id should contain the line number to forward to simpl
                try
                {
                    var u = ushort.Parse(s);
                    EISC.SetUshort(UDirectorySelectRow, u);
                    EISC.PulseBool(BDirectoryLineSelected);
                }
                catch (Exception)
                {
                    Debug.Console(1, this, Debug.ErrorLogLevel.Warning,
                                  "/directoryById request contains non-numeric ID incompatible with DDVC bridge");
                }
            }));
            asc.AddAction(MessagePath + "/directorySelectContact", new Action <string>(s =>
            {
                try
                {
                    var u = ushort.Parse(s);
                    EISC.SetUshort(UDirectorySelectRow, u);
                    EISC.PulseBool(BDirectoryLineSelected);
                }
                catch
                {
                }
            }));
            asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => {
                EISC.PulseBool(BDirectoryDialSelectedLine);
            }));
            asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
            {
                if (EISC.GetUshort(UDirectoryRowCount) > 0)
                {
                    PostDirectory();
                }
                else
                {
                    EISC.PulseBool(BDirectoryRoot);
                }
            }));
        }