コード例 #1
0
ファイル: EndpointHelper.cs プロジェクト: chxj1980/pjsip
        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);
        }
コード例 #2
0
ファイル: EndpointHelper.cs プロジェクト: chxj1980/pjsip
        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);
        }
コード例 #3
0
ファイル: VoipCallHelper.cs プロジェクト: alex231330/android
        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);
        }