From d4698e7b484d6d686dbed4abc252aa800d0a35e5 Mon Sep 17 00:00:00 2001 From: Dennis Grunert Date: Thu, 18 Jan 2024 21:46:16 +0100 Subject: [PATCH] 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 --- src/libmisdnuser/suppserv/fac.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/libmisdnuser/suppserv/fac.c b/src/libmisdnuser/suppserv/fac.c index c528f44..6e19955 100644 --- a/src/libmisdnuser/suppserv/fac.c +++ b/src/libmisdnuser/suppserv/fac.c @@ -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