| How to send a APDU over NowSMS |
| SMS & MMS Technical Forum » MMS & SMS Technical Discussions (unsupported) » How to send a APDU over NowSMS | « Previous || Next » |
| Author | Message | |||
| Andrew
New member Username: Andrewru Post Number: 1 Registered: 08-2010 |
Hi! There was a similar thread in the archive but without an answer. But the answer is urgently needed. I need to send OTA Remote File management commands to change IMSI on the SIM card. My APDU code as following lists: and my question is whatever I fill these codes to the "Send Binary Message", always get +CMS Error 500, how can I fill the UserDataHeader, BinaryData, PID and DCS? Thanks for your help. ........................... A0C2000051 (ISO ENv) D14F (11.14 SMS-PP) 02028381 (devices Ids) 0606983311111111 (SCA) 0B41 (begin of the SMS TPDU) E40A9833111111117F16080317095345322F (begin of the GSM 03.48 ) 027000002A15020124245241440000000000001C85B29743E45727 (begin of the commands that upadte the IMSI file) 280102000C5472616E73666F726D657273 | |||
| Des - NowSMS Support
Board Administrator Username: Desosms Post Number: 2447 Registered: 08-2008 |
Hi Andrew, This is outside of my area of expertise, but I think you want to send this: UDH = 027000 Data = 002A15020124245241440000000000001C85B29743E45727 280102000C5472616E73666F726D657273 pid = 7f dcs = f6 (It looks like your example has DCS=16 in the SMS TPDU header, which is ok for sending via a modem, but is not a legal value if sending via SMPP. F6 has the same meaning.) Whether or not your operator will allow you to send these commands over a GSM modem may be an issue. -- Des NowSMS Support | |||
| Andrew
New member Username: Andrewru Post Number: 2 Registered: 08-2010 |
Thank you very much for your help. I have connection of NowSMS to SMSC over SMPP, and I want to use it to send SMS. In that way, what pid and dcs do i need? As i understand UDH will be 027000? And data = 002A15020124245241440000000000001C85B29743E45727 280102000C5472616E73666F726D657273 ? | |||
| Des - NowSMS Support
Board Administrator Username: Desosms Post Number: 2455 Registered: 08-2008 |
Since you mentioned "+CMS ERROR 500", I assumed you were referring to sending out via a GSM modem connection. For SMPP, you would use the same settings that I posted in the previous message. UDH is always 027000 for these messages. (NowSMS requires that you separate the UDH off of the message data when submitting to NowSMS via HTTP. When you do this, NowSMS simply concatenates the UDH and the data, and sets the UDHI flag.) Do note that you might run into an issue if you are sending a message where the UDH and data length exceeds 140 bytes. Please see the following thread for a solution to the long message SIM data download problem: http://www.nowsms.com/discus/messages/1/59837.html -- Des NowSMS Support | |||
| Andrew
New member Username: Andrewru Post Number: 3 Registered: 08-2010 |
Thanks a lot for your help. So about UDH=027000, DCS=F6 and pid=7F it's cleared. One more thing. What about these parts of APDU SMS-PP. -------------------------------- A0C2000051 (ISO ENv) D14F (11.14 SMS-PP) 02028381 (devices Ids) 0606983311111111 (SCA) 0B41 (begin of the SMS TPDU) E40A9833111111117F16080317095345322F ------------------------------------------ Do i need to attach them to the (begin of the GSM 03.48 ) without UDH to the Data? And in that way the parameter Data will be A0C2000051D14F0202838106069833111111110B41E40A9833111111117F16080317095345322F + 002A15020124245241440000000000001C85B29743E45727 280102000C5472616E73666F726D657273 ? Or NowSMS generates these parts of APDU SMS-PP by itself. And I need to begin Data with only begin of the GSM 03.48 without UDH? | |||
| Des - NowSMS Support
Board Administrator Username: Desosms Post Number: 2460 Registered: 08-2008 |
You can't generate any of that. It's not really a NowSMS issue, you just don't get access to that level of things, especially when submitting via SMPP. Keep in mind, however, that I know a lot about sending SMS messages, but I have no practical experience sending the type of messages that you are sending. So it is possible that some of these other data elements are required, but they are required in the data portion of the message. What I do know is that the UDH is always 0270000. And technically, the UDH is the first few bytes of the user data portion of the message. I also know that the SMS TPDU is defined in ETSI GSM 03.40. The SMS TPDU fields are generated automatically by either the SMPP server (or by NowSMS if sending via a modem). And I know that when sending an SMS message via GSM modem, the SCA precedes the TPDU (or is left blank to indicate default service centre), and is an indication to the modem which service centre to use to send the message. The SCA has no relevance when sending via SMPP. The part that is outside my area of expertise is what you label as ISO ENv, 11.14 SMS-PP, and device Ids. I'm guessing that you're looking at ETSI GSM 11.14, and perhaps looking at how you send an SMS message from an SIM toolkit application? Or perhaps looking at the format in which you receive an SMS message in a SIM toolkit application? I believe these GSM 11.14 headers are part of the SIM toolkit messaging interface, and not actually sent over the air. If they are sent over the air, they need to be in the message data somewhere. Does any of this make sense? If not, can you give me specific pointers to where these fields are defined, and what they mean to you in your context? -- Des NowSMS Support | |||
| Andrew
New member Username: Andrewru Post Number: 4 Registered: 08-2010 |
Well, thank u very much for your help. I've achieved my goal and updated IMSI using NowSMS and OTA Remote File Management. So to update IMSI i need to compose header and encrypt commands using GSM 03.48. Then i need to send this packet using NowSMS without UDH. And all works! Thanks a lot. | |||
| Alex Kaing
New member Username: Alexkaing Post Number: 1 Registered: 03-2011 |
Hi all, I have read this topic, it is very interesting and match with what i need now. But some place i don understand. Question: I want to change SMS center on SIM via OTA. What is the UDH, Data ...? I want to change SMSC to +855101000000. Could you please let know how to convert my new SMSC to data for sending ? Looking forward to hear from you. :-) Thanks Alex | |||
| Andrew
New member Username: Andrewru Post Number: 5 Registered: 08-2010 |
Hi Alex, I've made changing data on SIM via OTA. From my skill it's very necessary to cooperate with SIM manufacture. Because you need to know SPI, KIK, KID, TAR, etc. that is used on the SIM card. Without that info you will be unable to make any changes via OTA. | |||
| Alex Kaing
New member Username: Alexkaing Post Number: 2 Registered: 03-2011 |
Thanks Andrew for your fast response, Do you know another option (software) to check SPI, KIK, KID, TAR beside SIM manufacture ? Thanks Alex | |||
| Andrew
New member Username: Andrewru Post Number: 6 Registered: 08-2010 |
Hi Alex. No, I don't know such software. From my point of view there is no such software. In my case, for example, TAR in the SIM had value 111111h, it was vendor specific. And only vendor told me this value of TAR. B.R. Andrew | |||
| S.S.Sudhakar
|
hi andrew, Can you post sample meesage you used for RFM using nowsms. Regards, Sudhakar | |||
| sashidharan
New member Username: Sashidharanvit Post Number: 1 Registered: 01-2012 |
Hi Andrew, Can you be a bit clear regarding the way you achieved your aim of changing IMSI of SIM!! (i.e, Could you give me step by step way of doing it) I am planning to do it and that would benefit me greatly Thanks And Regards, R.Sashidharan | |||
| Andrew
New member Username: Andrewru Post Number: 7 Registered: 08-2010 |
I've developed a program that connects to SMS Center over SMPP. Then, regarding to the vendor information of the SPI, TAR and etc. of the SIM cards, I've made an APDU. After that I can send APDUs over SMPP and change IMSI on the SIM cards over OTA. The only weakness of this method is that I do not have an opportunity to get PoR from the SIM card when I change IMSI or SPN or etc. on the SIM card. | |||
| sashidharan
New member Username: Sashidharanvit Post Number: 2 Registered: 01-2012 |
Hi Andrew, Thank You for the Reply!! Could you please guide me and give me important links and pdfs you read to make the APDU which changes imsi no of the sim card Thanks and Regards, R.Sashidharan | |||
| Andrew
New member Username: Andrewru Post Number: 8 Registered: 08-2010 |
Hi. The main recommendation is 3GPP TS 03.48. B.R. Andrew | |||
| sashidharan
New member Username: Sashidharanvit Post Number: 3 Registered: 01-2012 |
That is how did you write commands which update the imsi file In your case you have written 280102000C5472616E73666F726D657273 What the above data means could you explain this?? | |||
| Andrew
New member Username: Andrewru Post Number: 9 Registered: 08-2010 |
Here are commands that update IMSI on SIM-card Select file A0A40000023F00 Select file A0A40000027F20 Select file A0A40000026F07 Change IMIS on selected file A0D6000009082905935846345718 All this commands are gathered in sms message and are sent to mobile phone. Depending of the sim's manufacture these commands must be chyphered. | |||
| sashidharan
New member Username: Sashidharanvit Post Number: 4 Registered: 01-2012 |
Hi Andrew Thanks for the Reply man!! But what i actually want is how the octets are actually formed and where is the old and new updated imsi in the message given by you Could you explain in detail the octets and say what do they do?? | |||
| Andrew
New member Username: Andrewru Post Number: 10 Registered: 08-2010 |
To update IMSI u must select necessary file on file system of the sim card. First u must select directory 3F00. The command to select this catalog is A0A40000023F00. Then u need to select subdirectory 7F20. So the command is A0A40000027F20. Next u must select file where old IMSI stored. This file is 6F07. Ok, now when active selested file is our file with old IMSI we change data in that file to new IMSI. The command is A0D6000009081111111111111111. Now new IMSI of the sim-card is 1111111111111111. Thats it. Old IMSI we overwrite. And one thing to mention. The file system of different manufactores are not the same. So u need to select necessary file depending of your sim card file system | |||
| sashidharan
New member Username: Sashidharanvit Post Number: 5 Registered: 01-2012 |
Hi Andrew Thanks for your guidance good explanation given Still one thing i have a doubt is Using Nowsms, how will you send this message?? Steps: 1) In nowsms web interface, go to binary sms and select other 2) what to type in to: imsi or msisdn no 3) with or without udh:027000 4) binary data: A0A40000023F00A0A40000027F20A0A40000026F07 + A0D6000009082905935846345718 5) pid = 7f dcs = f6 IMP: Is this the correct way or any other thing i need to do?? Pls Reply?? | |||
| Andrew
New member Username: Andrewru Post Number: 11 Registered: 08-2010 |
Can't say how to make it in NowSMS, because I use my own written programm. But 2 years ago, I used NowSMS to send sms with commands of changing IMSI. And IMSI was successful changed on the sim card. Nowdays I unfortunately forgot it. As I remmeber: pid = 7f dcs = f6 udh: 027000 NowSMS puts by itself (or may be not) destination address must be MSISDN binary data: not only A0A40000023F00A0A40000027F20A0A40000026F07 + A0D6000009082905935846345718 You need to read 3GPP TS 03.48. Before this data you need to put CHL,SPI,Kic,KID,TAR,CNTR and so on. And only after that in Data block these commands. Depending of SPI this data block with our commands must be chyphered or not. | |||
| sashidharan
New member Username: Sashidharanvit Post Number: 6 Registered: 01-2012 |
Hi andrew, Thank you so much for the info but in gsm 3.48 they have given command format spi,kic,kid,cntr etc can be coded by our own the details are given in the pdf Then why we need to consult vendor for those values and i think ciphering is not needed for demo purposes - my view(may be wrong) Pl clarify how to create your own program which changes imsi no(which programming you followed) Also do you know about stk Somebody are saying we need to download stk which will do the change of imsi of simcard(could you clarify on this too) Thanks and Regards, R.Sashidharan | |||
| Andrew
New member Username: Andrewru Post Number: 12 Registered: 08-2010 |
Manufactorer of the sim-card when producing the sim card follows the recommendations of GSM 3.48. When he produce the sim card he programing it with defined by himself parameteres of SPI, Kic, KID, TAR, PCNTR. If you want that sim card applied your cjmmands to change IMSI, you must sent this parametres equil of what manufactorer made. In other way the sim card would not apply these commands. So if vendor made chiphering enabled, you must chipher these commands. Dont know about stk. | |||
| sashidharan
New member Username: Sashidharanvit Post Number: 7 Registered: 01-2012 |
Pl clarify how to create your own program which changes imsi no(which programming you followed) would you eloborate on this please?? Regards R.Sashidharan | |||
| Andrew
New member Username: Andrewru Post Number: 13 Registered: 08-2010 |
Well, the program is not very difficult. You need transport to deliver sms to the subscriber. I choosed SMPP, developed SMPP client to connect to SMSC center. Then you need to programm proper to vendor info OTA packet with commands to change IMSI and sent this packet over SMPP. | |||
| sashidharan
New member Username: Sashidharanvit Post Number: 8 Registered: 01-2012 |
That means you have created a similar to nowsms web interface to send the apdu to the simcard!!! One more thing is there any hack of knowing the details of sim(like spi etc) or changing those values also!! Because sim manufactures would also use software to write these values to the sim card isnt it??? | |||
| Andrew
New member Username: Andrewru Post Number: 14 Registered: 08-2010 |
Don't know about the hack. I worked in cooperation with vendor. May be there is. But it is not easy to encrypt your commands not knowing DES, or 3DES etc. key. If there is no chiphering on the sim card, may be there is the way to hack the sim card. | |||
|

