Trying to implement CB2A

1,980 views
Skip to first unread message

Matthias Droste

unread,
Nov 24, 2011, 7:51:52 AM11/24/11
to jPOS Users
Hi,
I'm trying to get the French flavor of ISO running.
Alas, they have one pecularity: Before each ISO-message you have to
send a handshake-message on the same TCP-socket. This handshake
message does not have the ISO-fields or bitmaps, it's basically just
some 20 bytes of hello-information.
So the interaction-sequence for two requests would look like this:
Request1a:"hello" -> Response1a:"Ok" -> Request1b:0100ISO ->
Response1b:0110ISO
Request2a:"hello" -> Response2a:"Ok" -> Request2b:0100ISO ->
Response2b:0110ISO

Does anybody have an idea how this could be represented in the jpos-
framework? I couldn't find anything that would support handshaking
like that...

Thanks,
Matthias

Alejandro Revilla

unread,
Nov 24, 2011, 9:36:40 AM11/24/11
to jpos-...@googlegroups.com
Hi Matthias,

I'm sorry for you, CB2A and CBCOM are insane, it's a protocol on top of an older protocol on top of an older protocol. That thing should have been simplified now that things like TCP/IP exist. I see that all the time, people sending STX-ETX-LRC with ACKs and NAKs over TCP/IP and things like that drives me crazy, but CBCOM tops all that, their session management is like a door into a world of the past. And that's nothing, wait until you get to implement CB2A settlement...

You will probably have to create a channel (you can extend BaseChannel). In my case, the 'sendMessageLength' method has been replace like this:

    protected void sendMessageLength(int len) throws IOException {
        // if (!cbcomLinkEstablished) 
        initLink();

        serverOut.write (0);
        serverOut.write (0);
        serverOut.write (len >> 8);
        serverOut.write (len);
    }

And initLink looks like this:

    private void initLink() throws IOException {
        byte[] c2Header = ISOUtil.hex2byte (getConfiguration().get ("cbcom-c2-header"));
        serverOut.write (0);
        serverOut.write (0);
        serverOut.write (c2Header.length >> 8);
        serverOut.write (c2Header.length );
        serverOut.write (c2Header);
        serverOut.flush();
        try {
            int responseLength = getMessageLength();
            byte[] b = new byte[responseLength];
            serverIn.readFully (b, 0, responseLength);
            LogEvent evt = new LogEvent (this, "cbcom-handshake");
            evt.addMessage ("<req>" + ISOUtil.hexString(c2Header) + "</req>");
            evt.addMessage ("<resp>" + ISOUtil.hexString (b) + "</resp>");
            Logger.log (evt);
            cbcomLinkEstablished = true;
        } catch (ISOException e) {
            throw new IOException (e);
        }
    }

Hope this helps. 


--
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  "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users

Matthias Droste

unread,
Nov 24, 2011, 11:41:06 AM11/24/11
to jPOS Users
Hi Alejandro,

great, yes, thanks, that really helped a lot!

However, one thing in your response made me thinking: You say "wait


until you get to implement CB2A settlement..."

Well, actually I'm already playing around with that, but I haven't
even considered using jPOS(server) for that.

My way would have been:
As the single lines in the settlement-file are ISO-Messages, I would
generate them with the support of ISOMsg and helpers like ISODate.
But then my idea is to just assemble these file-parts with my own code
and send the result also by using my own code.

I would choose this "manual" way as I don't see how jPOS could help
for messages consisting of batches of ISO messages.
Do you perhaps have a better idea?

Thanks,
Matthias

> > Please seehttp://jpos.org/wiki/JPOS_Mailing_List_Readme_first

Alejandro Revilla

unread,
Nov 24, 2011, 12:17:30 PM11/24/11
to jpos-...@googlegroups.com

I would choose this "manual" way as I don't see how jPOS could help
for messages consisting of batches of ISO messages.
Do you perhaps have a better idea?

We use a similar approach, there's a jPOS service (could be something else) that iterates over our TranLog table and creates the CB2AF settlement files. It uses ISOMsg and the packager to output the inner messages.


damien.grandemange

unread,
Dec 23, 2011, 12:00:10 PM12/23/11
to jPOS Users
Hi,

Here is a tiny implementation of CBCOM in a jPos channel. It may be
useful for test purposes. Enjoy.
https://github.com/dgrandemange/tinyCbCom4jPos

Alejandro Revilla

unread,
Dec 23, 2011, 12:36:12 PM12/23/11
to jpos-...@googlegroups.com
Great! I wish I had this one year ago when working with CBCOM and CB2A ... :) - Will take a look at your implementation, certainly better than ours due to our lack of understanding of French (BTW, the spec is sooooo verbose...)

--
@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  "jPOS Users" group.

damien.grandemange

unread,
Dec 24, 2011, 12:14:48 PM12/24/11
to jPOS Users
Well, i wish have this same need one year ago, but at that time, i was
thinking "well, i surely won't have to deal with CBCOM again". And
then, 3 weeks ago, "hé we have some 15 years old C code that do
CBCOM, and we have to migrate from X25 to full IP, and you are the
chosen one !". What a lucky guy i am ...

Anyway, my implmeentaiton is fthe currrent CBCOMChannel does not yet
fit well in a "client" mode. But its design may allow it. I know how
to dit it, but didn't have yet the need nor the time to implement it.
May be next week (or next year ...)

And yes, the specs

On 23 déc, 18:36, Alejandro Revilla <a...@jpos.org> wrote:
> Great! I wish I had this one year ago when working with CBCOM and CB2A ...
> :) - Will take a look at your implementation, certainly better than ours
> due to our lack of understanding of French (BTW, the spec is sooooo
> verbose...)
>
> --
> @apr <http://twitter.com/apr>
>
> On Fri, Dec 23, 2011 at 15:00, damien.grandemange <
>
> damien.grandema...@gmail.com> wrote:
> > Hi,
>
> > Here is a tiny implementation of CBCOM in a jPos channel. It may be
> > useful for test purposes. Enjoy.
> >https://github.com/dgrandemange/tinyCbCom4jPos
>
> > On 24 nov, 18:17, Alejandro Revilla <a...@jpos.org> wrote:
> > > > I would choose this "manual" way as I don't see how jPOS could help
> > > > for messages consisting of batches of ISO messages.
> > > > Do you perhaps have a better idea?
>
> > > > We use a similar approach, there's a jPOS service (could be something
>
> > > else) that iterates over our TranLog table and creates the CB2AF
> > settlement
> > > files. It uses ISOMsg and the packager to output the inner messages.
>
> > --
> > 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 "jPOS Users"
> > group.
> > Please seehttp://jpos.org/wiki/JPOS_Mailing_List_Readme_first

damien.grandemange

unread,
Dec 24, 2011, 12:20:01 PM12/24/11
to jPOS Users
... specs are really something. The french exception in all its glory.

Merry christmas by the way.

On 24 déc, 18:14, "damien.grandemange" <damien.grandema...@gmail.com>
wrote:

Alejandro Revilla

unread,
Dec 25, 2011, 6:15:30 PM12/25/11
to jpos-...@googlegroups.com
Yes, the specs are insanely verbose and the CBCOM protocol is kind of archaic to say the least ...

Merry Christmas!

--
@apr



damien.grandemange

unread,
Jan 2, 2012, 11:22:23 AM1/2/12
to jPOS Users
Hi again ... and happy new year!

Now, i worked hard last week on my CBCOM channel implementation try.
Eventually, it is now able to operate for both client and server
needs.
Besides, most of the CBCOM timers are now implemented. (expect TMA :
activity maintain thanks to 0800 echo is not implemented for now).
Also, a dummy cbcom server along a dummy cbcom client are both
provided as two distinct jPos modules.
Wiki doc has been consequently updated.
Hope it helps some time :)

On 26 déc 2011, 00:15, Alejandro Revilla <a...@jpos.org> wrote:
> Yes, the specs are insanely verbose and the CBCOM protocol is kind of
> archaic to say the least ...
>
> Merry Christmas!
>
> --
> @apr <http://twitter.com/apr>
> >http://groups.google.com/group/jpos-users- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

Alejandro Revilla

unread,
Jan 2, 2012, 11:40:31 AM1/2/12
to jpos-...@googlegroups.com
Excellent! Happy new year to you too!

BTW, please note that you can replace code like this:

                String strMinTsi = cfg.get("TSI-timer-min", "120");
                timerCfg.setMinTsi(Integer.parseInt(strMinTsi));

using cfg.getInt("TSI-timer-min", 120);

--
@apr




Nicolas Vacelet

unread,
Sep 10, 2013, 6:00:28 AM9/10/13
to jpos-...@googlegroups.com, matthia...@googlemail.com
Hi,

I am new in the Banking sector.
I can't find CB2A specification on internet. Does it exists a PDF file I can download for free ?
Or maybe can you send me it ?

Thank you

Mark Salter

unread,
Sep 10, 2013, 8:02:16 AM9/10/13
to jpos-...@googlegroups.com, matthia...@googlemail.com

On Tuesday, September 10, 2013 11:00:28 AM UTC+1, Nicolas Vacelet wrote:
I am new in the Banking sector.
I can't find CB2A specification on internet. Does it exists a PDF file I can download for free ?
You should probably determine and approach the owners of the specification?  I'm sure they will be able to provide something to you.
 
Or maybe can you send me it ?
Get real please.

The specification is almost certainly under a copyright, owned and controlled by the owners of it.  Please don't ask people to breach copyright laws; on this mailing list at least!

--
Mark

Mark Salter

unread,
Sep 10, 2013, 6:18:39 PM9/10/13
to jpos-...@googlegroups.com
On 10/09/2013 14:31, Nicolas Vacelet wrote:
> Ok no problem.
> I was just looking for some informations.
> Thanks

Hmmm
--
Mark

Francis Andre

unread,
May 26, 2015, 11:48:29 AM5/26/15
to jpos-...@googlegroups.com
Hi Alejandro

I think you had overhelmed the CB2A CBCom protocols. The SYN-ENQ-ACK-STX-ETX-ETB-LRC-EOT are specified in the Annex C of the ISO-8583-1 specifications. Sure in the 2003 version,it is  informative, but the initial point is there. Explanation for keeping those is quite simple: the X25 transport service and protocol have been replaced by TCP/IP  but the applications above the transport layer as ISO 8583 did not change. So companies just bring on board a simple X25/TCP adaptator, keeping the intial applications identical.

Fa

Alejandro Revilla

unread,
May 26, 2015, 12:03:12 PM5/26/15
to jPOS Users
I liked X.25 a lot, and its cousin AX.25 that I used a lot, but we are in century XXI now... at some point we'll have to forget about that old handshake.



--
--
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 "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
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/a30c6a55-50a1-4c3b-a3e1-0b4b12f11155%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages