Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example workflow with the PSI agent

An example for the Analysis agent can be as follows:

Code Block
languagetext
themeEclipse
consume {            
    if (instanceOf(input, Diameter.RequestCycleUDR)) {
        Diameter.RequestCycleUDR diameterUDR = (Diameter.RequestCycleUDR )input;
        Credit_Control_Request ccr = (Credit_Control_Request)diameterUDR.Request;
        // Create and populate PSI.ApplyTariffRequest
        PSI.ApplyTariffRequest applyTariffReq = udrCreate(PSI.ApplyTariffRequest);
        applyTariffReq.originatingCallerId =  ccr.Subscription_Id.Subscription_Id_Data;
        applyTariffReq.terminatingSubscriberMSCAddress = "10.0.17.42";
        applyTariffReq.subscriberType = 1;
        applyTariffReq.bearerCapability = "2";
        applyTariffReq.discount = "0";
        // etc ...
        // Create and populate PSICycleUDR                
        PSI.PSICycleUDR cycle = udrCreate(PSI.PSICycleUDR);
        cycle.context = ccr;
        cycle.reqUDR = applyTariffReq;
        udrRoute(cycle,"to_psi");
    } else if (instanceOf(input, PSI.PSICycleUDR)) {
        // Create and route Credit_Control_Answer
        udrRoute(createCCA((PSI.PSICycleUDR)input), "to_diameter");
        // Create transactionId ack
        PSI.PSICycleUDR cycle = (PSI.PSICycleUDR)input;
         if (cycle.hasErrors) {
            for (int i=0; i < listSize(cycle.errors); i++) {
                string error = listGet(cycle.errors, i);   
                // handle errors
                debug(error);
            }
        } else {
            if (instanceOf(cycle.respUDR, PSI.ApplyTariffResponse)) {
                PSI.TransactionIdAcknowledge trIdAck = udrCreate(PSI.TransactionIdAcknowledge);
                trIdAck.statusId = 0;
                cycle.ackUDR = trIdAck;
                udrRoute(cycle, "to_psi");
            }
        }
    }
}


Scroll ignore
scroll-viewportfalse
scroll-pdftrue
scroll-officefalse
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmlfalse


Next:



Scroll pagebreak