2

我正在使用 Skype api 从窗口应用程序进行视频通话:

(1)。当用户没有在我们这边(呼叫方)登录到Skype时,它会给出错误“等待超时”

(2)。如果我们已经登录到 Skype 并且被呼叫的人接听了呼叫应用程序就会崩溃。

我的代码是:

public partial class Form1 : Form
{
    static string SkypeID = string.Empty;
    public Form1()
    {
        InitializeComponent();
    }

    private void btn_skypecall_Click(object sender, EventArgs e)
    {

        SkypeID = txt_skypeID.Text.Trim();
        if (!string.IsNullOrEmpty(SkypeID))
        {
            try
            {
                Skype skype;

                skype = new Skype("Skype4COM.Skype", "Skype_");

                if (!skype.Client.IsRunning)
                {
                    skype.Client.Start(false, false);
                }

                skype.Attach(5, true);

                skype.CallStatus += new _ISkypeEvents_CallStatusEventHandler(skype_CallStatus);

                Call call = skype.PlaceCall(SkypeID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        else
        {
            DialogResult result = MessageBox.Show("Please enter SkypeId ", "", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
        }
    }

    static void skype_CallStatus(Call pCall, TCallStatus Status)
    {
        if (Status == TCallStatus.clsInProgress && pCall.PartnerHandle == SkypeID)
        {
            pCall.StartVideoSend();
        }
    }


}

如何解决这两个问题?任何帮助将不胜感激

提前致谢

4

0 回答 0