NACChannel TPDU error

86 views
Skip to first unread message

Wainaina Njenga

unread,
Jan 20, 2023, 2:58:42 PM1/20/23
to jPOS Users
Hello Guys,

there seems to be an issue on the NACChannel tpdu header declaration from MUX level:
 <channel class="org.jpos.iso.channel.NACChannel" packager="fiba.jpos.Packagers.Packager" header="41344D3039303030">

will send TPDU as "A4T09000" instead of "A4M09000"

the TIC server at that point cannot receive the message

Alejandro Revilla

unread,
Jan 20, 2023, 3:01:05 PM1/20/23
to jpos-...@googlegroups.com
M doesn't sound like a valid hex digit to me.

--
@apr
> --
> --
> jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
> ---
> You received this message because you are subscribed to the Google Groups "jPOS Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/efb5f148-9c7f-48b8-866a-b7ec4f57a0b5n%40googlegroups.com.

Mark Salter

unread,
Jan 20, 2023, 3:35:20 PM1/20/23
to jpos-...@googlegroups.com
On 20/01/2023 10:01, Wainaina Njenga wrote:
> there seems to be an issue on the NACChannel tpdu header declaration
> from MUX level:
>  <channel class="org.jpos.iso.channel.NACChannel"
> packager="fiba.jpos.Packagers.Packager" header="41344D3039303030">
>
> will send TPDU as "A4T09000" instead of "A4M09000"

Where does this 'T' header come from?  What - if any - header is set on
your ISOMsg?


--

Mark


signature.asc

murtuza chhil

unread,
Jan 20, 2023, 9:46:56 PM1/20/23
to jPOS Users
You are passing a header in the channel.

<channel class="org.jpos.iso.channel.NACChannel" packager="fiba.jpos.Packagers.Packager" header="41344D3039303030"> <!-- A4M09000 , is the ascii equivalent -->

The jpos channel code uses 

ISOUtil.str2bcd("41344D3039303030", false) which results in A4M09000 being changed to A4T09000.

I would think for flexibility we may want to use hex2byte (pad the string appropriately prior to the call) instead of str2Bcd.

-chhil




Alejandro Revilla

unread,
Jan 23, 2023, 5:48:24 PM1/23/23
to jpos-...@googlegroups.com
> I would think for flexibility we may want to use hex2byte (pad the string appropriately prior to the call) instead of str2Bcd.

Agreed. I created an issue so we don't forget: https://github.com/jpos/jPOS/issues/510




--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

Wainaina Njenga

unread,
Jan 24, 2023, 7:04:04 AM1/24/23
to jPOS Users
Yes it is not valid but its what the header in TIC Tranzware Online uses 

Andrés Alcarraz

unread,
Jan 24, 2023, 7:06:52 AM1/24/23
to jPOS Users
I wonder ho\ do you send an M in an nibble, that only can represent just 16 different values 

Enviado desde mi móvil, disculpas por la brevedad

Wainaina Njenga

unread,
Jan 24, 2023, 7:07:39 AM1/24/23
to jPOS Users
I was able to recreate the issue using a client and here is the scenario:


            NACChannel channel = new NACChannel("localhost", 1111, new Packager(), "".getBytes() );
            channel.setHeader("41344d3039303030");

Andrés Alcarraz

unread,
Jan 24, 2023, 7:10:24 AM1/24/23
to jPOS Users
Sorry, it's not a nibble, but a byte


Enviado desde mi móvil, disculpas por la brevedad

Wainaina Njenga

unread,
Jan 24, 2023, 7:11:07 AM1/24/23
to jPOS Users
How would I do this in the channel xml file

chhil

unread,
Jan 24, 2023, 8:59:11 AM1/24/23
to jpos-...@googlegroups.com

import org.jpos.iso.ISOUtil;

import org.jpos.iso.channel.NACChannel;


public class MyChannel extends NACChannel {

    

  

    public void setHeader (String header) {

        super.setHeader (ISOUtil.hex2byte(header));

    }


}


Configure your deploy file to use MyChannel. (Its not tested but it should work for sending messages).


-chhil


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to a topic in the Google Groups "jPOS Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jpos-users/bT8osYnhtyg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/00448e7e-508a-4ba2-8d20-b8a670236bc6n%40googlegroups.com.

murtuza chhil

unread,
Jan 24, 2023, 8:02:39 PM1/24/23
to jPOS Users


Please post queries to the group, so anyone can respond to it, and everyone can learn. I don't respond to private emails.

> Advice best to do it in the channel xml since the letter 'M' clearly with this conversion is almost like recompiling JPOS jar, but something to note all other channels are not doing this
> Like ASCII does it well only thing is that I cannot use if since the length data type will violate TIC structure

Any real applications that are written with jpos will have java code that needs to be compiled to work with jpos. 
Extending a class is different from changing something inside jpos core code which would require building jpos. You are not rebuilding jpos.
If you have your classpath setup with jpos libraries, you will be fine. If you really want to get into understanding jpos, use the libraries, attach the source code, and step through it.
People must extend channels a lot of the time as not everything is available out of the box.
People must write jpos qbeans (deploy files + java code) to do anything meaningful.


-chhil

Wainaina Njenga

unread,
Jan 25, 2023, 12:04:03 AM1/25/23
to jPOS Users
Let me try My channel option also
Reply all
Reply to author
Forward
0 new messages