' IPhoneLine'不包含' PhoneLineStateChenged'的定义

时间:2018-05-23 05:39:14

标签: c# windows-phone-voip

我刚开始使用Ozeki VoIP SDK。 在我的注册方法中,我的phoneLine无法识别PhoneLineStateChanged。 我的代码如下。

public void Register(bool registrationRequired,string displayName, string userName, string authenticationId, string registerPassword, string domainHost, string domainPort)
    {
        try
        {
            var account = new SIPAccount(registrationRequired, displayName, userName, authenticationId, registerPassword, domainHost, domainPort);
            Console.WriteLine("\n Creating SIP account {0}", account);
            var natConfiguration = new NatConfiguration(NatTraversalMethod.None);
            var phoneLineConfiguration = new PhoneLineConfiguration(account);
            //phoneLine = softPhone.CreatePhoneLine(account);
            phoneLine = softPhone.CreatePhoneLine(phoneLineConfiguration);
            Console.WriteLine("Phoneline created.");
            phoneLine.PhoneLineStateChanged += phoneLine_PhoneLineStateChanged;
        }
        catch
        { }
    }

我的推荐是

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ozeki.Network.Nat;
using Ozeki.VoIP;
using Ozeki.VoIP.SDK;

我忘了参考或什么?

1 个答案:

答案 0 :(得分:0)

查看SDK示例,事件似乎实际上称为RegistrationStateChanged。所以这应该有效:

phoneLine.RegistrationStateChanged += phoneLine_PhoneLineStateChenged;

他们的例子也称之为phoneLine.PhoneLineStateChanged,这有点误导。我猜他们改名了。