Open GoogleCodeExporter opened 9 years ago
Update:
Exception is thorwn, because additionalNumber is not primitive. It contains an
sgsn-number. Here is part of the tcp dump:
locationInfoWithLMSI
networkNode-Number: 917373499921f0
1... .... = Extension: No Extension
.001 .... = Nature of number: International Number (0x01)
.... 0001 = Number plan: ISDN/Telephony Numbering (Rec ITU-T E.164) (0x01)
Address digits: 37379499120
Country Code: 373 Moldova (Republic of) (length 3)
additional-Number: sgsn-Number (1)
sgsn-Number: 917373499950f0
1... .... = Extension: No Extension
.001 .... = Nature of number: International Number (0x01)
.... 0001 = Number plan: ISDN/Telephony Numbering (Rec ITU-T E.164) (0x01)
Address digits: 37379499050
Country Code: 373 Moldova (Republic of) (length 3)
As you can see additional-Number is constructed - not primitive.
I'll change in LocationInfoWithLMSIImpl.java:
case _TAG_AdditionalNumber:
if (!ais.isTagPrimitive() || this.additionalNumber != null){
throw new MAPParsingComponentException(
"Error when decoding LocationInfoWithLMSI: additionalNumber: double element or element is not primitive",
MAPParsingComponentExceptionReason.MistypedParameter);
}
to:
case _TAG_AdditionalNumber:
if (ais.isTagPrimitive() || this.additionalNumber != null){
throw new MAPParsingComponentException(
"Error when decoding LocationInfoWithLMSI: additionalNumber: double element or element is not primitive",
MAPParsingComponentExceptionReason.MistypedParameter);
}
and will perform tests.
Original comment by asimil...@gmail.com
on 17 Jan 2015 at 9:38
Tests are OK, but additional number is not decoded correctly:
additionalNumberType=msc,
additionalNumber=ISDNAddressString[AddressNature=unknown, NumberingPlan=ISDN,
Address=701937379499050
must be
additionalNumberType=sgsn,
additionalNumber=ISDNAddressString[AddressNature=international_number,
NumberingPlan=ISDN, Address=37379499050
Reason:
additionalNumber in LocationInfoWithLMSIImpl.java is defined as
ISDNAddressString, but I think it must be ArrayList<ISDNAddressString>.
Solution:
To create new interface, for example:
public interface AdditionalNumber extends Serializable {
ArrayList<ISDNAddressString> getAdditionalNumber ();
void setAdditionalNumber (ArrayList<ISDNAddressString> numbersList);
}
and implement it.
Original comment by asimil...@gmail.com
on 17 Jan 2015 at 10:16
Here is the solution:
AdditionalNumber is already implemented in
org.mobicents.protocols.ss7.map.api.service.lsm
Changes LocationInfoWithLMSIImpl.java:
1. Commented private AdditionalNumberType additionalNumberType;
2. Changed type of the additionalNumber to
org.mobicents.protocols.ss7.map.api.service.lsm.AdditionalNumber;
3. Changed constructor of the LocationInfoWithLMSIImpl.java
3. Changed decoding/encoding algorithms.
4. Changed all dependencies.
Recompiled JSS7
Performed tests. All OK
additionalNumber=AdditionalNumber
[sgsn-Number=ISDNAddressString[AddressNature=international_number,
NumberingPlan=ISDN, Address=37379499050]]]] - decoded correctly
Original comment by asimil...@gmail.com
on 17 Jan 2015 at 12:58
Attachments:
I think the code should be:
I think the code
- for decoding LocationInfoWithLMSIImpl._decode(...):
case _TAG_AdditionalNumber:
if (ais.isTagPrimitive() || this.additionalNumber != null)
throw new MAPParsingComponentException("Error when decoding " + _PrimitiveName
+ ": additionalNumber: double element or element is primitive", MAPParsingComponentExceptionReason.MistypedParameter);
AsnInputStream ais2 = ais.readSequenceStream();
ais2.readTag();
this.additionalNumber = new AdditionalNumberImpl();
((AdditionalNumberImpl) this.additionalNumber).decodeAll(ais2);
break;
- for encoding:
encodeData(...):
if (this.additionalNumber != null) {
asnOs.writeTag(Tag.CLASS_CONTEXT_SPECIFIC, false, _TAG_AdditionalNumber);
int pos = asnOs.StartContentDefiniteLength();
((AdditionalNumberImpl) this.additionalNumber).encodeAll(asnOs);
asnOs.FinalizeContent(pos);
}
Original comment by serg.vet...@gmail.com
on 22 Jan 2015 at 3:18
Hi Sergey,
Applied your recommendation. Compiled jss7 source. Performed test. Everything
is OK.
Original comment by asimil...@gmail.com
on 12 Feb 2015 at 7:42
Original issue reported on code.google.com by
asimil...@gmail.com
on 24 Dec 2014 at 7:31