jsPduDecoder icon indicating copy to clipboard operation
jsPduDecoder copied to clipboard

Nodejs module (WIP)

Open apla opened this issue 6 years ago • 1 comments

Hi, I've copied pdu decoder to separate file for use as nodejs module. I'm planning to make additional machine readable interface with two verboseness levels, add some tests.

Please do not merge this now, it is still some work to do.

You can check current state with interface comparison by running node test/001-basic.js:

[ '(hideable)SMSC number\t79037011111',
  '(hideable)SMSC number info\tInternational number, ISDN/telephone numbering plan (E.164/E.163)',
  '(hideable)PDU Type\tSMS-DELIVER, Flags: TP-UDHI (User data header indicator), TP-MMS (More messages to send)',
  '(hideable)Number\tMCHS',
  '(hideable)Number info\tAlphanumeric, (coded according to GSM TS 03.38 7-bit default alphabet), Unknown numbering plan',
  '(hideable)Protocol Identifier\tSME-to-SME protocol',
  '(hideable)Data Coding Scheme\tGeneral Data Coding groups, uncompressed, UCS2 (16 bit),  no message class set (but given bits would be: Class 0 - immediate display)',
  '(hideable)Service Centre Time Stamp\t2017-08-24 18:14:43 GMT +3',
  'User Data Length\t69.5 characters, 139 bytes',
  'User Data Header Length\t6 bytes',
  'User Data Header\tConcatenated message: 16bit reference number 2789, part 1 of 3 parts',
  'User Data\tНа основании прогноза ФГБУ «Центральное УГМС» 24 августа в Москве ' ]

vs

{
	"SMSC": {
		"number": "79037011111",
		"ToA": {
			"ToN": 16,
			"NPI": 1,
			"info": "International number, ISDN/telephone numbering plan (E.164/E.163)"
		}
	},
	"ToM": {
		"type": "deliver",
		"TP_UDHI": true,
		"TP_VPF": null,
		"flags": [
			"TP-UDHI (User data header indicator)",
			"TP-MMS (More messages to send)"
		],
		"info": "SMS-DELIVER, Flags: TP-UDHI (User data header indicator), TP-MMS (More messages to send)"
	},
	"address": {
		"number": "MCHS",
		"ToA": {
			"ToN": 80,
			"NPI": 0,
			"info": "Alphanumeric, (coded according to GSM TS 03.38 7-bit default alphabet), Unknown numbering plan"
		}
	},
	"PID": "SME-to-SME protocol",
	"DCS": {
		"alphabet": "ucs2",
		"info": "General Data Coding groups, uncompressed, UCS2 (16 bit),  no message class set (but given bits would be: Class 0 - immediate display)"
	},
	"SCTS": "2017-08-24 18:14:43 GMT +3",
	"UDH": {
		"wap": false,
		"formatting": [],
		"info": "Concatenated message: 16bit reference number 2789, part 1 of 3 parts",
		"IEs": [
			{
				"IEI": 8,
				"IEDL": 4,
				"IED": [
					10,
					229,
					3,
					1
				]
			}
		],
		"parts": {
			"ref": 2789,
			"part": 1,
			"total": 3
		}
	},
	"UD": "На основании прогноза ФГБУ «Центральное УГМС» 24 августа в Москве "
}

apla avatar Mar 05 '18 09:03 apla

Ok. I like, where this is heading!

When you think you're done, please send a pull request resp. comment again, here!

tladesignz avatar Mar 09 '18 11:03 tladesignz