Skip to content

Commit

Permalink
issue #252: Adding processing of new local GT for SRI requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
olenara authored and vetss committed Oct 31, 2017
1 parent 66f24b8 commit cc5c84e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
Expand Up @@ -556,6 +556,35 @@ protected AddressString getServiceCenterAddressString(int networkId) {
org.mobicents.protocols.ss7.map.api.primitives.NumberingPlan.ISDN, smscPropertiesManagement.getServiceCenterGt(networkId));
}
}

/**
* TODO : This is repetitive in each Sbb. Find way to make it static
* probably?
*
* This is our own number. We are Service Center.
*
* @return
*/
protected AddressString getServiceCenterAddressString(String mtLocalSccpGt, int networkId) {
if (mtLocalSccpGt == null) {
if (networkId == 0) {
mtLocalSccpGt = smscPropertiesManagement.getServiceCenterGt();
} else {
mtLocalSccpGt = smscPropertiesManagement.getServiceCenterGt(networkId);
}
}

if (networkId == 0) {
if (this.serviceCenterAddress == null) {
this.serviceCenterAddress = this.mapParameterFactory.createAddressString(AddressNature.international_number,
org.mobicents.protocols.ss7.map.api.primitives.NumberingPlan.ISDN, mtLocalSccpGt);
}
return this.serviceCenterAddress;
} else {
return this.mapParameterFactory.createAddressString(AddressNature.international_number,
org.mobicents.protocols.ss7.map.api.primitives.NumberingPlan.ISDN, mtLocalSccpGt);
}
}

/**
* TODO: This should be configurable and static as well
Expand Down
Expand Up @@ -517,13 +517,15 @@ private void sendSRI(SmsSet smsSet, String destinationAddress, int ton, int npi,
MAPDialogSms mapDialogSms = null;
try {
Sms sms0 = smsSet.getSms(0);
String mtLocalSccpGt = null;
Integer mtRemoteSccpTt = null;
if (sms0 != null) {
mtLocalSccpGt = sms0.getMtLocalSccpGt();
mtRemoteSccpTt = sms0.getMtRemoteSccpTt();
}
// 1. Create Dialog first and add the SRI request to it
mapDialogSms = this.setupRoutingInfoForSMRequestIndication(destinationAddress, ton, npi,
mapApplicationContext, smsSet.getNetworkId(), mtRemoteSccpTt);
mapApplicationContext, smsSet.getNetworkId(), mtLocalSccpGt, mtRemoteSccpTt);

// 2. Create the ACI and attach this SBB
ActivityContextInterface sriDialogACI = this.mapAcif.getActivityContextInterface(mapDialogSms);
Expand All @@ -545,7 +547,7 @@ private void sendSRI(SmsSet smsSet, String destinationAddress, int ton, int npi,
}

private MAPDialogSms setupRoutingInfoForSMRequestIndication(String destinationAddress, int ton, int npi,
MAPApplicationContext mapApplicationContext, int networkId, Integer newMtRemoteSccpTt) throws MAPException {
MAPApplicationContext mapApplicationContext, int networkId, String newMtLocalSccpGt, Integer newMtRemoteSccpTt) throws MAPException {
// this.mapParameterFactory.creat

String hlrAddress = destinationAddress;
Expand All @@ -560,7 +562,7 @@ private MAPDialogSms setupRoutingInfoForSMRequestIndication(String destinationAd
mapDialogSms.setNetworkId(networkId);

ISDNAddressString isdn = this.getCalledPartyISDNAddressString(destinationAddress, ton, npi);
AddressString serviceCenterAddress = this.getServiceCenterAddressString(networkId);
AddressString serviceCenterAddress = this.getServiceCenterAddressString(newMtLocalSccpGt, networkId);
boolean sm_RP_PRI = true;
mapDialogSms.addSendRoutingInfoForSMRequest(isdn, sm_RP_PRI, serviceCenterAddress, null, false, null, null,
null);
Expand Down

0 comments on commit cc5c84e

Please sign in to comment.