farhadi / node-smpp

SMPP client and server implementation in node.js
MIT License
421 stars 181 forks source link

error on send pdu #233

Open parsibox opened 1 year ago

parsibox commented 1 year ago

hi i get error on sending this pdu

        var pdu = new smpp.PDU( Buffer.from('0000008f000000050000000000000263313030380001013938393336363830373337300000013430343031303036363630300040000000000000080052050003f3020206310645000a063406450627063106470020062a0644064106460020062b0628062a0020062f06310020063306cc0633062a0645002006f006f906f306f906f306f306f906f306f906f506f1' , 'hex'));
        session.send(pdu)

node:buffer:559 throw new ERR_INVALID_ARG_TYPE( ^

TypeError [ERR_INVALID_ARG_TYPE]: The "list[0]" argument must be an instance of Buffer or Uint8Array. Received an instance of Array at new NodeError (node:internal/errors:371:5) at Object.concat (node:buffer:559:13) at PDU.encode (D:\wamp64\www\product\SmppClient\node_modules\smpp\lib\defs.js:545:17) at PDU._filter (D:\wamp64\www\product\SmppClient\node_modules\smpp\lib\pdu.js:144:41) at PDU.toBuffer (D:\wamp64\www\product\SmppClient\node_modules\smpp\lib\pdu.js:177:7) at Session.send (D:\wamp64\www\product\SmppClient\node_modules\smpp\lib\smpp.js:247:19) at Session. (D:\wamp64\www\product\SmppClient\project-test\fake_server.js:37:11) at Session.emit (node:events:390:28) at Session._extractPDUs (D:\wamp64\www\product\SmppClient\node_modules\smpp\lib\smpp.js:206:8) at Socket. (D:\wamp64\www\product\SmppClient\node_modules\smpp\lib\smpp.js:93:8) { code: 'ERR_INVALID_ARG_TYPE'

elhananjair commented 1 year ago

@parsibox as the log implies you are using an instance of Array as a parameter instead of Buffer or Uint8Array. Is the snippet you sent at 37:11 on your source code?

parsibox commented 1 year ago

it is a real packet i do not create it myself

dotsinspace commented 7 months ago

@parsibox did you found out the solution ?

parsibox commented 7 months ago

@parsibox did you found out the solution ?

no