Skip to content

Commit

Permalink
Merge branch 'smsc_39_merge'
Browse files Browse the repository at this point in the history
  • Loading branch information
vetss committed Jul 25, 2017
2 parents 4360679 + 507acf0 commit 0f4e574
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
<reviseSecondsOnSmscStart value="60"/>
<processingSmsSetTimeout value="600"/>
<generateReceiptCdr value="false"/>
<generateDetailedCdr value="true"/>
<generateTempFailureCdr value="true"/>
<generateRejectionCdr value="true"/>
<calculateMsgPartsLenCdr value="false"/>
<delayParametersInCdr value="false"/>
<receiptsDisabling value="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,15 @@ protected void endDeliveryAfterValidityPeriod(Sms sms, ProcessingType processing

EsmeManagement esmeManagement = EsmeManagement.getInstance();
if (esmeManagement != null) {
Esme esme = esmeManagement.getEsmeByClusterName(smsSet.getDestClusterName());
String messageType = esme.getSmppSessionType() == Type.CLIENT ? CdrDetailedGenerator.CDR_MSG_TYPE_SUBMITSM
: CdrDetailedGenerator.CDR_MSG_TYPE_DELIVERSM;
Esme esme = null;
if (smsSet.getDestClusterName() != null) {
esme = esmeManagement.getEsmeByClusterName(smsSet.getDestClusterName());
}
String messageType = null;
if (esme != null) {
messageType = esme.getSmppSessionType() == Type.CLIENT ? CdrDetailedGenerator.CDR_MSG_TYPE_SUBMITSM
: CdrDetailedGenerator.CDR_MSG_TYPE_DELIVERSM;
}
this.generateDetailedCDRs(lstPermFailured, EventType.VALIDITY_PERIOD_TIMEOUT, smStatus, messageType,
esme.getRemoteAddressAndPort(), -1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1509,8 +1509,15 @@ public void updateRuleParameters(String parametersString) throws Exception {
this.setDropOnArrival(val);
success = true;
} else if (command.equals("rejectonarrival")) {
RejectType rejectOnArrival = RejectType.parse(value);
this.setRejectOnArrival(rejectOnArrival);
if (value != null && value.equals("-1")) {
this.setRejectOnArrival(null);
} else {
RejectType rejectOnArrival = RejectType.parse(value);
if (rejectOnArrival.equals(RejectType.NONE))
this.setRejectOnArrival(null);
else
this.setRejectOnArrival(rejectOnArrival);
}
success = true;
} else if (command.equals("newnetworkidaftersri")) {
int val = Integer.parseInt(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,99 @@ Error condition when invoking `sendMtSms()` from `onDialogReject()`::

Other::
Any other message that usually indicates some internal failure.

[[_monitoring_smsc_cdr_detailed_log]]
== Detailed CDR Log

{this-platform} {this-application} is configured to generate detailed CDR logs in a plain text file located at [path]_{this-folder}-smscgateway-<version>/jboss-5.1.0.GA/server/<profile>/log/cdr_detailed.log_.
Detailed CDR generated in the text file is of the below format:
----
CDR recording timestamp,Event type,ErrorCode (status),MessageType,Status code,CorrelationId,OrigCorrelationId,DlrStatus,mprocRuleId,ESME name,Timestamp A,Timestamp B,Timestamp C,Source IP,Source port,Dest IP,Dest port,Sequence Number,
----

NOTE: Detailed CDR once turned on, will only be generated for SMPP (IN and OUT) and HTTP (OUT only) messages.

.CDR recording timestamp
Time when CDR is created

.Event type
Event types can be of two categories - `IN` and `OUT`:
`IN` event types (a result of message receiving). Only SMPP and HTTP events of this type will be recorded in detailed log.

`IN_SMPP_RECEIVED`:: a message is accepted from SMPP connector and is processed without error.
`IN_SMPP_REJECT_FORBIDDEN`:: SMPP message is rejected for administrative reasons. For example, SMSC is stopped or paused, Cassandra database is not available, all messages from SMPP connector or specific ESME are forbidden.
`IN_SMPP_REJECT_CONG`:: SMPP message is rejected for a following reason: congestion at SMSC GW level or customer's limitation.
`IN_SMPP_REJECT_DIAMETER`:: SMPP message is rejected for a reason: rejection by a diameter server.
`IN_SMPP_REJECT_MPROC`:: SMPP message is rejected for a reason: rejection by mproc rules.
`IN_SMPP_DROP_MPROC`:: SMPP message is dropped (OK result was sent to a sender but message was dropped) for a reason: drop by mproc rules
`IN_SMPP_ERROR`:: SMPP message processing failed for other reasons.

`IN_HTTP_RECEIVED`:: a message is accepted from HTTP connector and is processed without error.
`IN_HTTP_REJECT_FORBIDDEN`:: HTTP message is rejected for administrative reasons, such as SMSC is stopped or paused, Cassandra database is not available, all messages from HTTP connector are forbidden.
`IN_HTTP_REJECT_CONG`:: HTTP message is rejected for a reason: congestion at SMSC GW level or due to a customer's limitation.
`IN_HTTP_REJECT_DIAMETER`:: HTTP message is rejected for a reason: rejection by a diameter server.
`IN_HTTP_REJECT_MPROC`:: HTTP message is rejected for a reason: rejection by mproc rules.
`IN_HTTP_DROP_MPROC`:: HTTP message is dropped (OK result was sent to a sender but a message is dropped) for a reason: rejection by mproc rules.
`IN_HTTP_ERROR`:: HTTP message processing failed for other reasons.

b. `OUT` event types (a result of message sending). Only SMPP events of this type will be recorded in detailed log.

`OUT_SMPP_SENT`:: SMPP message has been successfully sent.
`OUT_SMPP_REJECTED`:: received non zero SMPP response code after message was sent.
`OUT_SMPP_ERROR`:: error while sending SMPP message, for example, a channel error.
`OUT_SMPP_TIMEOUT`:: no response from a peer within time specified by SMSC GW settings. Possible reason might be because connection problems or peer malfunction, delivery timeout case included.
`VALIDITY_PERIOD_TIMEOUT`:: SMPP message has not been sent due to a validity period timeout.

.ErrorCode (status)
Internal SMSC GW delivery error code value.

.MessageType
Either `SubmitSm`, `SubmitMulti`, `DeliverSm` or `DataSm` for SMPP message and `Http` for HTTP message

.Status code:
a. For `OUT_SMPP_REJECTED` case: received non zero smpp response code when message sending, 0 for other cases)
b. In SMPP response value (for in_smpp_reject_* cases - sent non zero smpp response code when message receiving, 0 for other cases)
c. In HTTP response code (for in_http_reject_* cases - sent non zero http response code when a http response sending (code in the message body), 0 for other cases)

.CorrelationId
messageId of a message.

.OrigCorrelationId
messageId of an original message if this a recognized delivery response and an original message is found, otherwise -- empty value

.DlrStatus
If a message is recognized delivery response (DLR), then this field contains value of `stat` field of DLR, if it's not a delivery response otherwise empty if it is not a DLR. If a message is recognized DLR, but the field is not parsed or have different values in text and TLV parts, then this field is `"err"`.

.mprocRuleId
Id of an mproc rule which led to a message drop/reject in `IN_SMPP_REJECT_MPROC`, `IN_SMPP_DROP_MPROC`, `IN_HTTP_REJECT_MPROC` or `IN_HTTP_DROP_MPROC` cases, otherwise -- empty value.

.ESME name
Name of ESME through which a message has come to SMSC for an `IN` case or to which a message was sent from SMSC GW for an `OUT` case. This field will contain an empty value for other cases.

.Timestamp A
- `IN`: The time the message is successfully decoded
- `OUT`: The time the message is received for sending

.Timestamp B
- `IN`: timestamp taken immediately after sending response
- `OUT`: timestamp taken immediately after sending request

.Timestamp C
- `IN`: timestamp taken immediately after submission for further processing
- `OUT`: timestamp when message response is successfully decoded

.Source IP
IP of a source peer, if a value is available for a channel connection.

.Source port
Port from which message has come to SMSC GW if a value is available for a channel connection.

.Dest IP
IP of a destination peer, if a value is available for a channel connection.

.Dest port
Port to which message has been sent from SMSC GW if a value is available for a channel connection.

.Sequence Number
This value will be recorded for SMPP messages in both sending and receiving cases.
59 changes: 29 additions & 30 deletions management/ui-management/src/main/webapp/modules/mproc.html
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ <h3>Create Message Processing Rule</h3>
<span class="input-prepend" data-toggle="tooltip" data-placement="bottom" title="This action is performed at the step when message has arrived to the server. If value is NONE, no action will be performed. Otherwise message will be rejected without delivery attempt and reject response will be returned to a sender.">
<span class="add-on">Reject upon arrival to the server</span>
<select id="rejectonarrival" >
<option value=""></option>
<option value="NONE">NONE</option>
<option value="DEFAULT">DEFAULT</option>
<option value="UNEXPECTED_DATA_VALUE">UNEXPECTED_DATA_VALUE</option>
Expand Down Expand Up @@ -1297,36 +1296,36 @@ <h3>Create Message Processing Rule</h3>
'</tr>'+

'<tr data-toggle="tooltip" title="This action is performed at the step when message has arrived to the server. Message will be dropped without delivery attempt and success response will be returned to a sender.">'+
'<td style="font-size: 0.9em;">Drop upon arrival to the server</td>'+
'<td style="font-size: 0.9em; padding: 0;">'+
'<div id="div-' + id +'DropOnArrival-input" class="control-group">'+
'<span id="' + id +'DropOnArrival-input" style="display: none;">'+
'<input type="text" class="input-small" value="' + droponarrival + '" /> ' +
'<i class="icon-ok" style="cursor: pointer;" onclick="onModifyEsmeOk(\'' + id+ '\', \'droponarrival\', \'' + id+"DropOnArrival" + '\', \'true\')"></i> ' +
'<i class="icon-remove" style="cursor: pointer;" onclick="$(\'[id^='+id+"DropOnArrival"+']\').toggle(); $(\'input[id^='+id+"DropOnArrival"+']\').focus();"></i>' +
'</span>'+
'</div>' +
'<span id="' +id + 'DropOnArrival-text">' + dropaftersri + '</span>'+
'</td>'+
'<td><i class="icon-pencil" data-toggle="tooltip" title="Edit" style="cursor: pointer;" onclick="$(\'[id^='+id+"DropOnArrival"+']\').toggle(); $(\'input[id^='+id+"DropOnArrival"+']\').focus();"></i>' +
'</td>'+
'<td style="font-size: 0.9em;">Drop upon arrival to the server</td>'+
'<td style="font-size: 0.9em; padding: 0;">'+
'<div id="div-' + id +'DropOnArrival-input" class="control-group">'+
'<span id="' + id +'DropOnArrival-input" style="display: none;">'+
'<input type="text" class="input-small" value="' + droponarrival + '" /> ' +
'<i class="icon-ok" style="cursor: pointer;" onclick="onModifyEsmeOk(\'' + id+ '\', \'droponarrival\', \'' + id+"DropOnArrival" + '\', \'true\')"></i> ' +
'<i class="icon-remove" style="cursor: pointer;" onclick="$(\'[id^='+id+"DropOnArrival"+']\').toggle(); $(\'input[id^='+id+"DropOnArrival"+']\').focus();"></i>' +
'</span>'+
'</div>' +
'<span id="' +id + 'DropOnArrival-text">' + dropaftersri + '</span>'+
'</td>'+
'<td><i class="icon-pencil" data-toggle="tooltip" title="Edit" style="cursor: pointer;" onclick="$(\'[id^='+id+"DropOnArrival"+']\').toggle(); $(\'input[id^='+id+"DropOnArrival"+']\').focus();"></i>' +
'</td>'+
'</tr>'+

'<tr data-toggle="tooltip" title="This action is performed at the step when message has arrived to the server. If value is NONE, no action will be performed. Otherwise message will be rejected without delivery attempt and reject response will be returned to a sender.">'+
'<td style="font-size: 0.9em;">Reject upon arrival to the server</td>'+
'<td style="font-size: 0.9em; padding: 0;">'+
'<div id="div-' + id +'RejectOnArrival-input" class="control-group">'+
'<span id="' + id +'RejectOnArrival-input" style="display: none;">'+
'<input type="text" class="input-small" value="' + rejectonarrival + '" /> ' +
'<i class="icon-ok" style="cursor: pointer;" onclick="onModifyEsmeOk(\'' + id+ '\', \'rejectonarrival\', \'' + id+"RejectOnArrival" + '\', \'true\')"></i> ' +
'<i class="icon-remove" style="cursor: pointer;" onclick="$(\'[id^='+id+"RejectOnArrival"+']\').toggle(); $(\'input[id^='+id+"RejectOnArrival"+']\').focus();"></i>' +
'</span>'+
'</div>' +
'<span id="' +id + 'RejectOnArrival-text">' + rejectonarrival + '</span>'+
'</td>'+
'<td><i class="icon-pencil" data-toggle="tooltip" title="Edit" style="cursor: pointer;" onclick="$(\'[id^='+id+"RejectOnArrival"+']\').toggle(); $(\'input[id^='+id+"RejectOnArrival"+']\').focus();"></i>' +
'</td>'+
'</tr>'+
'<tr data-toggle="tooltip" title="This action is performed at the step when message has arrived to the server. Set this to -1 or leave blank to remove the action. If value is NONE, no action will be performed. Otherwise message will be rejected without delivery attempt and reject response will be returned to a sender. Valid values for rejectOnArrival are: &#13;NONE, &#13;DEFAULT, &#13;UNEXPECTED_DATA_VALUE, &#13;SYSTEM_FAILURE, &#13;THROTTLING, &#13;FACILITY_NOT_SUPPORTED">'+
'<td style="font-size: 0.9em;">Reject upon arrival to the server</td>'+
'<td style="font-size: 0.9em; padding: 0;">'+
'<div id="div-' + id +'RejectOnArrival-input" class="control-group">'+
'<span id="' + id +'RejectOnArrival-input" style="display: none;">'+
'<input type="text" class="input-small" value="' + rejectonarrival + '" /> ' +
'<i class="icon-ok" style="cursor: pointer;" onclick="onModifyEsmeOk(\'' + id+ '\', \'rejectonarrival\', \'' + id+"RejectOnArrival" + '\', \'true\')"></i> ' +
'<i class="icon-remove" style="cursor: pointer;" onclick="$(\'[id^='+id+"RejectOnArrival"+']\').toggle(); $(\'input[id^='+id+"RejectOnArrival"+']\').focus();"></i>' +
'</span>'+
'</div>' +
'<span id="' +id + 'RejectOnArrival-text">' + rejectonarrival + '</span>'+
'</td>'+
'<td><i class="icon-pencil" data-toggle="tooltip" title="Edit" style="cursor: pointer;" onclick="$(\'[id^='+id+"RejectOnArrival"+']\').toggle(); $(\'input[id^='+id+"RejectOnArrival"+']\').focus();"></i>' +
'</td>'+
'</tr>'+

'<tr data-toggle="tooltip" title="Once rule matches, the target SMS\'s optional parameter which matches the one set here will be removed. Set this to -1 to not remove any optional parameter. Default value is -1.">'+
'<td style="font-size: 0.9em;">Remove Tlv</td>'+
Expand Down Expand Up @@ -1771,7 +1770,7 @@ <h3>Create Message Processing Rule</h3>

e = document.getElementById("rejectonarrival");
var rejectonarrival = e.options[e.selectedIndex].value;
if(rejectonarrival == "") {
if (rejectonarrival == "" || rejectonarrival == "NONE") {
rejectonarrival = null;
} else {
parametersstring = parametersstring + " rejectonarrival "+rejectonarrival;
Expand Down

0 comments on commit 0f4e574

Please sign in to comment.