0

我正在使用清单和 Windows 服务编写 Lync MSPL 应用程序。在我的 manifest.am 中,我有以下代码:

<?xml version="1.0"?>
<r:applicationManifest
 r:appUri="http://www.company.no/LyncServerFilter"
 xmlns:r="http://schemas.microsoft.com/lcs/2006/05">

<r:requestFilter methodNames="ALL"
             strictRoute="true"
             domainSupported="false"/>

<r:responseFilter reasonCodes="ALL"/>
<r:proxyByDefault action="true" />
<r:allowRegistrationBeforeUserServices action="true" />

<r:splScript>
    <![CDATA[

callId = GetHeaderValues("Call-ID"); 
cseq = GetHeaderValues("CSeq");
content = "";
sstate = GetHeaderValues("subscription-state");
xevent = GetHeaderValues("Event");
xdir = GetHeaderValues("Direction");
xexp = GetHeaderValues("Session-Expires");
referto = GetHeaderValues("Refer-To");

if (sipRequest)
{
    if (sipRequest.Method == "INVITE") {
        if (ContainsString(sipRequest.Content, "m=audio", true)) { 
            content = "audio";
        }
        else if (ContainsString(sipRequest.Content, "m=video", true)) { 
            content = "video";
        }
        else if (ContainsString(sipRequest.Content, "m=message", true)) { 
            content = "message";
        }
        else if (ContainsString(sipRequest.Content, "m=application", true)) { 
            content = "application";
        }
        else {
            content = "unknown";
        }

    }
    else if (sipRequest.Method == "NOTIFY" || sipRequest.Method == "BENOTIFY") {
        content = sipRequest.Content;
    }


    DispatchNotification("OnRequest", sipRequest.Method, sipMessage.From, sipMessage.To, callId, cseq, content, xdir, xevent, sstate, xexp, referto);
    if (sipRequest) {       
        ProxyRequest();
    }
}
else if(sipResponse) {
    DispatchNotification("OnResponse", sipResponse.StatusCode, sipResponse.StatusReasonPhrase, sipMessage.From, sipMessage.To, callId, cseq, content, xdir, xevent, sstate, xexp, referto);
    ProxyResponse();
}
]]></r:splScript>
</r:applicationManifest>

我在 Lync 前端服务器上的事件日志中收到以下错误消息: Lync Server application MSPL script execution aborted because of an error

' http://www.company.no/LyncServerFilter '处的应用程序 Uri ,第 60 行错误:0x80070057 - 参数不正确

附加信息:ProxyRequest 仅对 sipRequest 有效

第 60 行是我调用 ProxyRequest 的地方:

if (sipRequest) {       
ProxyRequest();
}

问题:

  1. 为什么错误消息说 ProxyRequest 仅对 sipRequest 有效?我正在检查它是 sipMessage 对吗?
  2. 既然我设置了 proxyByDefault=true,我可以删除对 ProxyRequest() 的调用吗?DistpathNotification-method 是否“处理”该方法(吞下它),还是默认代理该消息?当我删除对 ProxyRequest() 的调用时,代码“有效”,但我不确定后果是什么......
4

1 回答 1

1

ProxyRequest方法采用uri的参数,这就是您收到编译错误消息的原因。

所以你应该这样称呼它:

ProxyRequest(""); // send to the URI specified in the request itself

删除它的有效性与将proxyByDefault设置设置为 true 的效果相同:

如果为 true,服务器会自动代理任何未被应用程序处理的消息。如果为 false,则删除消息,并且在应用程序执行顺序中跟随此应用程序的应用程序将不会收到它。默认值是true。

作为旁注,您可以使用 compilespl.exe,它是 Lync Server SDK 的一部分,以验证您的 MSPL 脚本是否正确,然后再尝试在 lync 服务器上启动它。

在“单独编译 MSPL 应用程序”部分中查看此链接。

于 2015-02-12T20:12:59.653 回答