Restcomm CancelLocation MAPv2 декодирование - PullRequest
0 голосов
/ 18 февраля 2020

У меня проблема с декодированием буфера вызова для запроса Cancel-Location MAPv2. Декодирование не может декодировать параметр IMSI.

public static byte[] hexStringToByteArray(String src)
    {
        if(src.length() %2 == 1)
        {
            src += "f";
        }
        return DatatypeConverter.parseHexBinary(src);
    }

    @Test
    public void testCancelLoc() throws MAPParsingComponentException 
  {
       /* the below buffer contains the IMSI which is: 999920630452372  */
       byte[] cancelLoc = Common.hexStringToByteArray("99990236402573f2");
       /* I have also tried the buffer with adding 0x04 as a tag, and 0x08 as the length and also the IMSI not parsed */
       /* byte[] cancelLoc = Common.hexStringToByteArray("040899990236402573f2"); */
       CancelLocationRequestImpl impl = new CancelLocationRequestImpl(2);
       AsnInputStream ais = new AsnInputStream(cancelLoc);
       impl.decodeData(ais, cancelLoc.length);
       String imsi = impl.getImsi().getData();  // this will be empty
  }
...