Exemple #1
0
        internal void NewIncomingCall(string context, string contactName, string serviceName)
        {
            try
            {
                VoipCallCoordinator vCC  = VoipCallCoordinator.GetDefault();
                VoipPhoneCall       call = vCC.RequestNewIncomingCall(
                    "Hello",
                    contactName,
                    context,
                    new Uri("file://c:/data/test/bin/FakeVoipAppLight.png"),
                    serviceName,
                    new Uri("file://c:/data/test/bin/FakeVoipAppLight.png"),
                    "",
                    new Uri("file://c:/data/test/bin/FakeVoipAppRingtone.wma"),
                    VoipPhoneCallMedia.Audio,
                    new TimeSpan(0, 1, 20));
                if (call != null)
                {
                    call.AnswerRequested += Call_AnswerRequested;
                    call.EndRequested    += Call_EndRequested;
                    call.RejectRequested += Call_RejectRequested;

                    Current.VoipCall = call;
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
            }
        }
Exemple #2
0
        private void NewIncomingCall(string context, string contactName, string serviceName)
        {
            bool status = false;

            try
            {
                VoipCallCoordinator vCC  = VoipCallCoordinator.GetDefault();
                VoipPhoneCall       call = vCC.RequestNewIncomingCall(
                    "Hello",
                    contactName,
                    context,
                    new Uri("file://c:/data/test/bin/FakeVoipAppLight.png"),
                    serviceName,
                    new Uri("file://c:/data/test/bin/FakeVoipAppLight.png"),
                    "",
                    new Uri("file://c:/data/test/bin/FakeVoipAppRingtone.wma"),
                    VoipPhoneCallMedia.Audio,
                    new TimeSpan(0, 1, 20));
                if (call != null)
                {
                    call.AnswerRequested += Call_AnswerRequested;
                    call.EndRequested    += Call_EndRequested;
                    call.HoldRequested   += Call_HoldRequested;
                    call.RejectRequested += Call_RejectRequested;
                    call.ResumeRequested += Call_ResumeRequested;

                    Current.VoipCall = call;

                    status = true;
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
            }

            ValueSet response = new ValueSet();

            response[BackgroundOperation.Result] = status ? (int)OperationResult.Succeeded : (int)OperationResult.Failed;

            Current.SendResponse(response);
        }