Example #1
0
        /// <summary>
        /// Attempt to transfer the call to the given destination with the set transfer type.
        /// </summary>
        /// <param name="call"></param>
        /// <param name="callToReplace"></param>
        /// <param name="transferType"></param>
        /// <returns></returns>
        async Task<bool> TransferAsync(AudioVideoCall call, AudioVideoCall callToReplace)
        {
            try
            {
                // accept call if not accepted
                if (call.State != CallState.Established)
                    await call.AcceptAsync();

                // transfer to answered endpoint
                await call.TransferAsync(callToReplace, new CallTransferOptions(CallTransferType.Attended));
                return true;
            }
            catch (RealTimeException)
            {
                return false;
            }
        }