Skip Headers
Oracle® Communications WebRTC Session Controller Extension Developer's Guide
Release 7.0

E40977-01
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

5 Using Policy Data in Messages

This chapter explains how Oracle Communications WebRTC Session Controller Signaling Engine (Signaling Engine) uses policy data from policy charging rule functions (PCRFs) to affect subscriber calls and profiles.

About Using Policy Control Data with Signaling Engine

Signaling Engine supports using its Groovy script translation capability to make policy (QoS) decisions by using the policy information contained in Diameter Rx interface messages. Signaling Engine acts as a Diameter application function (AF) by exchanging Diameter Rx messages with your policy control and charging rules function (PCRF) in a 3GPP architecture.

Signaling Engine supports sending AA Request (AAR) and Session Termination Request (STR) Diameter Rx messages from Signaling Engine to your PCRF, and using the data from AA Answer (AAA) and Session Termination Answer (STA) messages that it receives in return.

The Diameter Rx messages and their responses are frequently used with the pcrfFuture interface that enables you to delay processing until a later message arrives. Oracle expects that most implementations will send Diameter AAR requests and then delay the media session until they receive an AAA confirming that the subscriber is entitled to the service.

The AAR and AAA messages can be exchanged any time before a call's media stream, and the STR and STA messages are exchanged after the stream. So you can affect your PCRF and PCEF affect the subscriber profile before the media stream resources are used, update the subscriber's profile after the media stream resources have been consumed, or both.

See WebRTC Session Controller Statement of Conformance for the complete list of Diameter Rx commands and AVPs that Signaling Engine Supports.

Before the AAR and STR messages can be useful, you must configure your PCRF to accept and make policy decisions based on the AVPs that you send them. If your implementation requires it, you must also configure a PCEF to enforce those decisions.

Figure 5-1 shows an example call flow in which Signaling Engine exchanges messages with a PCRF both before and after the call's multimedia stream. Diameter Rx AAR, AAA, STR, and STA messages are shown in red in the call flow.

Figure 5-1 Signaling Engine Call Flow with PCRF Support

Description of Figure 5-1 follows
Description of "Figure 5-1 Signaling Engine Call Flow with PCRF Support"

Creating and Sending Diameter Rx Request messages

You use the createRxAAR and createRxSTR methods in the WscDiameterFactory interface of the oracle.wsc.feature.webrtc.template.diameter package to create AAR and STR messages. These methods accept a map of AVPs that you create, and adds them to a Diameter Rx message that your PCRF can parse. Your PCRF then accepts the AVPs and take whatever action that you have configured it.

These AVPs are automatically added to each outgoing request and need not be specified in a Groovy script:

  • Session-Id

  • Origin-Host

  • Origin-Realm

  • Auth-Application-Id

  • Destination-Realm

You must specify any other AVPs that your implementation requires in your Groovy scripts. See WebRTC Session Controller Conformance Statement for details on the AVPs supported.

This example defines an AAR message and specifically defines the AVPs used (for example: Subscription-Id, Subscription-Id-Type, and Subscription-Id-Data):

 def avps = [
      'Subscription-Id':[
        'Subscription-Id-Type':2, //END_USER_SIP_URI
        'Subscription-Id-Data':"bob@example.com"
      ],
      'Framed-IP-Address':[
        0x84,
        0x08,
        0x88,
        0x65] as byte[],
      'AF-Application-Identifier':"WSE".getBytes("utf-8"),
      'Media-Type':0, //Audio
      'AF-Charging-Identifier':'charing-id-55'.getBytes("utf-8"), //Audio
      'Media-Component-Description':[
        'Media-Component-Number':[0, 1],
        'Media-Sub-Component': [
          [
            'Flow-Number':1,
            'Flow-Description':'permit out 8001 from assigned 34 to 24.2.1.6/18 8000'
          ],
          [
            'Flow-Number':1,
            'Flow-Description':'permit out 8005 from assigned 36 to 24.2.1.6/18 8001'
          ]
        ],
        'Flow-Status':2
      ]
    ]
 
   def aar = context.diameterFactory.createRxAAR(avps) 

After creating a Diameter request message, you must explicitly send it using a send method call. send is a method in the WscDiameterRequest interface in the oracle.wsc.feature.webrtc.template.diameter package. This example sends an AAR message, and provides example success and error conditions:

def pcrfFuture = aar.send();
 
//success
context.getTaskBuilder("processSuccessFromPcrf").withArg("sipRequest",sipRequest)
       .withArg("pcrfFuture", pcrfFuture).onSuccess(pcrfFuture).build();
 
//error
context.getTaskBuilder("processErrorFromPcrf").withArg("sipRequest",sipRequest)
       .withArg("pcrfFuture", pcrfFuture).onError(pcrfFuture).build();

This example lists the pcrfSuccessHandler and pcrfErrorHandler methods that you would define to handle the success and failure conditions.

You use the methods in the PcrfFuture interface in the oracle.wscfeature.webrtc.template.diameter package to determine if any future objects are ready for use by your Groovy scripts. This interface extends the oracle.wsc.feature.webrtc.template.future interface.

This example checks the AVP values in the response to confirm that the subscriber bob@example.com uses a media type of 0.

def avps = context.taskArgs.pcrfFuture.get().getAvps()
 
if(avps.'Subscription-Id'?.'Subscription-Id-Data'=='bob@example.com"){
  //add logic here.
}else if(avps.'Media-Type'==0){
//provide alternative
}

Accepting and Using Diameter Rx Answer Messages

You use the getAvps, getCommandCode, and getResultCode methods in the WscDiameterResponse interface of the oracle.wscfeature.webrtc.template.diameter package to process the Diameter Rx AAA and STA messages returned by your PCRF. getCommandCode, returns the command code identifying the type of message (265 for AAR and AAA, and 275 for STR and STA). getResultCode returns the integer values for the Result-Code AVP. getAvps returns a map of all the AVPs in the AAA or STA message. You use this method in groovy scripts you create to obtain the data necessary to perform policy actions, and take those actions.