예제 #1
0
파일: IkusNetApi.cs 프로젝트: yehuangcn/ccm
        public bool HangUp(string hostAddress, Codec codec)
        {
            var cmd = new CommandIkusNetHangUp {
                Codec = (IkusNetCodec)codec
            };

            return(SendConfigurationCommand(hostAddress, cmd));
        }
예제 #2
0
        public async Task <bool> HangUpAsync(string hostAddress, string deviceEncoder = "Program")
        {
            // If the device have multiple encoders to hang up
            var          deviceLineEncoder     = string.IsNullOrEmpty(deviceEncoder) || deviceEncoder == "null" ? "Program" : deviceEncoder;
            IkusNetCodec hangupSelectedEncoder = IkusNetCodec.Program;

            try
            {
                hangupSelectedEncoder = (IkusNetCodec)Enum.Parse(typeof(IkusNetCodec), deviceLineEncoder, true);
            }
            catch (Exception)
            {
                hangupSelectedEncoder = IkusNetCodec.Program;
            }

            var cmd = new CommandIkusNetHangUp {
                Codec = hangupSelectedEncoder
            };

            return(await SendConfigurationCommandAsync(hostAddress, cmd));
        }