Skip to content

Commit

Permalink
fix #264
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanth87 authored and vetss committed Nov 21, 2017
1 parent be2be89 commit dbdc1e1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@

package org.mobicents.protocols.ss7.map.api.errors;

import org.mobicents.protocols.ss7.map.api.MAPException;
import org.mobicents.protocols.ss7.map.api.primitives.MAPExtensionContainer;
import org.mobicents.protocols.ss7.map.api.smstpdu.SmsDeliverReportTpdu;


/**
*
Expand Down Expand Up @@ -65,4 +68,9 @@ public interface MAPErrorMessageSMDeliveryFailure extends MAPErrorMessage {
void setExtensionContainer(MAPExtensionContainer extensionContainer);

void setMapProtocolVersion(long mapProtocolVersion);

SmsDeliverReportTpdu getSmsDeliverReportTpdu() throws MAPException;

void setsmsDeliverReportTpdu(SmsDeliverReportTpdu tpdu) throws MAPException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
import org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessageSMDeliveryFailure;
import org.mobicents.protocols.ss7.map.api.errors.SMEnumeratedDeliveryFailureCause;
import org.mobicents.protocols.ss7.map.api.primitives.MAPExtensionContainer;
import org.mobicents.protocols.ss7.map.api.smstpdu.SmsDeliverReportTpdu;
import org.mobicents.protocols.ss7.map.primitives.MAPExtensionContainerImpl;
import org.mobicents.protocols.ss7.map.smstpdu.SmsDeliverReportTpduImpl;

/**
*
Expand Down Expand Up @@ -277,6 +279,25 @@ public void encodeData(AsnOutputStream aos) throws MAPException {
}
}

public SmsDeliverReportTpdu getSmsDeliverReportTpdu() throws MAPException {
SmsDeliverReportTpdu drTpdu = null;
//try to parse drTpdu
if (this.signalInfo != null) {
try {
drTpdu = new SmsDeliverReportTpduImpl(this.signalInfo, null);
} catch (MAPException me) {
throw new MAPException("Error decoding TPDU" + me.getMessage(), me);

}
}
return drTpdu;
}

public void setsmsDeliverReportTpdu(SmsDeliverReportTpdu tpdu) throws MAPException {
this.signalInfo = tpdu.encodeData();
}


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
Expand Down

0 comments on commit dbdc1e1

Please sign in to comment.