Exemple #1
0
        public static async Task <OperationResult> ModifyAccount(String id, String registrar, String proxy, String username, String password)
        {
            if (!ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsVoipContract", 1))
            {
                return(OperationResult.Failed);
            }

            AppServiceHelper appServiceHelper = new AppServiceHelper();

            ValueSet message = new ValueSet();

            message[ModifyAccountArguments.id.ToString()]        = id;
            message[ModifyAccountArguments.registrar.ToString()] = registrar;
            message[ModifyAccountArguments.proxy.ToString()]     = proxy;
            message[ModifyAccountArguments.username.ToString()]  = username;
            message[ModifyAccountArguments.password.ToString()]  = password;
            message[BackgroundOperation.NewBackgroundRequest]    = (int)BackgroundRequest.ModifyAccount;

            ValueSet response = await appServiceHelper.SendMessageAsync(message);

            if (response != null)
            {
                return((OperationResult)(response[BackgroundOperation.Result]));
            }
            return(OperationResult.Failed);
        }
Exemple #2
0
        public static OperationResult EndCallAsync()
        {
            AppServiceHelper appServiceHelper = new AppServiceHelper();

            ValueSet message = new ValueSet();

            message[BackgroundOperation.NewBackgroundRequest] = (int)BackgroundRequest.EndCall;

            appServiceHelper.SendMessage(message);

            return(OperationResult.Succeeded);
        }
Exemple #3
0
        public static async Task <OperationResult> GetAccountInfo()
        {
            if (!ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsVoipContract", 1))
            {
                return(OperationResult.Failed);
            }

            AppServiceHelper appServiceHelper = new AppServiceHelper();

            ValueSet message = new ValueSet();

            message[BackgroundOperation.NewBackgroundRequest] = (int)BackgroundRequest.GetAccountInfo;

            ValueSet response = await appServiceHelper.SendMessageAsync(message);

            if (response != null)
            {
                return((OperationResult)(response[BackgroundOperation.Result]));
            }
            return(OperationResult.Failed);
        }
Exemple #4
0
        public static async Task <OperationResult> NewOutgoingCallAsync(String dstURI)
        {
            if (!ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsVoipContract", 1))
            {
                return(OperationResult.Failed);
            }

            AppServiceHelper appServiceHelper = new AppServiceHelper();

            ValueSet message = new ValueSet();

            message[NewCallArguments.DstURI.ToString()]       = dstURI;
            message[BackgroundOperation.NewBackgroundRequest] = (int)BackgroundRequest.NewOutgoingCall;

            ValueSet response = await appServiceHelper.SendMessageAsync(message);

            if (response != null)
            {
                return((OperationResult)(response[BackgroundOperation.Result]));
            }

            return(OperationResult.Failed);
        }