کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی
کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی

decode SMS-SUBMIT



SMS-SUBMIT including : 
SCA-PDU TYPE-MR-DA-PID-DCS-VP-UDL-UD



0891683108200805F01151048181160000FF16C8329BFD66B5F320B8BC4CA7E741F7B79C4D0E01



-SMSC : 0891683108200805F0

--Length : 08 (2digit 2digit)

--number : 91683108200805F0

---International : 91 (+ )

---683108200805F0

Reverse 2digits

86 13 80 02 80 50 00

number is >>> +8613800280500

-PDU Type : 11

--00010001

>>>from right to left 

---MTI : 01 ( SMS SUBMIT )

---RD : 0 ( Reject duplicate )

---VPF : 10 means present see FF after DCS

---SRR : 0 status report not requested

---UDHI : 0 no header present in multi part sms

---RP : 0 (Replay path )

-MR : 51 in hex : 5×16+1=81

-DA : 04818116

--Length : 04

--Number : 818116

---national : 81

---8116

Reverse

1861

number >>> 1861

-PID : 00 ( Protocol ID )

-DCS : 00 ( Data coding scheme : alphabet 7bit )

-VPF : FF in hex 141 days

( Validity period format bit3,4 present in pdu type )

-UDL : 16

-UD : C8329BFD66B5F320B8BC4CA7E741F7B79C4D0E01---Decoding User Data 

C8329BFD66B5F320B8BC4CA7E7

41F7B79C4D0E01

---Reverse hex

01 0E 4D 9C B7 F7 41 E7 A7 4C

BC B8 20 F3 B5 66 FD 9B 32 C8

hex_count :20

---hex to binary

00000001 00001110 01001101

10011100 10110111 11110111

01000001 11100111 10100111

01001100 10111100 10111000

00100000 11110011 10110101

01100110 11111101 10011011

00110010 11001000

---Remove zeros from the left

20×8-int((20×(8/7))×7=6

20×822×7=6


00000001 00001110 01001101

10011100 10110111 11110111

01000001 11100111 10100111

01001100 10111100 10111000

00100000 11110011 10110101

01100110 11111101 10011011

00110010 11001000


---Seperate in 7bits

0100001 1100100 1101100

1110010 1101111 1110111

0100000 1111001 1110100

1110100 1100101 1110010

1110000 0100000 1111001

1101101 0101100 1101111

1101100 1101100 1100101

1001000

---Binary to hex


21 64 6C 72 6F 77 20 79 74

74 65 72 70 20 79 6D 2C 6F

6C 6C 65 48


---Reverse hex


48656C6C6F2C6D79207072657474

7920776F726C6421


hex_count=22>>>22÷16=1 Reminder=6

UDL=16


---Put hex here

https://codebeautify.org/hex-string-converter



Finally decoded done successfully.


Encoding : 

Hex_Count:22

Int(22×(7÷8))+1-22×7=6

Add 6 Zero to the first

Decoding : 

Hex_Count :20

20×8-int(20×(8/7))=6

Remove 6 zero from the first







GSM-7 messages break down as follows:

  • Standard single SMS messages: For GSM phones with 7-bit character encoding, a standard SMS message can contain a maximum of 160 characters. That is 1120 bits / (7 bits/character) = 160 characters for a single SMS message.
  • GSM-7 multi-part or concatenated messages: When the message text is longer than 160 GSM characters, the message is concatenated and sent. When a message is concatenated, the user data header (UDH) consumes 6 bytes or 48 bits. This reduces the maximum number of characters in each message part:

1120 bits - 48 bits = 1072 bits

1072 bits / (7 bits/character) = 153 characters per message part.





























decode SMS-SUBMIT




079144872000626011000C914477000910320011002154747A0E4ACF416190BD2CCF83E6E9369C5D06B5CBF379F85C06E95A29



-0791448720006260 : SMSC

--07 : Length(Hex)

---Number :

91448720006260

91 : International ( + )

448720006260

Reverse 2digits from left

number is ... 44 78 02 00 26 06

-11 : PDU Type

--00010001

bit0,1(from right) : 01 : MTI

SMS-SUBMIT :01 & DELIVER : 00

bit2 : 0 : RD ( Reject duplicate )

bit3,4 : 10 : VPF : present

bit5 : 0 : SRR

bit6: 0 : UDHI : not present ( for concatenated messages or multi part)

bit7 : 0 : RP ( Reply path )

-00 : MR ( Message refrence in hex )

-0C91447700091032 : DA (send To this)

--0C : Length in hex

C=0×16+12=12

---Number

91 : International ( + )

447700091032

Reverse 2digits from the left

number is ... 44 77 00 90 01 23

-00 : PID

-11 : DCS ( Data coding scheme )

Alphabet 7bit

--Group coding

General data coding

11 GSM 7BIT CLASS 1 (ME-specific)


-00 : VPF
( Ckeck bit3,4 of PDU Type [10] ,it means present)

-21 : UDL in hex

-54747A0E4ACF416190BD2CCF83E6E9369C5D06B5CBF379F85C06E95A29 : UD


---Decoding User Data ( UD )

Data coding is ... alphabet mode 


54747A0E4ACF416190BD2CCF8

3E6E9369C5D06B5CBF379F85C06

E95A29


-Reverse above Hex 

29 5A E9 06 5C F8 79 F3 CB B5 06 

5D 9C 36 E9 E6 83 CF 2C BD 90 61

41 CF 4A 0E 7A 74 54


-Hex to binary

00101001 01011010 11101001

00000110 01011100 11111000

01111001 11110011 11001011

10110101 00000110 01011101

10011100 00110110 11101001

11100110 10000011 11001111

00101100 10111101 10010000

01100001 01000001 11001111

01001010 00001110 01111010

01110100 01010100



Hex_Count (2digits)=29

How many zeros to be remove? ( from the left of binery [Octet])

29×8-int(29×8/7)×7=1


Remove 1 Zero from the left then Set to septet (7bit) All binaries

0101001 0101101 0111010

0100000 1100101 1100111

1100001 1110011 1110011

1100101 1101101 0100000

1100101 1101100 1110000

1101101 1101001 1110011

0100000 1111001 1110010

1100101 1110110 0100000

1100001 0100000 1110011

1101001 010 0000 1110011

1101001 1101000  1010100


-Binary to hex

Ex : 010 1001:010=2,1001:9

29 2D 3A 20 65 67 61 73 73

65 6D 20 65 6C 70 6D 69 73

20 79 72 65 76 20 61 20 73

69 20 73 69 68 54

-Reverse hex 

546869732069732061207665727920

73696D706C65206D65737361676520

3A2D29

Hex_Count=33

33 >>> 33÷16=2 Reminder=1>>21

21... is the actual length of UDL

-Put hex here

https://codebeautify.org/hex-string-converter


Finally decoded done successfully!!!

do not forget >>> like & comment 



Have a sweet day 

































SMS-SUBMIT



-Decode UD(User data) in 7bit (Sending max 160 char)-(Ascii 140 Char Max Len)


below Text(fingilish)  to Hex


4d616e206d6f6469726520696e206d616a6d6f6f652068617374616d206c6f7466616e2062612062616e64652068616d6168616e672062617368696420676f6c616e616d2e


Length : 69 (2digits)-change to hex value

Hex : 69÷16=4 & 69-4×15=5 : 45

So UDL(User data length)=45 


Hex to binary  : 

2E=2×16+14=46(decimal)

46÷2=23 Reminder=0

23÷2=11 Reminder=1

11÷2=5    Reminder=1

5÷2=2     Reminder=1

2÷2=1        Reminder=0

1÷2=0   Reminder=1

0÷2=0 Reminder=0


From Down to up :


hex(2E):decimal(46):binary(0101110)




Reverse Hex : 

2E6D616E616C6F672064696873616220676E6168616D61682065646E6162206162206E6166746F6C206D617473616820656F6F6D6A616D206E6920657269646F6D206E614D



2E : octet(00101110)>>>septet(01011110)[Len 7 from the right]


0101110 1101101 1100001 1101110 1100001 1101100  1101111 1100111 0100000 1100100 1101001 1101000 1110011 1100001 1100010 0100000 1100111 1101110 1100001 1101000 1100001 1101101 1100001 1101000 0100000 1100101 1100100 1101110 1100001 1100010 0100000 1100001 1100010 0100000 1101110 1100001 1100110 1110100 1101111 1101100 0100000 1101101 1100001 1110100 1110011 1100001 1101000 0100000 1100101 1101111 1101111 1101101 1101010 1100001 1101101 0100000 1101110 1101001 0100000 1100101 1110010 1101001 1100100 1101111 1101101 0100000 1101110 1100001 1001101



Add the required zero from the left until it is devided by 8 : 

69×7+x Mod 8=0

7bit > 8bit

int(69×7/8)+1=61×8-69×7=5



00000 0101110 1101101 1100001 1101110 1100001 1101100  1101111 1100111 0100000 1100100 1101001 1101000 1110011 1100001 1100010 0100000 1100111 1101110 1100001 1101000 1100001 1101101 1100001 1101000 0100000 1100101 1100100 1101110 1100001 1100010 0100000 1100001 1100010 0100000 1101110 1100001 1100110 1110100 1101111 1101100 0100000 1101101 1100001 1110100 1110011 1100001 1101000 0100000 1100101 1101111 1101111 1101101 1101010 1100001 1101101 0100000 1101110 1101001 0100000 1100101 1110010 1101001 1100100 1101111 1101101 0100000 1101110 1100001 1001101


Seperate 8digits (octet) : 


00000010111011011011100001110111

01100001110110011011111100111010

00001100100110100111010001110011

11000011100010010000011001111101

11011000011101000110000111011011

10000111010000100000110010111001

00110111011000011100010010000011

00001110001001000001101110110000

11100110111010011011111101100010

00001101101110000111101001110011

11000011101000010000011001011101

11111011111101101110101011000011

10110101000001101110110100101000

00110010111100101101001110010011

01111110110101000001101110110000

11001101


تبدیل باینری های بالا  طبق جدول به Hex : 


02 ED B8 77 61 D9 BF 3A 0C 9A 74 73 C3 89 06 7D D8 74 61 DB 87 42 0C B9 37 61 C4 83 0E 24 1B B0 E6 E9 BF 62 0D B8 7A 73 C3 A1 06 5D FB F6 EA C3 B5 06 ED 28 32 F2 D3 93 7E D4 1B B0 CD



برعکس کردن مقادیر Hex : 


CDB01BD47E93D3F23228ED06B5C3EA

F6FB5D06A1C3737AB80D62BFE9E6B0

1B240E83C46137B90C4287DB6174D8

7D0689C373749A0C3ABFD96177B8ED

02


00110008810100358500000C45CDB01BD47E93D3F23228ED06B5C3EAF6FB5D06A1C3737AB80D62BFE9E6B01B240E83C46137B90C4287DB6174D87D0689C373749A0C3ABFD96177B8ED02

UDL(User data length)=45hex=69




Address Example  : 


Alphanumeric address is at first put to the GSM 7-bit default alphabet, then encoded the same way as any message text in TP-UD field (that means it is 7-bit packed) and then the address is supplied with the "number" length and TON and NPI.

For example, a fictional alphanumeric address Design@Home is converted to the GSM 7-bit default alphabet which yields 11 bytes 44 65 73 69 67 6E 00 48 6F 6D 65 (hex), the 7-bit packing transforms it to 77 bits stored in 10 octets as C4 F2 3C 7D 76 03 90 EF 76 19; 77 bits is 20 nibbles (14 hex) which is the value of the first octet of the address. The second octet contains TON (5) and NPI (0), which yields D0 hex. The complete address in the GSM format is 14 D0 C4 F2 3C 7D 76 03 90 EF 76 19.

-Text to Hex Value : Design@Home

44657369676e40486f6d65

Length : 11

-Reverse Hex Values

65 6D 6F 48 40 6E 67 69 73 65 44

-Binary ( 7 bit from the right )

1100101 1101101 1101111 1001000

1000000 1101110 1100111 1101001

1110011 1100101 1000100

-Add required zero to the left : 

int(11×7/8)+1=10×8-11×7=80-77=3

000 1100101 1101101 1101111 

1001000 1000000 1101110 1100111 

1101001 1110011 1100101 1000100

-Octet :

00011001011101101110111110010001

000000110111011001111101

001111001111001011000100

-Binary to Hex :

19 76 EF 91 03 76 7D 3C F2 C4

-Reverse Hex : 

C4 F2 3C 7D 76 03 91 EF 76 19


80÷4=20>>>hex(14)


The format of addresses in the GSM 03.40 is described in the following table:

octetMeaning
0address length in nibbles (semi-octets)
1EXT, TON, NPI
2-11address digits

the nibble is often called a semi-octet


-Ext : usaually 1

-TON ( Type of number )

bit 6,5,4 :

unknown 000

international number : 001

National number : 010

Network specific number : 011

Subscriber number  100

Alphanumeric, (coded according to 3GPP TS 23.038 [9] GSM 7-bit default alphabet)  101

Abbreviated number 110

Reserved for extension 111


-NPI ( Numbering plan id )

bit 3,2,1,0

Unknown 0000

ISDN/telephone numbering plan (E.164/E.163) 0001

Data numbering plan (X.121) 0011

Telex numbering plan 0100

Service Centre Specific plan 0101

Service Centre Specific plan 2) 0110

National numbering plan 1000

Private numbering plan 1001

ERMES numbering plan (ETSI DE/PS 3 01 3) 1010

Reserved for extension 1111



EXT : 1 , TON : 001 , NPI : 0001 :

10010001 >>>>  Hex : 91

EXT : 1 , TON : 000 , NPI : 0001 :

10000001 >>>> Hex : 81


1 010 1000 : A8


00110008A8010035850008051006450647080006650666


1 001 1001 : 99


0011000A9989010035850008051006450647080006650666






002414
D0C4F23C7D760390EF76190000111011315214000BE474D81C0EBB5DE3771B


-TP-DCS : 


Message Classes
ValueMessage Class
0 00 - Flash messages
0 11 - ME-specific
1 02 - SIM / USIM specific
1 13 - TE-specific

Flash messages are received by a mobile phone even though it has full memory. They are not stored in the phone, they just displayed on the phone display.


Coding Group : General Data Coding


00  0   GSM 7 bit Default
08  8   UCS2        Default
10 16 GSM 7 bit  Class 0 (Flash message)
14 20 8 bit data Class 0 (Flash message)
18 24 UCS2 Class 0 (Flash message)
20 32 GSM 7 bit   Default  +(compressed)
30 48 GSM 7 bit  Class 0 (Flash message) +(compressed)

Message Marked for Automatic Deletion :
40 64 GSM 7 bit Default
44 68 8 bit data Default
48 72 UCS2       Default

48 : Hex , 72 : decimal

50 80 GSM 7 bit Class 0 (Flash message)
60 96 GSM 7 bit Default  +(compressed)
54 84 8 bit data Class 0 (Flash message)
60 96 GSM 7 bit Default  +(compressed)
70 112 GSM 7 bit Class 0 (Flash message) +(compressed)


0031000B9189199370489400480036062F06310020062D062706440020062A0633062A0020062706310633062706440020067E06CC0627064506A9002006470633062A0645

UDL:decimal(54),Hex(36)

062F : د

Length from 0B to the end : 66