-2

我刚开始使用 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;

我忘记了参考还是什么?

4

1 回答 1

0

查看 SDK 示例,似乎该事件实际上被称为RegistrationStateChanged. 所以这应该工作:

phoneLine.RegistrationStateChanged += phoneLine_PhoneLineStateChenged;

他们的例子也叫它有点误导phoneLine.PhoneLineStateChanged。我猜他们改名了。

于 2018-05-23T06:41:53.513 回答