Reputation: 31
I am doing a small SMS receive utility,i have a SMS messages which I can not understand how to decode its sender id, here is the output of reading the message in PDU mode:
+CMGL: 0,1,,86 0791021197003899440ED0657A7A1E6687E93408610192016390004205000365030106440642062F002006270633062A064706440643062A0020064306440020062706440648062D062F0627062A0020062706440645062C06270646064A
and in text mode:
+CMGL: 0,"REC READ","1011161051159710897116",,"16/10/29,10:36:09+00" 06440642062F002006270633062A064706440643062A0020064306440020062706440648062D062F0627062A0020062706440645062C06270646064A
and i read this message through mobile phone and i found that the sender alphanumeric code "1011161051159710897116" is equal to "etisalat" which is the name of service provider, i want to understand what encoding they use. and how to decode it ?
Upvotes: 1
Views: 1865
Reputation: 1973
It's encoded as ASCII as decimal semi-octets:
1011161051159710897116 =
101 = &65 = e
116 = &74 = t
105 = &69 = i
115 = &73 = s
97 = &61 = a
108 = &6C = l
97 = &61 = a
116 = &74 = t
To read this from PDU data, you have to swap the semi-octets and if the length is odd you have to add an extra 'F' to make it even to get the proper octet string.
The specs for SMS PDU's can be found here: GSM 03.40
Upvotes: 5