Fixed AOC-D unit information length; encoding of AOC-E information according to real traces

- Fix: AOC-D unit information length was set to 1 despite its actual length
 - Removed optional BillingID from AOC-E data
 - Cross-checked AOC-D and AOC-E IEs to other systems (Audiocodes Mediant 800; traces found in public sources)
 - Tested with ISDN TEs: Siemens Profiset 51, T-Concept P522, Philips SOPHO ErgoLine, sphairon NT1PLUS-split; K1297 ISDN protocol tester
This commit is contained in:
Dennis Grunert 2024-01-18 21:46:16 +01:00
parent 0074b495d6
commit d4698e7b48
1 changed files with 12 additions and 14 deletions

View File

@ -423,14 +423,14 @@ static int encodeAOCDChargingUnitOperation(__u8 * dest, const struct asn1_parm *
p[i++] = 0x02; // Operation Tag
p[i++] = 0x01; // Tag Length
p[i++] = Fac_AOCDChargingUnit; // Operation Value
p[i++] = 0x30;
p[i++] = 0x30; // specificChargingUnits
p[i++] = (0x09 + len); // Length
p[i++] = 0xa1; // APDU
p[i++] = (0x04 + len); // Length
p[i++] = 0x30;
p[i++] = (0x02 + len);
p[i++] = 0x02; // Operation Tag
p[i++] = 0x01;
p[i++] = 0x30; // recordedUnits
p[i++] = (0x02 + len); // Length
p[i++] = 0x02; // recordedNumberOfUnits
p[i++] = len;
// Recorded units could take up as much as 3 bytes (0xFFFFFF)
p[i] = numberOfUnits & 0xFF;
@ -441,10 +441,10 @@ static int encodeAOCDChargingUnitOperation(__u8 * dest, const struct asn1_parm *
i += len;
p[i++] = 0x82; // Type of charging info
p[i++] = 0x01;
p[i++] = 0x01; // Length
p[i++] = 0x00; // AOC-D so Sub-Total
p[1] = (AOCD_CHARGE_UNIT_IE_LENGTH + len); // IE Payload Length
p[1] = i - 2; // IE Payload Length
p[4] = p[1] - 3; // Invoke Component Length
result = p[1] + 2; // Total Length of IE
}
@ -482,11 +482,13 @@ static int encodeAOCEChargingUnitOperation(__u8 * dest, const struct asn1_parm *
p[i++] = 0x01; // Tag Length
p[i++] = Fac_AOCEChargingUnit; // Operation Value
p[i++] = 0x30; // ChargingUnitInfo
p[i++] = (0x0b + len); // Length
p[i++] = (0x08 + len); // Length
p[i++] = 0x30; // specificChargingUnits
p[i++] = (0x09 + len); // Length
p[i++] = (0x06 + len); // Length
p[i++] = 0xa1; // Constructor
p[i++] = (0x04 + len); // Length
p[i++] = 0x30; // recordedUnits
p[i++] = (0x02 + len);
p[i++] = (0x02 + len); // Length
p[i++] = 0x02; // recordedNumberOfUnits
p[i++] = len;
@ -498,10 +500,6 @@ static int encodeAOCEChargingUnitOperation(__u8 * dest, const struct asn1_parm *
p[i+2] = (numberOfUnits >> 16) & 0xFF;
i += len;
p[i++] = 0x82; // AOCEBillingId
p[i++] = 0x01; // Length
p[i++] = 0x00; // normalCharging
p[1] = i - 2; // IE Payload Length
p[4] = p[1] - 3; // Invoke Component Length