Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/smsc_43'
Browse files Browse the repository at this point in the history
  • Loading branch information
vetss committed Oct 23, 2017
2 parents 35a0bc7 + 1a0da22 commit b0c7aad
Show file tree
Hide file tree
Showing 19 changed files with 450 additions and 425 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ private String modifySip(String[] args) throws Exception {
* Command is mproc add factoryName <id> desttonmask <destination type of number> destnpimask <destination numbering plan
* indicator> destdigmask <regular expression - destination number digits mask> originatingmask <mo | hr | esme | sip>
* networkidmask <networkId value> percent <percent value> newnetworkid <new networkId value> newdestton <new destination
* type of number> newdestnpi <new destination numbering plan indicator> addestdigprefix <prefix> newmtgt <new gt for mt
* message> newmttt <new tt for mt message> makecopy <false | true> droponarrival <true | false> rejectonarrival <NONE |
* DEFAULT | UNEXPECTED_DATA_VALUE | SYSTEM_FAILURE | THROTTLING | FACILITY_NOT_SUPPORTED>
* type of number> newdestnpi <new destination numbering plan indicator> addestdigprefix <prefix> mtlocalsccpgt
* <new gt of a local sccp address of an mt message> mtremotesccptt <new tt for remote sccp address for mt message>
* makecopy <false | true> droponarrival <true | false> rejectonarrival <NONE | DEFAULT | UNEXPECTED_DATA_VALUE
* | SYSTEM_FAILURE | THROTTLING | FACILITY_NOT_SUPPORTED>
*
* @param args
* @return
Expand Down Expand Up @@ -223,8 +224,9 @@ private String assembleString(String[] args, int firstArg) {
* Command is mproc modify <id> desttonmask <destination type of number> destnpimask <destination numbering plan indicator>
* destdigmask <regular expression - destination number digits mask> originatingmask <mo | hr | esme | sip> networkidmask
* <networkId value> percent <percent value> newnetworkid <new networkId value> newdestton <new destination type of number>
* newdestnpi <new destination numbering plan indicator> addestdigprefix <prefix> newmtgt <new gt for mt message> newmttt
* <new tt for mt message> makecopy <false | true> droponarrival <true | false> rejectonarrival <NONE | DEFAULT |
* newdestnpi <new destination numbering plan indicator> addestdigprefix <prefix> mtlocalsccpgt
* <new gt of a local sccp address of an mt message> mtremotesccptt <new tt for remote sccp address for mt message>
* makecopy <false | true> droponarrival <true | false> rejectonarrival <NONE | DEFAULT |
* UNEXPECTED_DATA_VALUE | SYSTEM_FAILURE | THROTTLING | FACILITY_NOT_SUPPORTED>
*
* @param args
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,23 @@ public interface PostArrivalProcessor {
void updateMessageSourceAddr(MProcMessage message, String newDigits) throws MProcRuleException;

/**
* Updating GT that MT message will be sent to. In case of bad value MProcRuleException will be thrown
* Updating GT of a local SCCP address that MT message will be sent to. In case of bad value MProcRuleException will be thrown
*
* @param message
* @param newMtGt
* @param newMtLocalSccpGt
* @throws MProcRuleException
*/
void updateMessageMtGt(MProcMessage message, String newMtGt) throws MProcRuleException;
void updateMessageMtLocalSccpGt(MProcMessage message, String newMtLocalSccpGt) throws MProcRuleException;

/**
* Updating TT for MT message to specified value different from what SMSC has for this networkId. In case of bad value
* MProcRuleException will be thrown
* Updating TT of a remote SCCP address of an MT message to specified value different from what SMSC has for this networkId.
* In case of bad value MProcRuleException will be thrown.
*
* @param message
* @param newMtTt
* @param newMtRemoteSccpTt
* @throws MProcRuleException
*/
void updateMessageMtTt(MProcMessage message, int newMtTt) throws MProcRuleException;
void updateMessageMtRemoteSccpTt(MProcMessage message, Integer newMtRemoteSccpTt) throws MProcRuleException;

/**
* Updating of message text. Value must not be null and must have length 0-4300. In case of bad value MProcRuleException
Expand Down
12 changes: 7 additions & 5 deletions core/oam/cli/src/main/resources/help/smsc_mproc_add.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ SYNOPSIS
number> newdestnpi <new destination numbering plan indicator> adddestdigprefix <prefix
value> addsourcedigprefix <prefix value> newsourceton <new source type of number>
newsourcenpi <new source numbering plan indicator> newsourceaddr <new source address value>
newmtgt <new gt for mt message> newmttt <new tt for mt message> makecopy <false | true>
mtlocalsccpgt <new gt of a local sccp address of an mt message> mtremotesccptt
<new tt for remote sccp address for mt message> makecopy <false | true>
hrbypass <false | true> dropaftersri <false | true> newnetworkidaftersri <networkId value>
dropaftertempfail <false | true> newnetworkidaftertempfail <networkId value> droponarrival
<false | true> rejectonarrival <NONE | DEFAULT | UNEXPECTED_DATA_VALUE | SYSTEM_FAILURE
Expand Down Expand Up @@ -245,12 +246,13 @@ PARAMETERS
Default value is -1.
This action is for Arrival trigger.

newmtgt - Once rule matches, the target SMS's destination global title (GT) will be
changed to one set with this command. Set this to -1 to keep original GT. Default value is "-1".
mtlocalsccpgt - Once rule matches, the global title (GT) of local SCCP address will be changed for target
SMS to one set with this command. Set this to -1 to keep original GT. Default value is "-1".
This action is for Arrival trigger.

newmttt - Once rule matches, the target SMS's destination translation type (TT) will be
changed to one set with this command. Set this to -1 to keep original TT. Default value is -1.
mtremotesccptt - Once rule matches, the translation type (TT) of remote SCCP address will be changed
for target SMS to one set with this command. Set this to -1 to keep original TT.
Default value is -1.
This action is for Arrival trigger.

makecopy - Once rule match's, and makecopy is set to true, a new copy of SMS is created. If new
Expand Down
12 changes: 7 additions & 5 deletions core/oam/cli/src/main/resources/help/smsc_mproc_modify.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ SYNOPSIS
number> newdestnpi <new destination numbering plan indicator> adddestdigprefix <prefix
value> addsourcedigprefix <prefix value> newsourceton <new source type of number>
newsourcenpi <new source numbering plan indicator> newsourceaddr <new source address value>
newmtgt <new gt for mt message> newmttt <new tt for mt message> makecopy <false | true>
mtlocalsccpgt <new gt of a local sccp address of an mt message> mtremotesccptt
<new tt for remote sccp address for mt message> makecopy <false | true>
hrbypass <false | true> dropaftersri <false | true> newnetworkidaftersri
<networkId value> dropaftertempfail <false | true> newnetworkidaftertempfail <networkId
value> droponarrival <false | true> rejectonarrival <NONE | DEFAULT |
Expand Down Expand Up @@ -227,12 +228,13 @@ PARAMETERS
Default value is -1.
This action is for Arrival trigger.

newmtgt - Once rule matches, the target SMS's destination global title (GT) will be changed
to one set with this command. Set this to -1 to keep original GT. Default value is "-1".
mtlocalsccpgt - Once rule matches, the global title (GT) of local SCCP address will be changed for target
SMS to one set with this command. Set this to -1 to keep original GT. Default value is "-1".
This action is for Arrival trigger.

newmttt - Once rule matches, the target SMS's destination translation type (TT) will be changed
to one set with this command. Set this to -1 to keep original TT. Default value is -1.
mtremotesccptt - Once rule matches, the translation type (TT) of remote SCCP address will be changed
for target SMS to one set with this command. Set this to -1 to keep original TT.
Default value is -1.
This action is for Arrival trigger.

makecopy - Once rule match's, and makecopy is set to true, a new copy of SMS is created. If new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,19 +581,17 @@ protected SccpAddress getServiceCenterSccpAddress(int networkId) {
}
}

protected SccpAddress getServiceCenterSccpAddress(String mtGt, int mtTt, int networkId) {
if (mtGt == null) {
protected SccpAddress getServiceCenterSccpAddress(String mtLocalSccpGt, int networkId) {
if (mtLocalSccpGt == null) {
if (networkId == 0) {
mtGt = smscPropertiesManagement.getServiceCenterGt();
mtLocalSccpGt = smscPropertiesManagement.getServiceCenterGt();
} else {
mtGt = smscPropertiesManagement.getServiceCenterGt(networkId);
mtLocalSccpGt = smscPropertiesManagement.getServiceCenterGt(networkId);
}
}
if (mtTt == 0) {
mtTt = smscPropertiesManagement.getTranslationType();
}
return MessageUtil.getSccpAddress(sccpParameterFact, mtGt, AddressNature.international_number.getIndicator(), NumberingPlan.ISDN.getIndicator(),
smscPropertiesManagement.getServiceCenterSsn(), smscPropertiesManagement.getGlobalTitleIndicator(), mtTt);

return MessageUtil.getSccpAddress(sccpParameterFact, mtLocalSccpGt, AddressNature.international_number.getIndicator(), NumberingPlan.ISDN.getIndicator(),
smscPropertiesManagement.getServiceCenterSsn(), smscPropertiesManagement.getGlobalTitleIndicator(), smscPropertiesManagement.getTranslationType());
}

protected ISDNAddressString getCalledPartyISDNAddressString(String destinationAddress, int ton, int npi) {
Expand All @@ -602,8 +600,13 @@ protected ISDNAddressString getCalledPartyISDNAddressString(String destinationAd
}

protected SccpAddress convertAddressFieldToSCCPAddress(String address, int ton, int npi) {
return convertAddressFieldToSCCPAddress(address, ton, npi, null);
}

protected SccpAddress convertAddressFieldToSCCPAddress(String address, int ton, int npi, Integer mtRemoteSccpTt) {
return MessageUtil.getSccpAddress(sccpParameterFact, address, ton, npi, smscPropertiesManagement.getHlrSsn(),
smscPropertiesManagement.getGlobalTitleIndicator(), smscPropertiesManagement.getTranslationType());
smscPropertiesManagement.getGlobalTitleIndicator(), mtRemoteSccpTt != null ? mtRemoteSccpTt
: smscPropertiesManagement.getTranslationType());
}

protected MAPApplicationContext getSRIMAPApplicationContext(MAPApplicationContextVersion applicationContextVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -746,17 +746,19 @@ public void setupMtForwardShortMessageRequest(ISDNAddressString networkNode, Str
return;
}

SccpAddress networkNodeSccpAddress = this.getMSCSccpAddress(networkNode);
Sms sms0 = smsSet.getSms(0);
Integer mtRemoteSccpTt = sms0.getMtRemoteSccpTt();

SccpAddress networkNodeSccpAddress = this.getMSCSccpAddress(networkNode,mtRemoteSccpTt);

IMSI imsi = this.mapParameterFactory.createIMSI(imsiData);
SM_RP_DA sm_RP_DA = this.mapParameterFactory.createSM_RP_DA(imsi);
AddressString scAddress = this.getServiceCenterAddressString(networkId);
SM_RP_OA sm_RP_OA = this.mapParameterFactory.createSM_RP_OA_ServiceCentreAddressOA(scAddress);

Sms sms0 = smsSet.getSms(0);
if (sms0 != null)
sms0.setMtServiceCenterAddress(scAddress.getAddress()); // we only set it for first sms in the list

if (sms0 != null) {
sms0.setMtServiceCenterAddress(scAddress.getAddress()); // we only set it for first sms in the list
}

this.setNnn(networkNode);
this.setNetworkNode(networkNodeSccpAddress);
Expand Down Expand Up @@ -1061,19 +1063,18 @@ private void sendMtSms(MAPApplicationContext mapApplicationContext, MessageProce
if (mapDialogSms == null) {
newDialog = true;

String mtGt = sms.getMtGt();
int mtTt = sms.getMtTt();
String mtLocalSccpGt = sms.getMtLocalSccpGt();

SccpAddress sccpAddress;
SccpAddress originSccpAddress;

if (mtGt != null || mtTt != 0) {
sccpAddress = this.getServiceCenterSccpAddress(mtGt, mtTt, networkId);
if (mtLocalSccpGt != null) {
originSccpAddress = this.getServiceCenterSccpAddress(mtLocalSccpGt, networkId);
} else {
sccpAddress = this.getServiceCenterSccpAddress(networkId);
originSccpAddress = this.getServiceCenterSccpAddress(networkId);
}

mapDialogSms = this.mapProvider.getMAPServiceSms().createNewDialog(mapApplicationContext,
sccpAddress, null, this.getNetworkNode(), null);
originSccpAddress, null, this.getNetworkNode(), null);
mapDialogSms.setNetworkId(networkId);

ActivityContextInterface mtFOSmsDialogACI = this.mapAcif.getActivityContextInterface(mapDialogSms);
Expand Down Expand Up @@ -1239,10 +1240,10 @@ private MAPApplicationContext getMtFoSMSMAPApplicationContext(
}
}

private SccpAddress getMSCSccpAddress(ISDNAddressString networkNodeNumber) {
private SccpAddress getMSCSccpAddress(ISDNAddressString networkNodeNumber, Integer mtRemoteSccpTt) {
return MessageUtil.getSccpAddress(sccpParameterFact, networkNodeNumber.getAddress(), networkNodeNumber.getAddressNature().getIndicator(),
networkNodeNumber.getNumberingPlan().getIndicator(), smscPropertiesManagement.getMscSsn(), smscPropertiesManagement.getGlobalTitleIndicator(),
smscPropertiesManagement.getTranslationType());
mtRemoteSccpTt != null ? mtRemoteSccpTt : smscPropertiesManagement.getTranslationType());
}

private AddressField getSmsTpduOriginatingAddress(int ton, int npi, String address) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,14 @@ private void sendSRI(SmsSet smsSet, String destinationAddress, int ton, int npi,
// Send out SRI
MAPDialogSms mapDialogSms = null;
try {
Sms sms0 = smsSet.getSms(0);
Integer mtRemoteSccpTt = null;
if (sms0 != null) {
mtRemoteSccpTt = sms0.getMtRemoteSccpTt();
}
// 1. Create Dialog first and add the SRI request to it
mapDialogSms = this.setupRoutingInfoForSMRequestIndication(destinationAddress, ton, npi,
mapApplicationContext, smsSet.getNetworkId());
mapApplicationContext, smsSet.getNetworkId(), mtRemoteSccpTt);

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

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

String hlrAddress = destinationAddress;
String hrHlrNumber = smscPropertiesManagement.getHrHlrNumber(networkId);
if (hrHlrNumber != null && hrHlrNumber.length() > 0) {
hlrAddress = hrHlrNumber;
}
SccpAddress destinationAddr = this.convertAddressFieldToSCCPAddress(hlrAddress, ton, npi);
SccpAddress destinationAddr = this.convertAddressFieldToSCCPAddress(hlrAddress, ton, npi, newMtRemoteSccpTt);

MAPDialogSms mapDialogSms = this.mapProvider.getMAPServiceSms().createNewDialog(mapApplicationContext,
this.getServiceCenterSccpAddress(networkId), null, destinationAddr, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,16 @@ private static String getFirst20CharOfSMS(String first20CharOfSms) {
}

private static String getEscapedString(final String aValue) {
if (aValue == null) {
return CDR_EMPTY;
}
return aValue.replaceAll("\n", "n").replaceAll(",", " ").replace("\"", "'").replace('\u0000', '?').replace('\u0006', '?');
}

private static String getProcessingTime(final Date aSubmitDate) {
if (aSubmitDate == null) {
return CDR_EMPTY;
}
}
return String.valueOf(System.currentTimeMillis() - aSubmitDate.getTime());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,25 +237,25 @@ public void setSourceAddr(String sourceAddr) {
}

/**
* Global Title for MT message
* Global Title for local SCCP address for an MT message
*/
public String getMtGt() {
return extraData.getMtGt();
public String getMtLocalSccpGt() {
return extraData.getMtLocalSccpGt();
}

public void setMtGt(String mtGt) {
extraData.setMtGt(mtGt);
public void setMtLocalSccpGt(String mtLocalSccpGt) {
extraData.setMtLocalSccpGt(mtLocalSccpGt);
}

/**
* Translation Type MT message
* Translation Type of remote SCCP address of an MT message
*/
public int getMtTt() {
return extraData.getMtTt();
public Integer getMtRemoteSccpTt() {
return extraData.getMtRemoteSccpTt();
}

public void setMtTt(int mtTt) {
extraData.setMtTt(mtTt);
public void setMtRemoteSccpTt(Integer mtRemoteSccpTt) {
extraData.setMtRemoteSccpTt(mtRemoteSccpTt);
}

/**
Expand Down Expand Up @@ -749,6 +749,14 @@ public String toString() {
sb.append(", tlvSet=");
sb.append(this.tlvSet.toString());
}
if (this.extraData.getMtLocalSccpGt() != null) {
sb.append(", mtLocalSccpGt=");
sb.append(this.extraData.getMtLocalSccpGt());
}
if (this.extraData.getMtRemoteSccpTt() != null) {
sb.append(", mtRemoteSccpTt=");
sb.append(this.extraData.getMtRemoteSccpTt());
}

sb.append("]");

Expand Down

0 comments on commit b0c7aad

Please sign in to comment.