Translator Service

Introduction

The JSLEE Translator service is a general mechanism for translating between one message protocl and another. The major use case for this service in the JSLEE at the present time is Diameter (and in future Nchf) message translation to the OCS JSON format.

The JSLEE Translator is a relatively small engine driven by a rules engine defined in configuration to determine the way a message is translated between the source and the destination. This works in both ways - with incoming messages and the outgoing response.

Example

The following is a short excerpt of how the translator would match against an incoming Diameter message to pick up a voice call and begin translating that Diameter message into an OCS message:

{
    "name": "voice",
    "match": {
      "operation": "and",
      "expressions": [
        { "operation": "exists", "path": "Service-Information.IMS-Information" },
        { "operation": "not", "expressions": [ { "CC-Request-Type": 4 } ] }   // SMS requests contain IMS-Information too!
      ]
    },
    "destination": "ocs",
    "destination-event-type": "nz.co.nsquared.slee.ocs.OcsSleeApiRequest",
    "translations": [
      {
        "destination": "document_key.account",
        "source": "Subscription-Id.Subscription-Id-Data",
        "source-selector": { "Subscription-Id.Subscription-Id-Type": 2 },
        "transform": "nz.co.nsquared.slee.translator.transform.SipUriToE164Msisdn"
      },
      {
        "destination": "document_key.sessions",
        "source": "Session-Id",
        "transform": "nz.co.nsquared.slee.translator.transform.DiameterSessionIdToOcsSessionId"
      },
      ...
    ]     
}

In comparison to a general scripting language the JSLEE translator is constrained in many respects for performance. It will perform relatively complex translations, however those translations when necessary for performance will use core functions. Unlike a more general tool, there is no scripting support in the translator at the present time (a message would need to be transitioned through a script engine verticle for to achieve this).