在UCMA1.0中发布在线状态 [英] publish presence in UCMA1.0

查看:67
本文介绍了在UCMA1.0中发布在线状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过UCMA1.0(SipServiceReuqest类)发布在线状态。代码如下:


I try to publish the presence by UCMA1.0, the SipServiceReuqest class. The code is below:

/// <summary>
        /// PublishPresenceState is the method used to Publish Always online.
        /// </summary>
        /// <param name="availability"></param>
        public void PublishPresenceState(PresenceState availability)
        {
            if (m_sipEndpoint != null)
            {
                int availabilityValue = (int)availability;

                ContentType contentType = new ContentType("application/ms-call-associated-data+xml");
                // Always Online Publication
                const string PresenceBlob = "<publish xmlns=\"http://schemas.microsoft.com/2006/09/sip/rich-presence\"><publications uri=\"{0}\"><publication categoryName=\"state\" instance=\"0\" container=\"{1}\" version=\"{2}\" expireType=\"static\"><state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"aggregateState\"><availability>{3}</availability></state></publication></publications></publish>";

                string presenceBlob = String.Format(PresenceBlob, "sip:ocean@ucserver.com", 7000, 3, availabilityValue);

                byte[] body = Encoding.UTF8.GetBytes(presenceBlob);

                SipServiceRequest request = new SipServiceRequest(m_sipEndpoint, contentType, body);
                
                request.BeginService(PublishPresenceStateComplete, request);
            }
        }


并在创建会话后调用它。

and invoke it after the session created.

m_sipEndpoint.Register(list);

            SignalingSession session = new SignalingSession(m_sipEndpoint, new RealTimeAddress("sip:administrator@ucserver.com"));

            session.OfferAnswerNegotiation = this;

            PublishPresenceState(PresenceState.Online);


得到例外:
FaultCode = ResponseCode = 405 ResponseText =方法不允许 DiagnosticInformation = ErrorCode = 1011,Source = UCR2.ucserver.com,Reason = Ms-Diagnostics标题不是由前一跳提供的。

顺便说一句,我引用了"Microsoft。 Rtc.Collaboration.dll"它包含在UCMA2.0中,该程序也在UCR2平台上运行。我知道有另一种方法可以在UCMA2.0中发布状态,但现在我只想知道如何通过旧的UCMA1.0方法发布状态。因为我们有一些基于OCS2007的项目,而不是R2。

感谢。

Got the exception:
FaultCode=ResponseCode=405 ResponseText=Method Not Allowed
DiagnosticInformation=ErrorCode=1011,Source=UCR2.ucserver.com,Reason=Ms-Diagnostics header not provided by previous hop.

by the way, I reference the "Microsoft.Rtc.Collaboration.dll" which is included in UCMA2.0, and the program is also running on UCR2 platform. I have known there is another way to publish the presence in UCMA2.0, but now I only want to know how to publish the presence by old UCMA1.0 method. because we have some projects base on OCS2007, not R2.

thanks.

推荐答案

尝试将此XML字符串与硬编码值一起使用。开始一次添加属性,直到找到导致异常的属性为止。


private

Try using this XML string with the values hardcoded. The start adding on property at a time until you find the one causing the exception.

private

const string STATE_XML_FORMAT = " state的xmlns = \" HTTP://schemas.microsoft.com/2006/09/sip/state\" " + "的xmlns:的xsi = \" HTTP://www.w3.org/2001/XMLSchema-instance\" manual =" + " \" false \" xsi:type = \" machineState \">< availability> 3500< / availability>" + "< activity ">< publications uri = \" sip: ocean@ucserver.com \"> < / activity>< / state>" ;

您还可以找到更多文件在这里:
http://www.microsoft.com /downloads/details.aspx?familyid=05F6BFC9-B51A-414F-A928-A8FB137B9BAB&displaylang=en

也是prese的主要文件nce在这里:
http://download.microsoft.com/download/1/6/f/16f4e321-aa6b-4fa3-8ad3-e94c895a3c97/ [MS-PRES] .PDF

我不认为你可以使用出版物uri作为类别"州"!您需要查看上面的文档。

Keith Kabza
的http://www.gotuc.net

const string STATE_XML_FORMAT = "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" manual=" + "\"false\" xsi:type=\"machineState\"><availability>3500</availability>" + "<activity"><publications uri=\"sip:ocean@ucserver.com\"></activity></state>";

You can also find more documenation here:
http://www.microsoft.com/downloads/details.aspx?familyid=05F6BFC9-B51A-414F-A928-A8FB137B9BAB&displaylang=en

Also the main doc for presence is here:
http://download.microsoft.com/download/1/6/f/16f4e321-aa6b-4fa3-8ad3-e94c895a3c97/[MS-PRES].pdf

I dont think you can use publications uri for category "state"! You would need to check the documentation above.

Keith Kabza
http://www.gotuc.net



这篇关于在UCMA1.0中发布在线状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆