How to create a MSPL script to redirect calls to an UCMA app

288 views Asked by At

I’m writing a MSPL script to redirect all calls to my UCMA app. Sounds simple, but I can’t get it to work. And it also crashes my Skype 4 Business client when I try and make a call with the MSPL scripted installed

I’ve installed the MSPL script successfully using the New-CsServerApplication command, and the script compiles and installs with no errors. It’s defiantly a problem with the MSPL script.

I’ve looked on http://blog.greenl.ee/2011/09/04/rerouting-requests-ucma-application-mspl/ page for help, but still can’t get it to work.

When I make a call it just crashes my Skype 4 Business client.

I’ve pasted my script below

<?xml version="1.0" encoding="utf-8"?>
<r:applicationManifest appUri="http://www.example.com/recording" xmlns:r="http://schemas.microsoft.com/lcs/2006/05"> 
  <r:requestFilter methodNames="INVITE" strictRoute="true" registrarGenerated="true" domainSupported="true" />
  <r:proxyByDefault action="true" />
  <r:scriptOnly />
  <r:splScript><![CDATA[ 
    if (sipRequest && IndexOfString(sipRequest.Content, "m=audio") >= 0) {

        // Check to see if the call has been already forwarded
        if (ContainsString(sipRequest.From, "sip: [email protected]", true)) {
            // Allow the call to continue to its original destination.
            Log("Event", 1, "Allowed call to continue to its original destination");
            ProxyRequest();
        } else {
            // Forward the call to the UCMA app.
            Log("Event", 1, "Forwarded caller to UCMA app: ", sipRequest.From);
            Respond("302", "Moved Temporarily", "Contact=<sip:[email protected]>");
        } 
    }
]]></r:splScript>
</r:applicationManifest>

Can someone please show me a working MSPL script example that routes calls to a UCMA app?

Thank you

1

There are 1 answers

0
Shane Powell On

First of all I would highly recommend that you don't do this as you will most likely break a lot of call flows in weird & subtle ways that you may not notice for a long time.

You don't need to do a "Respond", you can just retarget to the new destination with the "RetargetRequest" function.

e.g. RetargetRequest("sip:[email protected]");