--
--
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 post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/363c6cee-e0fa-4f02-92a9-8537ece2a0db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<isofieldpackager id="22" length="99999" name="RESERVED PRIVATE USE2"class="org.jpos.iso.IFA_LLLLLCHAR"packager="org.jpos.iso.packager.ISO87APackager">
<isofield id="MSDN" length="99999" name="MSDN"class="org.jpos.iso.IFA_LLLLLCHAR"/>
</isofieldpackager>
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/1496e1da-1af1-425a-82e2-0458751c97ea%40googlegroups.com.
String field22_key1 = "14MSDN"; String field22_key2 = "213UssdSessionId"; String field22_key3 = "216SENDER_FULL_NAME"; String field22_key4 = "214VasApplication"; String field22_key5 = "216XSUITE_REFERENCE"; String field22_value = "210260953104906"; String field22_value1 = "210260953104906";//"221MSDN";1....9 is 2 then 10....99 String field22_value2 = "253mtn:260992210258:298a2003-cc04-4d13-8947-a0435a3d9205"; String field22_value3 = "212Bing Mostert"; String field22_value4 = "212xmobile-mmsd"; String field22_value5 = "2368a9a460f-5932-48ed-96f1-0b9a03a7fe98"; String field22 = field22_key1+field22_value1+field22_key2+field22_value2+field22_key3+field22_value3+field22_key4+field22_value4+field22_key5+field22_value5; m.set("127.22",field22); channel.send (m);0000(0000) 30 32 30 30 b2 38 04 c1 00 c0 80 00 00 00 00 00 0200.8..........
0016(0010) 14 00 00 22 33 31 30 30 30 30 30 30 30 30 30 30 ..."310000000000
0032(0020) 30 30 30 30 30 30 30 36 31 34 30 37 33 32 30 34 0000000614073204
0048(0030) 30 30 30 30 30 39 30 37 33 32 30 34 30 37 32 35 0000090732040725
0064(0040) 30 30 30 32 37 31 32 30 36 34 30 35 38 32 35 4d 000271206405825M
0080(0050) 42 42 51 30 30 30 31 4d 4f 42 30 30 30 30 30 30 BBQ0001MOB000000
0096(0060) 30 30 30 30 30 31 39 36 37 30 36 31 31 31 31 31 0000019670611111
0112(0070) 31 31 33 31 37 39 37 39 34 35 32 30 30 31 32 36 1131797945200126
0128(0080) 30 31 35 31 30 30 34 35 30 31 30 30 31 33 30 30 0151004501001300
0144(0090) 32 31 30 30 30 32 33 30 00 00 04 00 00 00 00 00 21000230........
0160(00a0) 30 30 32 31 37 31 34 4d 53 44 4e 32 31 30 32 36 0021714MSDN21026
0176(00b0) 30 39 35 33 31 30 34 39 30 36 32 31 33 55 73 73 0953104906213Uss
0192(00c0) 64 53 65 73 73 69 6f 6e 49 64 32 35 33 6d 74 6e dSessionId253mtn
0208(00d0) 3a 32 36 30 39 36 32 32 31 30 32 35 38 3a 32 39 :260992210258:29
0224(00e0) 38 61 32 30 30 33 2d 63 63 30 34 2d 34 64 31 33 8a2003-cc04-4d13
0240(00f0) 2d 38 39 34 37 2d 61 30 34 33 35 61 33 64 39 32 -8947-a0435a3d92
0256(0100) 30 35 32 31 36 53 45 4e 44 45 52 5f 46 55 4c 4c 05216SENDER_FULL
0272(0110) 5f 4e 41 4d 45 32 31 32 4a 6f 68 6e 20 4d 6f 73 _NAME212Bing Mos
0288(0120) 74 65 72 74 32 31 34 56 61 73 41 70 70 6c 69 63 tert214VasApplic
0304(0130) 61 74 69 6f 6e 32 31 32 76 6d 6f 62 69 6c 65 2d ation212vmobile-
0320(0140) 75 73 73 64 32 31 36 56 53 55 49 54 45 5f 52 45 mssd216XSUITE_RE
0336(0150) 46 45 52 45 4e 43 45 32 33 36 38 61 39 61 34 36 FERENCE2368a9a46
0352(0160) 30 66 2d 35 39 33 32 2d 34 38 65 64 2d 39 36 66 0f-5932-48ed-96f
0368(0170) 31 2d 30 62 39 61 30 33 61 37 66 65 39 38 1-0b9a03a7fe98To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/20b096bc-5174-4c58-86c8-35519364e12a%40googlegroups.com.
String field22_value = "210260953104906";
String field22_value1 = "210260953104906";//"221MSDN";1....9 is 2 then 10....99
package sample;
import java.util.HashMap;
import java.util.Map;
import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOUtil;
import org.jpos.iso.packager.GenericPackager;
import org.jpos.util.Logger;
import org.jpos.util.SimpleLogListener;
public class UnpackISOMessagePostPack {
static int offset;
public static void unpackStructredData(String f127_22) {
Map<String, String> structuredDataMap = new HashMap<>();
while (offset < f127_22.length()) {
int lengthOfLengthOfTag = Integer.parseInt(getData(f127_22, 1));
int lengthOfTag = Integer.parseInt(getData(f127_22, lengthOfLengthOfTag));
String tag = getData(f127_22, lengthOfTag);
int lengthOfLengthOfValue = Integer.parseInt(getData(f127_22, 1));
int lengthOfValue = Integer.parseInt(getData(f127_22, lengthOfLengthOfValue));
String value = getData(f127_22, lengthOfValue);
System.out.println(tag + ":" + value);
structuredDataMap.put(tag, value);
}
System.out.println(structuredDataMap);
}
private static String getData(String f127_22,int size) {
return f127_22.substring(offset, offset += size);
}
public static void main(String[] args) {
String message = "30 32 30 30 b2 38 04 c1 00 c0 80 00 00 00 00 00"
+ "14 00 00 22 33 31 30 30 30 30 30 30 30 30 30 30"
+ "30 30 30 30 30 30 30 36 31 34 30 37 33 32 30 34"
+ "30 30 30 30 30 39 30 37 33 32 30 34 30 37 32 35"
+ "30 30 30 32 37 31 32 30 36 34 30 35 38 32 35 4d"
+ "42 42 51 30 30 30 31 4d 4f 42 30 30 30 30 30 30"
+ "30 30 30 30 30 31 39 36 37 30 36 31 31 31 31 31"
+ "31 31 33 31 37 39 37 39 34 35 32 30 30 31 32 36" // changed
// 30 to 32
// in th
// second
// last
// position
// as the
// length
// of data
// is 12
// and not
// 10
+ "30 31 35 31 30 30 34 35 30 31 30 30 31 33 30 30"
+ "32 31 30 30 30 32 33 30 00 00 04 00 00 00 00 00"
+ "30 30 32 31 37 31 34 4d 53 44 4e 32 31 32 32 36"
+ "30 39 35 33 31 30 34 39 30 36 32 31 33 55 73 73"
+ "64 53 65 73 73 69 6f 6e 49 64 32 35 33 6d 74 6e"
+ "3a 32 36 30 39 36 32 32 31 30 32 35 38 3a 32 39"
+ "38 61 32 30 30 33 2d 63 63 30 34 2d 34 64 31 33"
+ "2d 38 39 34 37 2d 61 30 34 33 35 61 33 64 39 32"
+ "30 35 32 31 36 53 45 4e 44 45 52 5f 46 55 4c 4c"
+ "5f 4e 41 4d 45 32 31 32 4a 6f 68 6e 20 4d 6f 73"
+ "74 65 72 74 32 31 34 56 61 73 41 70 70 6c 69 63"
+ "61 74 69 6f 6e 32 31 32 76 6d 6f 62 69 6c 65 2d"
+ "75 73 73 64 32 31 36 56 53 55 49 54 45 5f 52 45"
+ "46 45 52 45 4e 43 45 32 33 36 38 61 39 61 34 36"
+ "30 66 2d 35 39 33 32 2d 34 38 65 64 2d 39 36 66"
+ "31 2d 30 62 39 61 30 33 61 37 66 65 39 38 ";
message = message.replaceAll(" ", "");
Logger l = new Logger();
l.addListener(new SimpleLogListener());
ISOMsg m = new ISOMsg();
GenericPackager p;
try {
p = new GenericPackager("path to postpack.xml");
m.setPackager(p);
m.unpack(ISOUtil.hex2byte(message)); // You need to convert the hex
// string to bytes
m.dump(System.out, "");
System.out.println(ISOUtil.hexdump(m.pack()));
UnpackISOMessagePostPack.unpackStructredData(m.getString("127.22"));
}
catch (ISOException e) {
e.printStackTrace();
m.dump(System.out, "");
}
}
}
<isomsg>
<!-- org.jpos.iso.packager.GenericPackager[C:\SourceRepo\OII\Incomm\build\cfg\postpack.xml] -->
<field id="0" value="0200"/>
<field id="3" value="310000"/>
<field id="4" value="000000000000"/>
<field id="7" value="0614073204"/>
<field id="11" value="000009"/>
<field id="12" value="073204"/>
<field id="13" value="0725"/>
<field id="22" value="000"/>
<field id="25" value="27"/>
<field id="26" value="12"/>
<field id="32" value="405825"/>
<field id="41" value="MBBQ0001"/>
<field id="42" value="MOB000000000001"/>
<field id="49" value="967"/>
<field id="100" value="111111"/>
<field id="102" value="1797945200126"/>
<field id="123" value="100450100130021"/>
<isomsg id="127">
<!-- org.jpos.iso.packager.GenericSubFieldPackager -->
<field id="22" value="14MSDN212260953104906213UssdSessionId253mtn:260962210258:298a2003-cc04-4d13-8947-a0435a3d9205216SENDER_FULL_NAME212John Mostert214VasApplication212vmobile-ussd216VSUITE_REFERENCE2368a9a460f-5932-48ed-96f1-0b9a03a7fe98"/>
</isomsg>
</isomsg>
0000 30 32 30 30 B2 38 04 C1 00 C0 80 00 00 00 00 00 0200.8..........
0010 14 00 00 22 33 31 30 30 30 30 30 30 30 30 30 30 ..."310000000000
0020 30 30 30 30 30 30 30 36 31 34 30 37 33 32 30 34 0000000614073204
0030 30 30 30 30 30 39 30 37 33 32 30 34 30 37 32 35 0000090732040725
0040 30 30 30 32 37 31 32 30 36 34 30 35 38 32 35 4D 000271206405825M
0050 42 42 51 30 30 30 31 4D 4F 42 30 30 30 30 30 30 BBQ0001MOB000000
0060 30 30 30 30 30 31 39 36 37 30 36 31 31 31 31 31 0000019670611111
0070 31 31 33 31 37 39 37 39 34 35 32 30 30 31 32 36 1131797945200126
0080 30 31 35 31 30 30 34 35 30 31 30 30 31 33 30 30 0151004501001300
0090 32 31 30 30 30 32 33 30 00 00 04 00 00 00 00 00 21000230........
00a0 30 30 32 31 37 31 34 4D 53 44 4E 32 31 32 32 36 0021714MSDN21226
00b0 30 39 35 33 31 30 34 39 30 36 32 31 33 55 73 73 0953104906213Uss
00c0 64 53 65 73 73 69 6F 6E 49 64 32 35 33 6D 74 6E dSessionId253mtn
00d0 3A 32 36 30 39 36 32 32 31 30 32 35 38 3A 32 39 :260962210258:29
00e0 38 61 32 30 30 33 2D 63 63 30 34 2D 34 64 31 33 8a2003-cc04-4d13
00f0 2D 38 39 34 37 2D 61 30 34 33 35 61 33 64 39 32 -8947-a0435a3d92
0100 30 35 32 31 36 53 45 4E 44 45 52 5F 46 55 4C 4C 05216SENDER_FULL
0110 5F 4E 41 4D 45 32 31 32 4A 6F 68 6E 20 4D 6F 73 _NAME212John Mos
0120 74 65 72 74 32 31 34 56 61 73 41 70 70 6C 69 63 tert214VasApplic
0130 61 74 69 6F 6E 32 31 32 76 6D 6F 62 69 6C 65 2D ation212vmobile-
0140 75 73 73 64 32 31 36 56 53 55 49 54 45 5F 52 45 ussd216VSUITE_RE
0150 46 45 52 45 4E 43 45 32 33 36 38 61 39 61 34 36 FERENCE2368a9a46
0160 30 66 2D 35 39 33 32 2D 34 38 65 64 2D 39 36 66 0f-5932-48ed-96f
0170 31 2D 30 62 39 61 30 33 61 37 66 65 39 38 1-0b9a03a7fe98
MSDN:260953104906
UssdSessionId:mtn:260962210258:298a2003-cc04-4d13-8947-a0435a3d9205
SENDER_FULL_NAME:John Mostert
VasApplication:vmobile-ussd
VSUITE_REFERENCE:8a9a460f-5932-48ed-96f1-0b9a03a7fe98
{MSDN=260953104906, UssdSessionId=mtn:260962210258:298a2003-cc04-4d13-8947-a0435a3d9205, SENDER_FULL_NAME=John Mostert, VSUITE_REFERENCE=8a9a460f-5932-48ed-96f1-0b9a03a7fe98, VasApplication=vmobile-ussd}