2

マネージド SIP アプリケーション (MSPL や UCMA などのサーバー側テクノロジ) で Lync クライアントの通話転送ルール (ルーティング) を取得するにはどうすればよいですか? 私が見つけた唯一のものは、Lync SDK を使用してクライアント側で行う方法に関する記事です。

また、この回答このMSDNの記事この質問は、それが機能することを示しているようですが、特定の瞬間(ユーザーがオンラインかどうか)にこの設定が必要であり、ユーザーがLyncアカウントにログインしてプレゼンスを公開する直後ではありませんリンク#1に見られるように、情報。また、最初に UserEndpoint を作成せずに、クライアントに対してこれを取得する必要があります。そのため、これが ApplicationEndpoint (または別の方法) で可能であれば最適です。

私の知る限り、プレゼンス メタデータから転送設定を取得できるはずですが、この情報は取得できません。

 var categories = new string[] {
     "state",
     //"routing" // ?
 };

 var asyncresult = presenceSvc.BeginPresenceQuery(sips, categories, null, null, null);
 var result = presenceSvc.EndPresenceQuery(asyncresult).ToList();
4

1 に答える 1

1

ApplicationEndpointではできません。UserEndpointが必要です。ただし、CollaborationPlateformSipUserのみを必要とし、パスワードを必要としないUserEndpointを作成できます。

私のアプリケーションでは、ILSpyを介してSEFAUtil.exeを逆コンパイルし、プログラムでの動作を理解しました。ご覧になることをお勧めします。

これを機能させるための私のテクニックは次のとおりです。

1/ UserEndPoint の作成

ユーザー エンドポイントを作成するときは、このプレゼンスをサブスクライブして、接続されていなくても情報を取得する必要があります

userEndpoint.LocalOwnerPresence.BeginSubscribe(null, null);

2/ PresenceNotificationReceived イベントをサブスクライブする

userEndpoint.LocalOwnerPresence.PresenceNotificationReceived += OnCategoryNotificationReceived;

private static void OnCategoryNotificationReceived(object sender, LocalPresentityNotificationEventArgs e)
    {
        // Here you get the PresenceCategory and all the data of the user
        foreach (PresenceCategoryWithMetaData current in e.AllCategories)
        {
            if (current.Name == "routing" && current.ContainerId == 0 && current.InstanceId == 0L)
        // Creation of your Routing, I stock it in a Property 
                _routingCategory = new Routing(current);
        }
        // I set my event to continue my main thread
        _routingCategoryUpdated.Set(); 
    }

3/ 欲しい情報を表示する

 // Wait until you get the information of the user
 if (!_routingCategoryUpdated.WaitOne(10000))
        {
            Console.WriteLine("TimeOut Getting Informations");
            return;
        }
 // Just display all the data you can need
 else
        {
            Console.WriteLine($"User Aor: {userEndPointTarget.OwnerUri}");
            Console.WriteLine($"Display Name: {userEndPointTarget.OwnerDisplayName}");
            Console.WriteLine($"UM Enabled: {userEndPointTarget.UmEnabled}");
            Console.WriteLine($"Simulring enabled: {_routingCategory.SimultaneousRingEnabled}");

            if (_routingCategory.SimultaneousRingEnabled && _routingCategory.SimultaneousRing != null)
            {
                foreach (string time in _routingCategory.SimultaneousRing)
                {
                    Console.WriteLine($"Simul_Ringing to: {time}");
                }
            }
            if (_routingCategory.DelegateRingEnabled)
            {
                if (_routingCategory.SkipPrimaryEnabled)
                {
                    Console.Out.Write("Forwarding calls to Delegates: ");
                }
                else if (_routingCategory.UserWaitTimebeforeTeamOrDelegates.TotalSeconds > 0.0)
                {
                    Console.Out.Write($"Delay Ringing Delegates (delay:{ _routingCategory.UserWaitTimebeforeTeamOrDelegates.TotalSeconds} seconds): ");
                }
                else
                {
                    Console.Out.Write("Simultaneously Ringing Delegates: ");
                }
                foreach (string delegateCurrent in _routingCategory.Delegates)
                {
                    Console.Out.Write($"{delegateCurrent} ");
                }
                Console.Out.WriteLine();
            }
            else if (_routingCategory.TeamRingEnabled)
            {
                if (_routingCategory.UserWaitTimebeforeTeamOrDelegates.TotalSeconds > 0.0)
                {
                    Console.Out.Write($"Delay Ringing Team (delay:{_routingCategory.UserWaitTimebeforeTeamOrDelegates.TotalSeconds} seconds). Team: ");
                }
                else
                {
                    Console.Out.Write("Team ringing enabled. Team: ");
                }
                foreach (string currentTeam in _routingCategory.Team)
                {
                    Console.Out.Write($"{currentTeam} ");
                }
                Console.Out.WriteLine();
            }
            else if (_routingCategory.CallForwardToTargetsEnabled)
            {
                if (_routingCategory.CallForwardingEnabled)
                {
                    Console.Out.WriteLine($"Forward immediate to: {_routingCategory.CallForwardTo}");
                }
                else
                {
                    Console.Out.WriteLine($"User Ring time: {_routingCategory.UserOnlyWaitTime}");
                    Console.Out.WriteLine($"Call Forward No Answer to: {_routingCategory.CallForwardTo[0]}");
                }
            }
            else if (userEndPointTarget.UmEnabled)
            {
                Console.Out.WriteLine($"User Ring time: {_routingCategory.UserOnlyWaitTime}");
                Console.Out.WriteLine("Call Forward No Answer to: voicemail");
            }
            else
            {
                Console.Out.WriteLine("CallForwarding Enabled: false");
            }
于 2015-11-20T11:49:31.683 に答える