Пример #1
0
        public async Task <bool> CallAsync(string hostAddress, string callee, string profileName, string deviceEncoder = "Program")
        {
            // TODO: first check codec call status. Do not execute the call method if the codec is already in a call.
            // Some codecs will hangup the current call and dial up the new call without hesitation.

            // If the device have multiple encoders to call with
            var          deviceLineEncoder   = string.IsNullOrEmpty(deviceEncoder) || deviceEncoder == "null" ? "Program" : deviceEncoder;
            IkusNetCodec callSelectedEncoder = IkusNetCodec.Program;

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

            var cmd = new CommandIkusNetCall
            {
                Address     = callee,
                Profile     = profileName,
                CallContent = IkusNetCallContent.Audio,
                CallType    = IkusNetIPCallType.UnicastBidirectional,
                Codec       = callSelectedEncoder,
            };

            return(await SendConfigurationCommandAsync(hostAddress, cmd));
        }
Пример #2
0
        public bool Call(string hostAddress, Call call)
        {
            var cmd = new CommandIkusNetCall
            {
                Address     = call.Address,
                CallContent = (IkusNetCallContent)call.Content,
                CallType    = (IkusNetIPCallType)call.CallType,
                Codec       = (IkusNetCodec)call.Codec,
                Profile     = call.Profile
            };

            return(SendConfigurationCommand(hostAddress, cmd));
        }