Skip to content

Commit

Permalink
Merge branch 'develop' into feature/improved-esim-batch-management
Browse files Browse the repository at this point in the history
  • Loading branch information
la3lma authored Dec 18, 2019
2 parents 835729e + 28e3b8a commit 2deb3e8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.ostelco.diameter.model
import org.jdiameter.api.Avp
import org.ostelco.diameter.parser.AvpField
import java.net.InetAddress
import java.util.*

/**
* PS-Information ( Avp 874 )
Expand All @@ -18,7 +19,7 @@ class PsInformation {

// 3GPP-PDP-Type ( Avp 3 )
@AvpField(Avp.TGPP_PDP_TYPE)
var pdpType: ByteArray? = null
var pdpType: Int? = null

// PDP-Address ( Avp 1227 )
@AvpField(Avp.PDP_ADDRESS)
Expand Down
13 changes: 13 additions & 0 deletions ocs-grpc-api/src/main/proto/ocs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ enum ResultCode {
DIAMETER_RATING_FAILED = 5031;
}

// 3GPP-PDP-Type #: 29.061
enum PdpType {
IPV4 = 0;
PPP = 1;
IPV6 = 2;
IPV4V6 = 3;
NON_IP = 4;
UNSTRUCTURED = 5;
ETHERNET = 6;
}

message RedirectServer {
RedirectAddressType redirectAddressType = 1;
string redirectServerAddress = 2;
Expand Down Expand Up @@ -102,6 +113,8 @@ message PsInformation {
string sgsnMccMnc = 2;
string imsiMccMnc = 3;
bytes userLocationInfo = 4;
PdpType pdpType = 5;
bytes pdpAddress = 6;
}

message ServiceInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.ostelco.diameter.model.*;
import org.ostelco.ocs.api.CreditControlRequestInfo;
import org.ostelco.ocs.api.CreditControlRequestType;
import org.ostelco.ocs.api.PdpType;
import org.ostelco.ocs.api.PsInformation;
import org.ostelco.ocs.api.ServiceInfo;
import org.ostelco.ocsgw.datasource.protobuf.GrpcDataSource;
Expand Down Expand Up @@ -162,6 +163,12 @@ private static void addPsInformation(final CreditControlContext context, CreditC
if (psInformation.getUserLocationInfo() != null) {
psInformationBuilder.setUserLocationInfo(ByteString.copyFrom(psInformation.getUserLocationInfo()));
}
if (psInformation.getPdpType() != null) {
psInformationBuilder.setPdpType(PdpType.forNumber(psInformation.getPdpType()));
}
if (psInformation.getPdpAddress() != null) {
psInformationBuilder.setPdpAddress(ByteString.copyFrom(psInformation.getPdpAddress().getAddress()));
}
builder.setServiceInformation(ServiceInfo.newBuilder().setPsInformation(psInformationBuilder));
}
}
Expand Down

0 comments on commit 2deb3e8

Please sign in to comment.