如何防止订阅目标收到通知? [英] How to prevent subscription targets from getting a notification?
问题描述
虽然API提到我们可以阻止订阅目标在端点订阅时收到通知:
"当 contextData 时null,将不会通知远程目标此订阅。当
contextData 设置为String.Empty时,将发送默认上下文。建议将其设置为String.Empty以与Office Communicator正确互操作。 (http://msdn.microsoft.com/en-us/library/dd186572%28v=office.13%29.aspx)
...订阅目标仍然是*从Office Communicator收到通知,提示他们接受我的ApplicationEndpoint作为其联系人列表的成员!
以下是我正在进行订阅的方式:
..
//建立订阅列表
  RemotePresentitySubscriptionTarget target = new RemotePresentitySubscriptionTarget(
presenceBean.Sip,String.Empty);
          targets.Add(target);
..
  ;          //订阅列表
RemotePresence remotePresence = this._cachedPresenceGetter.getRemotePresence();
remotePresence.BeginAddTargets(
目标,remotePresence_SubscribeCallback,remotePresence
);
我做错了吗?或者这是API中的某种错误?
将contextData设置为null,而不是String.Empty。
Ron
Though the APIs mention that we can prevent subscription targets from getting a notification when an endpoint subscribes to it:
"When contextData is null, the remote target will not be informed of this subscription. When contextData is set to String.Empty, a default context will be sent. It is advisable to set this to String.Empty to interop correctly with Office Communicator." (http://msdn.microsoft.com/en-us/library/dd186572%28v=office.13%29.aspx)
... the subscription targets are *still* getting notifications from Office Communicator, prompting them to accept my ApplicationEndpoint as a member of their contact list!
Here is how I am doing the subscription:
..
// build up subscription list
RemotePresentitySubscriptionTarget target = new RemotePresentitySubscriptionTarget(
presenceBean.Sip, String.Empty );
targets.Add(target);
..
// subscribe the list
RemotePresence remotePresence = this._cachedPresenceGetter.getRemotePresence();
remotePresence.BeginAddTargets(
targets, remotePresence_SubscribeCallback, remotePresence
);
Am I doing something wrong? Or is this some kind of bug in the API?
Set contextData to null, not String.Empty.
Ron
这篇关于如何防止订阅目标收到通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!