hello,
I have made some progress, mainly reading the specs (ETSI TS 100 942 and ETSI TS 124 011) and this site as well (
http://www.spallared.com/old_nokia/nokia/smspdu/smspdu.htm). Sadly I still have no luck with making a correct pdu to send to the mobile and I get 'rpdu: 04000161' (RP-ERROR Message type non-existent or not implemented).
There is one approach though I thought about: in our current implementation the mobile (MS) sends a binary sms (SMS-SUBMIT) to SMSC. Then using some javacript code (nodejs) I connect to yates and install listeners to catch when an MS is registered and the SMS that are exchanged:
var YATEBTS_EXTERNAL_MODULE_PORT = 5040;
var IP = "127.0.0.1";
var net = require('net');
var client = new net.Socket();
client.on('connect', function(){
// install listeners
client.write('%%>install:50:user.register\r\n');
client.write('%%>install:50:idle.execute\r\n');
client.write('%%>install:50:msg.execute\r\n');
});
cls.client.on('data', function onWatch(rawData) {
// show and parse the rawData ...
});
// connect to yates
client.connect(YATEBTS_EXTERNAL_MODULE_PORT, IP);
this way I see when an MS is registered and get some info (e.g. IMEI and IMSI) as well as messages sent from the MS to/from the SMSC. So I can see the following binary SMS that the MS sends to SMSC (all fields shown are as expected for the current setup):
----------------------------------->
25253e6d6573736167653a30783766316262386662356236302e313233303634373635343a313439363239383934313a6d73672e657865637574653a3a6d6f64756c653d796274733a726f7574655f747970653d6d73673a63616c6c65723d544d534930303762303030313a696d73693d3233343130313731333939363639313a746d73693d30303762303030313a696d65693d3335393236303036323338373030303a63616c6c65643d3638373737303030393a63616c6c65646e756d706c616e3d6973646e3a63616c6c65646e756d747970653d696e7465726e6174696f6e616c3a736d732e63616c6c65643d3132333435363738393a736d732e63616c6c65642e706c616e3d6973646e3a736d732e63616c6c65642e6e61747572653d6e6174696f6e616c3a727064753d303030393030303639313836373730373030663930663031373830396131323134333635383766393030303430333466346233653a7068795f696e666f3d54413d332054453d302e303030205570525353493d2d31342054785077723d3520446e5253534964426d3d2d39372074696d653d313439363239383933392e3335343a68616e646c6572733d6a617661736372697074257a31352c6364726275696c64257a35302c6a617661736372697074257a38303a63616c6c746f3d6e69625f736d7363
info: [yate-watchsms.js/log_debug] Thu Jun 01 2017 06:35:40 GMT+0000 (UTC) raw: %%>message:0x7f1bb8fb5b60.1230647654:1496298941:msg.execute::module=ybts:route_type=msg:caller=TMSI007b0001:imsi=234101713996691:tmsi=007b0001:imei=359260062387000:called=687770009:callednumplan=isdn:callednumtype=international:sms.called=123456789:sms.called.plan=isdn:sms.called.nature=national:rpdu=000900069186770700f90f017809a121436587f90004034f4b3e:phy_info=TA=3 TE=0.000 UpRSSI=-14 TxPwr=5 DnRSSIdBm=-97 time=1496298939.354:handlers=javascript%z15,cdrbuild%z50,javascript%z80:callto=nib_smsc
info: [yate-watchsms.js/log_debug] message: %%>message:0x7f1bb8fb5b60.1230647654:1496298941:msg.execute
info: [yate-watchsms.js/log_debug] fields: module=ybts,route_type=msg,caller=TMSI007b0001,imsi=234101713996691,tmsi=007b0001,imei=359260062387000,called=687770009,callednumplan=isdn,callednumtype=international,sms.called=123456789,sms.called.plan=isdn,sms.called.nature=national,rpdu=000900069186770700f90f017809a121436587f90004034f4b3e,phy_info=TA=3 TE=0.000 UpRSSI=-14 TxPwr=5 DnRSSIdBm=-97 time=1496298939.354,handlers=javascript%z15,cdrbuild%z50,javascript%z80,callto=nib_smsc
{ module: 'ybts',
route_type: 'msg',
caller: 'TMSI007b0001',
imsi: '234101713996691',
tmsi: '007b0001',
imei: '359260062387000',
called: '687770009',
callednumplan: 'isdn',
callednumtype: 'international',
'sms.called': '123456789',
'sms.called.plan': 'isdn',
'sms.called.nature': 'national',
rpdu: '000900069186770700f90f017809a121436587f90004034f4b3e',
phy_info: 'phy_info=TA=3 TE=0.000 UpRSSI=-14 TxPwr=5 DnRSSIdBm=-97 time=1496298939.354',
handlers: 'javascript%z15,cdrbuild%z50,javascript%z80',
callto: 'nib_smsc' }
info: [yate-watchsms.js/log_debug] Thu Jun 01 2017 06:35:40 GMT+0000 (UTC) imei: 359260062387000
info: [yate-watchsms.js/log_debug] Thu Jun 01 2017 06:35:40 GMT+0000 (UTC) imsi: 234101713996691
info: [yate-watchsms.js/log_debug] Thu Jun 01 2017 06:35:40 GMT+0000 (UTC) rpdu: 000900069186770700f90f017809a121436587f90004034f4b3e
info: [yate-watchsms.js/log_debug] Thu Jun 01 2017 06:35:40 GMT+0000 (UTC) ok message (OK> - 4f4b3e)
<-----------------------------------
So here I get a valid rpdu (000900069186770700f90f017809a121436587f90004034f4b3e) for an SMS-SUBMIT (MS to SMSC) which I would like to parse and understand so I can make an binary SMS for SMS-DELIVER (SMSC to MS).
Here I wonder if you could help me i.e. in understanding how the values are attributed to the correct field from the specs.
So the rpdu is:
00 09 00 06 91 86 77 07 00 f9 0f 01 78 09 a1 21 43 65 87 f9 00 04 03 4f 4b 3e
Looking at the spec for SMS-SUBMIT and examining the rpdu I observe the following:
- there is some initial octets I cannot understand:
00 09 00
- then I get the SCA (which I can also see from the 'called' field in my log above):
06 91 86 77 07 00 f9
- then I get the 'PDU type':
0f
- then there are some more octets that I cannot account for:
01 78 09 a1
- I recognize the DA (the 'sms.called' field from the log above):
21 43 65 87 f9
00
04
03
- and finally the UDD which is the text "OK>" as expected:
4f 4b 3e
Thank you in advance !