1

我创建 mspl 以将呼叫重新路由到 ucma 应用程序端点

下面是我的 MSPL 代码

<?xml version="1.0" ?>
<lc:applicationManifest
appUri="http://"Domain NAme"/AltRGS"
xmlns:lc="http://schemas.microsoft.com/lcs/2006/05">
<lc:allowRegistrationBeforeUserServices action="true" />
<lc:requestFilter methodNames="INVITE"
strictRoute="false"
registrarGenerated="true"
domainSupported="true" />
<lc:responseFilter reasonCodes="NONE" />
<lc:proxyByDefault action="true" />
<lc:scriptOnly />
<lc:splScript><![CDATA[


  fromUri = GetUri( sipRequest.From );
  fromUser = Concatenate( GetUserName( fromUri ) );
  toUri = GetUri( sipRequest.To );
  toUserAtHost = Concatenate( GetUserName( toUri ), "@", GetHostName( toUri ) );

   foreach ( sessionExpires in GetHeaderValues( "Session-Expires" ) ) {
       if ( ContainsString( sessionExpires, "refresher", true ) ) {
           Log( "Debug", false, "RespondWithRinging: * skipped; This is a session refreshing invite" );
           return;
       }
   }

   foreach ( userAgent in GetHeaderValues( "USER-AGENT" ) ) {
       if ( ! ContainsString( userAgent, "mediation", true ) ) {
           Log( "Debug", false, "RespondWithRinging: * skipped; not a mediation server request" );
           return;
       }
   }

   if (sipRequest && sipRequest.Method == "INVITE")

{
     ProxyRequest("sip:lync1.sti.ksac.com@ksac.com;gruu;opaque=srvr:app1:nKftzU4ORVGCO9Nqq3-m3QAA");
 }
 else {
    // Forward the call to the UCMA app.
    Log("Debugr", 1, "Forwarded caller to UCMA app: ", sipRequest.From);
    Respond("302", "Moved Temporarily", "Contact=");
  }

]]>

</lc:splScript>

</lc:applicationManifest>

我通过使用 power shell New-Csserver 应用程序注册了我的 MSPl

我的 C# 代码是

private void Run()
    {
        try
        {
            _helper = new UCMASampleHelper();

          _appEndpoint = _helper.CreateAutoProvisionedApplicationEndpoint();
            _appEndpoint.RegisterForIncomingCall<AudioVideoCall>(AudioVideoCall_Received);

 void AudioVideoCall_Received(object sender, CallReceivedEventArgs<AudioVideoCall> e)
    {
        try
        {
            string _originalRecipientUri = e.RequestData.To Header.Uri;



 _inboundAVCall.StateChanged += new EventHandler<CallStateChangedEventArgs>_inboundAVCall_StateChanged);
 _inboundAVCall.AudioVideoFlowConfigurationRequested += new EventHandler<AudioVideoFlowConfigurationRequestedEventArgs>(_inboundAVCall_AudioVideoFlowConfigurationRequested);

            Console.WriteLine("Call Received!");

 _inboundAVCall.BeginAccept(BeginAcceptCB, _inboundAVCall);

}}

当我接到呼叫时,MSPL 将呼叫路由到 UCMA 应用程序并转移到代理,但是当代理接受呼叫时,它没有建立,并且我在 ocs 记录器中找到以下错误

SIP/2.0 481 呼叫段/事务不退出

谁能帮帮我吗

谢谢。

4

0 回答 0