我在检查连接时遇到问题..对于多个号码自动.ozeki。网络电话 [英] I have a problem checking the connection .. For several numbers automatically .ozeki . Voip

查看:66
本文介绍了我在检查连接时遇到问题..对于多个号码自动.ozeki。网络电话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在检查连接时遇到问题..多个号码自动.ozeki。 voip ..我想要一个程序自动连接并检查连接是否是..断开呼叫并显示列表中的号码并拨打第二个号码..但是当我拨打号码并显示在列表中的问题没有显示任何内容



我尝试过:



I have a problem checking the connection .. for several numbers automatically .ozeki . voip .. I want a program to connect automatically and check the connection if it is .. Disconnect the call and display the number in the list and call in the second number .. But the problem when I call the number and show in the list does not show anything

What I have tried:

private void button2_Click(object sender, EventArgs e)
        {
            var dlg = new OpenFileDialog
            {
                Title = "Select connections information file",
                Filter = "Text Files | *.txt"
            };

            if (dlg.ShowDialog() == DialogResult.OK)
            {
              
                textBox4.Text = dlg.FileName;
            }

            var lines = File.ReadAllLines(textBox4.Text);

            for (int i = 0; i < lines.Length; ++i)
            {
                string num = i.ToString();

                CallInfo _callInfo = new CallInfo(num);
                
                _callList.Add(_callInfo);

            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            foreach (var callListMember in _callList)
            {
                    listBox1.Items.Add(callListMember);
            }

        }



///////////////////// //////////////////////////////




///////////////////////////////////////////////////

public CallInfo(string phoneNumber)
        {
            PhoneNumber = phoneNumber;
            call = softPhone.CreateCallObject(phoneLine,phoneNumber);

            // WireUpCallEvents();
            goo();
        }
        public  void goo()
        {
            call.Start();
            if (call.IsAnswered)
            {
                if (call != null)
                {
                    if (inComingCall && call.CallState == CallState.Ringing)
                    {
                        call.Reject();
                    }
                    else
                    {
                        call.HangUp();
                        inComingCall = false;
                    }
                    call = null;
                }
            }
            return;
        }

推荐答案

在你已经2次引用call之后检查null是没用的。 />


在使用实例之前检查空值(可能为空)。
Checking for "null" after you have referenced "call" 2 times already, is useless.

Check for nulls "before" using an instance (that could be null).


这篇关于我在检查连接时遇到问题..对于多个号码自动.ozeki。网络电话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆