Skip to content

Commit

Permalink
Use improved API to find SMPP interface version in bind response
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Thorvardarson committed Mar 3, 2012
1 parent acf331e commit edef6e3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions jsmpp/src/main/java/org/jsmpp/session/SMPPSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@
import org.jsmpp.bean.InterfaceVersion;
import org.jsmpp.bean.NumberingPlanIndicator;
import org.jsmpp.bean.OptionalParameter;
import org.jsmpp.bean.OptionalParameter.Byte;
import org.jsmpp.bean.OptionalParameter.Sc_interface_version;
import org.jsmpp.bean.QuerySmResp;
import org.jsmpp.bean.RegisteredDelivery;
import org.jsmpp.bean.ReplaceIfPresentFlag;
import org.jsmpp.bean.SubmitMultiResp;
import org.jsmpp.bean.SubmitMultiResult;
import org.jsmpp.bean.SubmitSmResp;
import org.jsmpp.bean.TypeOfNumber;
import org.jsmpp.bean.OptionalParameter.Tag;
import org.jsmpp.extra.NegativeResponseException;
import org.jsmpp.extra.PendingResponse;
import org.jsmpp.extra.ProcessRequestException;
Expand All @@ -63,7 +62,6 @@
import org.jsmpp.session.connection.ConnectionFactory;
import org.jsmpp.session.connection.socket.SocketConnectionFactory;
import org.jsmpp.util.DefaultComposer;
import org.jsmpp.util.HexUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -296,10 +294,9 @@ private String sendBind(BindType bindType, String systemId,
addrNpi, addressRange);

BindResp resp = (BindResp)executeSendCommand(task, timeout);
OptionalParameter.Byte sc_interface_version = (Byte) resp.getOptionalParameter(Tag.SC_INTERFACE_VERSION);
if(sc_interface_version != null) {
String sc_interface_version_hex = HexUtil.conventBytesToHexString(new byte[] {sc_interface_version.getValue()});
logger.info("Other side reports smpp interface version {}", sc_interface_version_hex);
OptionalParameter.Sc_interface_version sc_version = resp.getOptionalParameter(Sc_interface_version.class);
if(sc_version != null) {
logger.info("Other side reports smpp interface version {}", sc_version);
}

return resp.getSystemId();
Expand Down

0 comments on commit edef6e3

Please sign in to comment.