juks / iso-8583-socket-queue

ISO 8583 gateway
MIT License
194 stars 111 forks source link

use socket as client only #43

Closed scalpovich closed 4 years ago

scalpovich commented 4 years ago

Hi Juks, I want to know if i neeed some custom thingd to use SQ as client rather than host in order to connect to another ISO host Or send an iso message through SQ from http client to an ISO host. In this case, SQ will be serve as SWITCH

juks commented 4 years ago

Hi!

No you do not need any custom thing. The client part is already implemented into the application.

scalpovich commented 4 years ago

Hi juks Thank you for your feedback I want to use SQ as client to connect to an iso host with fix header (length + fixheader +message) To résume the host target has some specifications like : Send sign on to host each first connections and after that others logics (key exchange and that part has been done by customizing some code in SQ in isopacket and logics / packager Now the issue is about received iso message from host SQ say faulty invalid message in red

juks commented 4 years ago

Hi!

The common message restrictions are defined here: https://github.com/juks/SocketQueue/blob/653ad6e888ebf6fb90399eaa4e8a216e103cbfda/lib/iso8583/lib/packager/smartVista.js#L24

And the test client source can be found in this file https://github.com/juks/SocketQueue/blob/master/lib/testSuite/lib/testClient.js

scalpovich commented 4 years ago

Hi, Thank you for this feedback. Kindly find below capture related to the problem encountered 1) obligatory fields in my custom packager '1804': [0, 1, 7, 11,12,24, 25,33 ,37,128], '1200': [0, 1, 3, 4, 7, 11, 12, 22, 24, 25, 41, 42, 49], '1100': [0, 1, 2, 3, 4, 5, 6 ,7, 11, 12, 22, 24, 41, 42, 49], '1420': [0, 1, 3, 4, 7, 11, 12, 22, 24, 25, 41, 42, 49] 2)

2019-08-26 09:27:10 - verbose: ISO SQ Host Sign on resquest

 [Sign on Request]

 Message Type Indicator [0].......................1804
 Bitmap [1].......................................82300180880000000000000000000001
 Transmission Date and Time [7]...................1908260927
 System Trace Audit Number [11]...................575070
 Time, Local Transaction [12].....................190826092710
 Function Code [24]...............................801
 Message reason code [25].........................0000
 Code identification de organisme initiateur [33].505290
 Retrieval Reference Number [37]..................021445444832
 MAC [128]........................................00000000

================================================================================================

(node:8284) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. 2019-08-26 09:27:15 - info: Got data from ISO-host (94b) 2019-08-26 09:27:15 - verbose: [0090ISO701000001814.0..............190826092757507019082609271006505290021445444...80000000000] 2019-08-26 09:27:15 - verbose: [30 30 39 30 49 53 4f 37 30 31 30 30 30 30 30 31 38 31 34 82 30 00 00 8a 00 00 00 00 00 00 00 00 00 00 01 31 39 30 38 32 36 30 39 32 37 35 37 35 30 37 30 31 39 30 38 32 36 30 39 32 37 31 30 30 36 35 30 35 32 39 30 30 32 31 34 34 35 34 34 34 00 00 00 38 30 30 30 30 30 30 30 30 30 30] 2019-08-26 09:27:15 - verbose: [] 2019-08-26 09:27:15 - info: ISO host: failed to parse ISO host iso8583 packet 2019-08-26 09:27:15 - verbose: Invalid message! 2019-08-26 09:27:15 - verbose: [NOE] 2019-08-26 09:27:15 - verbose: [1814.0..............190826092757507019082609271006505290021445444...80000000000] 2019-08-26 09:27:15 - info: Upstream error: ISO host sent data with no client connected! Ignoring...

ISO host says

 [ <faulty>]

 Message Type Indicator [0].......................1814
 Bitmap [1].......................................823000008A0000000000000000000001
 Transmission Date and Time [7]...................1908260927
 System Trace Audit Number [11]...................575070
 Time, Local Transaction [12].....................190826092710
 Code identification de organisme initiateur [33].505290
 Retrieval Reference Number [37]..................21445444
 Response code [39]...............................800
 MAC [128]........................................00000000

================================================================================================

Moreover, the testClient is not used in my project here. Juste the Upstream.js

juks commented 4 years ago

There must me some header misconfiguration, so you get no message.

The basic check the triggers "Invalid message!" notice is here https://github.com/juks/SocketQueue/blob/653ad6e888ebf6fb90399eaa4e8a216e103cbfda/lib/iso8583/lib/packager/smartVista.js#L313