Example #1
0
        async void callObj_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
        {
            sender.NotifyCallActive();
            await Task.Delay(3000);

            sender.NotifyCallEnded();
        }
Example #2
0
        private void Call_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
        {
            CallOpParamRT param = new CallOpParamRT();

            param.statusCode = 200;
            param.reason     = "OK";

            try
            {
                Current.MyApp.answerCall(param);
            }
            catch (Exception ex)
            {
                Current.MyApp.writeLog(2, ex.Message);
            }
            Current.VoipCall = sender;
            try
            {
                Current.VoipCall.NotifyCallActive();
            }
            catch (Exception ex)
            {
                Current.MyApp.writeLog(2, ex.Message);
            }
        }
Example #3
0
        private async void OnAnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
        {
            if (_phoneCall != null)
            {
                await UpdateStateAsync(TLPhoneCallState.ExchangingKeys);

                var reqConfig = new TLMessagesGetDHConfig {
                    Version = 0, RandomLength = 256
                };

                var config = await SendRequestAsync <TLMessagesDHConfig>("messages.getDhConfig", reqConfig);

                if (config.IsSucceeded)
                {
                    var dh = config.Result;
                    if (!TLUtils.CheckPrime(dh.P, dh.G))
                    {
                        return;
                    }

                    var salt         = new byte[256];
                    var secureRandom = new SecureRandom();
                    secureRandom.NextBytes(salt);

                    secretP = dh.P;
                    a_or_b  = salt;

                    var g_b = MTProtoService.GetGB(salt, dh.G, dh.P);

                    var request = new TLPhoneAcceptCall
                    {
                        GB       = g_b,
                        Peer     = _phoneCall.ToInputPhoneCall(),
                        Protocol = new TLPhoneCallProtocol
                        {
                            IsUdpP2p       = true,
                            IsUdpReflector = true,
                            MinLayer       = Telegram.Api.Constants.CallsMinLayer,
                            MaxLayer       = Telegram.Api.Constants.CallsMaxLayer,
                        }
                    };

                    var response = await SendRequestAsync <TLPhonePhoneCall>("phone.acceptCall", request);

                    if (response.IsSucceeded)
                    {
                        _systemCall.NotifyCallActive();
                        Handle(new TLUpdatePhoneCall {
                            PhoneCall = response.Result.PhoneCall
                        });
                    }
                }
            }
        }
Example #4
0
 private void Call_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
 {
     VoipCall.NotifyCallActive();
     Hub.Instance.VoipChannel.Answer();
 }
 private void Call_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
 {
     VoipCall.NotifyCallActive();
     Hub.Instance.VoipChannel.Answer();
 }
Example #6
0
 private async void Call_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
 {
     _voipCall.NotifyCallActive();
     await Hub.Instance.CallChannel.AnswerAsync();
 }
 private static void Call_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
 {
     sender.NotifyCallActive();
 }
Example #8
0
 private static void Call_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
 {
     sender.NotifyCallActive();
 }
Example #9
0
 private void Call_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
 {
     sender.NotifyCallActive();
     Current.VoipCall = sender;
     Current.StartAudio();
 }
 private void Call_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
 {
     sender.NotifyCallActive();
     Current.VoipCall = sender;
     Current.StartAudio();
 }
 async void callObj_AnswerRequested(VoipPhoneCall sender, CallAnswerEventArgs args)
 {
     sender.NotifyCallActive();
     await Task.Delay(3000);
     sender.NotifyCallEnded();
 }