Wrong format ID

Hello,

We have a problem with some devices in GenieACS : the ID created by the ACS contains URL encoded characters because the Product class and serial number used contains special characters ("." and “-”).

image

We cannot find the ID when we are using the API since there is already URL encoded characters in the name.

Is there a way to fix this problem when creating the ID for the devices (decode the special characters ?

Thank you and have a nice day !

Same here, the device-id contains a dot “.”, which is then url-encoded into %2e.

Example

Y.0520360024 → Y%2E0520360024

The Device itself sends the ID without encoding

    <soap_env:Body>
      <cwmp:Inform>
        <DeviceId>
          <Manufacturer>Genexis B.V.</Manufacturer>
          <OUI>000F94</OUI>
          <ProductClass>Panther</ProductClass>
          <SerialNumber>Y.0520360024</SerialNumber>
        </DeviceId>

Genieacs converts it to the urlencoded variant when receiving the message

event: incoming HTTP request
timestamp: 2021-11-29T08:38:08.361Z
remoteAddress: "::ffff:xxxx"
deviceId: 000F94-Panther-Y%2E0520360024
connection: 2021-11-29T08:38:08.355Z
localPort: 7547
method: POST
url: /

Why is the ID encoded at all ? Just for navigating in the UI (the Device-URL is built from the ID) ? Wouldn’t it be better to encode/decode the ID in the UI only ?

GenieACS v1.2.8

It seems like the UI is doing it’s job ok, but since the ID has already been encoded it ist of not much use.

It uses the encodeURIComponent - Method for building links (e.g. genieacs/devices-page.ts at 3c55306e225a4a1dd9aa5fcfeaa3d08a7c084323 · genieacs/genieacs · GitHub)

Escaping happens in the generateDeviceId Method

@zaidka : Is there a reason why only alphanumerics and underscores are excluded from escaping ? Is it possible to add more characters, like the dot or the hyphen ?

I think this is because, genieacs uses - to separate between OUI-Product Class-Serial number.
So this is a very simple solution to make sure, that no - is in the wrong position. For using that parameter in other software, especially within URLs, is a bit more complicated to program.

I am currently encoding the whole ID-String in Base64 within my API’s to make my life easy.
I am using AVM FRITZ!Box Devices, which is also encoded funny, because of the ! inside the Product Class.