futomi / node-sms-pdu

The node-sms-pdu is a SMS-SUBMIT PDU (Packet Data Unit) generator and SMS-SUBMIT/DELIVER PDU parser. This module supports the GSM 7-bit default alphabet encoding and the UCS-2 16-bit alphabet encoding. Besides, it supports the Concatenated (or Multipart or Long) SMS.
MIT License
16 stars 6 forks source link

Non-international OAs are not decoded #1

Closed ingria closed 3 years ago

ingria commented 4 years ago

Example:

0791448720003023240DD0E474D81C0EBB010000111011315214000BE474D81C0EBB5DE3771B

Parsed message looks like this:

{ smsc: '+447802000332',
  type: 'SMS-DELIVER',
  origination: '4e478dc1e0bb10',
  timestamp: '2011-01-11T13:25:41+00:00',
  concat: null,
  text: 'diafaan.com',
  details:
   { sca:
      { length: 8,
        digit: 12,
        international: true,
        address: '447802000332' },
     pduType:
      { rp: false, udhi: false, vpf: 0, mti: 0, srr: true, rd: true },
     oa:
      { length: 9,
        digit: 13,
        international: false,
        address: '4e478dc1e0bb10' },
     pid: 0,
     dcs: { compressed: false, mclass: -1, alphabet: 0 },
     scts: '2011-01-11T13:25:41+00:00',
     udl: 11,
     ud: { udh: null, text: 'diafaan.com' } } }

But the "origination" field should be:

origination: 'diafaan',
adhisimon commented 4 years ago

Looks this project has stale. If you can explain how to decode it, I can fork this project to create a patch for this.

futomi commented 4 years ago

I'm so sorry to be late. I had been too busy.

I thought that the origination should be a decimal digit sequence. Can it be a character string? Do you know where I can get any specification or tutorial to decode such character string origination?

Thank you.

ingria commented 4 years ago

Maybe this can help:

https://www.etsi.org/deliver/etsi_gts/03/0340/05.03.00_60/gsmts_0340v050300p.pdf

Originating address definition on page 47 says:

9.2.3.7 TP-Originating-Address (TP-OA) The TP-Originating-Address field is formatted according to the formatting rules of address fields.

Those formatting rules of address fields are described on page 32.

futomi commented 4 years ago

@ingria, thank you for the information. I'll try to implement the alphanumeric representation. Give me some time.

futomi commented 4 years ago

@ingria, I implemented the decode of OA alphanumeric representation. You can get the latest version from npm.

adhisimon commented 3 years ago

@futomi I confirmed your latest version has decode OA alphanumeric correctly.

PDU: 0791269846103829040BD033EA1B5E870300001210500103808295C9791A546787DD6750D54DAFAF4136192E579BC96C31D9CC36BB81E6F5F5BC3C77819AE17918145ED3D366D0FC4506CD602F18ED2583C96E2E50333C0F83E865F7F91C769F4133D80B567BC960B29B0B94749BDFA0797A1E06C1EBEC7918444E8354B1584C151B81C86137085E6E8BCBEC74D80D8287D7653A889C06A962B2996A3602

has decoded origination to: 3Topup

Thanks. I think you can close this issue

ingria commented 3 years ago

@futomi Thank you!

I cannot check if everything works right now, and not sure when I will. I think we can trust @adhisimon's tests and assume that everything is OK.