"按比特計流量的日子,你還記得嗎?---Byte與Bit”已在微信公眾號"跟著老康學5G"中推出,敬請關注!
IMS和SIP中短信(SMS)的傳遞過程非常簡單,終端發(fā)送消息即可;是否接收發(fā)送報告可由網(wǎng)絡或終端選擇(發(fā)送報告可選)。有關短信(SMS)規(guī)范可見3GPP TS 24.341。在IMS和SIP中SMS的注冊及流程如下:
1.終端(短信能力)注冊
3GPP TS 24.341 5.3.2.2規(guī)定,終端是否支持通過IP傳輸(SM-over-IP ),其在注冊時標記;
RFC 3840中定義了終端通過IMS網(wǎng)絡處理的參數(shù),其中,包括:"+g.3gpp.smsip"
1.1 終端注冊示例
REGISTER sip:test.3gpp.com SIP/2.0
Expires: 600000
Authorization: Digest ....
CSeq: 1 REGISTER
Max-Forwards: 70
Route: <sip:[2001:0:0:2::2]:5060;lr>
f: <sip:310410123456789@test.3gpp.com>;tag=1148585218
i: 229717043
k: pathsec-agree
l: 0
m: <sip:310410123456789@[2001:0:0:2::1]:5060>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel";+g.3gpp.smsip;+sip.instance="<urn:gsma:imei:35858205-001765-1>"
t: <sip:310410123456789@test.3gpp.com>
v: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK1447958797smg;transport=TCP
2.終端短信發(fā)送
2.1 短信發(fā)送主要流程
2.2 消息內容(MO)
Request: MESSAGE tel:19037029920;phone-context=TestIMS.com | (RP) RP-DATA (MS to Network)
MESSAGE tel:19037029920;phone-context=TestIMS.com SIP/2.0
f: "Test" <sip:+11234567890@test.3gpp.com>;tag=834037901
t: <tel:19037029920;phone-context=TestIMS.com>
CSeq: 834037887 MESSAGE
i: 834037887_2367153256@2001:0:0:1::1
v: SIP/2.0/UDP [2001:0:0:1::1]:5060;branch=z9hG4bK253093091
Max-Forwards: 70
Route: <sip:[2001:0:0:1::2]:5060;lr>
c: application/vnd.3gpp.sms
Allow: MESSAGE
Request-Disposition: no-fork
User-Agent: Test User Agent
l: 28
v: SIP/2.0/UDP [2001:0:0:1::1]:5060;branch=z9hG4bK253093091
Route: <sip:[2001:0:0:1::2]:5060;lr>
c: application/vnd.3gpp.sms
Allow: MESSAGE
Request-Disposition: no-fork
User-Agent: Test User Agent
Message Body
GSM A-I/F RP - RP-DATA (MS to Network)
RP-Message Reference
RP-Message Reference: 0x05 (5)
RP-Origination Address
Length: 0
RP-Destination Address - (19037029920)
0... .... = TP-RP: TP Reply Path parameter is not set in this SMS SUBMIT/DELIVER
.0.. .... = TP-UDHI: The TP UD field contains only the short message
..0. .... = TP-SRR: A status report is not requested
...1 0... = TP-VPF: TP-VP field present - relative format (2)
.... .0.. = TP-RD: Instruct SC to accept duplicates
.... ..01 = TP-MTI: SMS-SUBMIT (1) // This is indication of MO-SMS
TP-MR: 88
TP-Destination-Address - (555)
Length: 3 address digits
1... .... : No extension
.000 .... : Type of number: (0) Unknown
.... 0001 : Numbering plan: (1) ISDN/telephone (E.164/E.163)
TP-DA Digits: 555
TP-PID: 0
00.. .... : defines formatting for subsequent bits
..0. .... : no telematic interworking, but SME-to-SME protocol
...0 0000 : the SM-AL protocol being used between the SME and the MS (0)
TP-DCS: 0
00.. .... = Coding Group Bits: General Data Coding indication (0)
Special case, GSM 7 bit default alphabet
TP-Validity-Period: 24 hours 0 minutes
TP-User-Data-Length: (12) depends on Data-Coding-Scheme
TP-User-Data
SMS text: MO SMS Test
短信發(fā)送報告:
Request: MESSAGE sip:+11234567890@test.3gpp.com | (RP) RP-ACK (Network to MS)
MESSAGE sip:+11234567890@test.3gpp.com SIP/2.0
Via: SIP/2.0/UDP [2001:0:0:1::2]:5060;branch=z9hG4bK-b6999e582ee8a42f22e8aafe5f68f47b;rport
Via: SIP/2.0/UDP [2001:0:0:1::2]:60393;branch=z9hG4bK00476613
Max-Forwards: 69
From: <sip:1111@test.3gpp.com>;tag=00476613
To: <sip:+11234567890@test.3gpp.com>
Call-ID: 20131016-151124@[2001:0:0:1::2]:60393
CSeq: 1 MESSAGE
Request-Disposition: fork, parallel
Accept-Contact: *;+g.3gpp.smsip;require;explicit // This indicate that this SIP message is a SMS message
Content-Type: application/vnd.3gpp.sms // This indicates that the SMS is in 3GPP format (not 3GPP2 format)
In-Reply-To: 834037887_2367153256@2001:0:0:1::1
P-Called-Party-ID: <sip:+11234567890@test.3gpp.com>
Content-Length: 13
Record-Route: <sip:[2001:0:0:1::2];lr>
Message Body
GSM A-I/F RP - RP-ACK (Network to MS)
RP-Message Reference
RP-Message Reference: 0x05 (5)
RP-User Data
Element ID: 0x41
Length: 9
TPDU (not displayed)
GSM SMS TPDU (GSM 03.40) SMS-SUBMIT REPORT
.0.. .... = TP-UDHI: The TP UD field contains only the short message
.... ..01 = TP-MTI: SMS-SUBMIT REPORT (1)
TP-Parameter-Indicator
0... .... : No extension
.000 0... : Reserved
.... .0.. : TP-UDL not present
.... ..0. : TP-DCS not present
.... ...0 : TP-PID not present
TP-Service-Centre-Time-Stamp
Year 33, Month 13, Day 03
Hour 13, Minutes 63, Seconds 13
Timezone: GMT + 13 hours 15 minutes
2.3終端短信成功發(fā)送流程圖
3.終端短信接收流程
3.1終端短信接收主要流程
根據(jù)TS 34.229 18.2終端通過IMS網(wǎng)絡接收短信的主要流程如下:
3.2 消息內容(MT)
Request: MESSAGE sip:+11234567890@test.3gpp.com | (RP) RP-DATA (Network to MS)
MESSAGE sip:+11234567890@test.3gpp.com SIP/2.0
Via: SIP/2.0/UDP [2001:0:0:1::2]:5060;branch=z9hG4bK-ad54683f54403f46ff8d8b553521e588;rport
Via: SIP/2.0/UDP [2001:0:0:1::2]:60393;branch=z9hG4bK0047D4EC
Max-Forwards: 69
From: <sip:1111@test.3gpp.com>;tag=0047D4EC
To: <sip:+11234567890@test.3gpp.com>
Call-ID: 20131016-151152@[2001:0:0:1::2]:60393
CSeq: 1 MESSAGE
Request-Disposition: no-fork
Accept-Contact: *;+g.3gpp.smsip;require;explicit // This indicate that this SIP message is a SMS message
Content-Type: application/vnd.3gpp.sms // This indicates that the SMS is in 3GPP format (not 3GPP2 format)
Content-Transfer-Encoding: binary
P-Called-Party-ID: <sip:+11234567890@test.3gpp.com>
Content-Length: 41
Record-Route: <sip:[2001:0:0:1::2];lr>
Message Body
GSM A-I/F RP - RP-DATA (Network to MS)
RP-Message Reference
RP-Origination Address - (999999)
Length: 4
1... .... = Extension: No Extension
.000 .... = Type of number: unknown (0x00)
.... 0001 = Numbering plan identification: ISDN/Telephony Numbering (Rec ITU-T E.164) (0x01)
BCD Digits: 999999
RP-Destination Address
RP-User Data
GSM SMS TPDU (GSM 03.40) SMS-DELIVER
0... .... = TP-RP: TP Reply Path parameter is not set in this SMS SUBMIT/DELIVER
.0.. .... = TP-UDHI: The TP UD field contains only the short message
..0. .... = TP-SRI: A status report shall not be returned to the SME
.... .1.. = TP-MMS: No more messages are waiting for the MS in this SC
.... ..00 = TP-MTI: SMS-DELIVER (0) // This is indication of MT-SMS
TP-Originating-Address - (1234567890)
Length: 10 address digits
1... .... : No extension
.000 .... : Type of number: (0) Unknown
.... 0001 : Numbering plan: (1) ISDN/telephone (E.164/E.163)
TP-OA Digits: 1234567890
TP-PID: 0
00.. .... : defines formatting for subsequent bits
..0. .... : no telematic interworking, but SME-to-SME protocol
...0 0000 : the SM-AL protocol being used between the SME and the MS (0)
TP-DCS: 0
00.. .... = Coding Group Bits: General Data Coding indication (0)
Special case, GSM 7 bit default alphabet
TP-Service-Centre-Time-Stamp
Year 13, Month 10, Day 16
Hour 15, Minutes 11, Seconds 29
Timezone: GMT + 5 hours 0 minutes
TP-User-Data
SMS text: this is a mt sms test message
終端發(fā)送接收回持:
Request: MESSAGE sip:1111@test.3gpp.com;phone-context=TestIMS.com | (RP) RP-ACK (MS to Network)
MESSAGE sip:1111@test.3gpp.com;phone-context=TestIMS.com SIP/2.0
f: "Test" <sip:+11234567890@test.3gpp.com>;tag=834066458
t: <sip:1111@test.3gpp.com;phone-context=TestIMS.com>
CSeq: 834066445 MESSAGE
i: 834066446_2367161720@2001:0:0:1::1
v: SIP/2.0/UDP [2001:0:0:1::1]:5060;branch=z9hG4bK502862226
Max-Forwards: 70
Route: <sip:[2001:0:0:1::2]:5060;lr>
c: application/vnd.3gpp.sms
Allow: MESSAGE
Request-Disposition: no-fork
User-Agent: Test User Agent
l: 6
Message Body
GSM A-I/F RP - RP-ACK (MS to Network)
RP-Message Reference
RP-Message Reference: 0x00 (0)
RP-User Data
Element ID: 0x41
Length: 2
TPDU (not displayed)
GSM SMS TPDU (GSM 03.40) SMS-DELIVER REPORT
.0.. .... = TP-UDHI: The TP UD field contains only the short message
.... .0.. = TP-MMS: More messages are waiting for the MS in this SC
.... ..00 = TP-MTI: SMS-DELIVER REPORT (0)
TP-Parameter-Indicator
0... .... : No extension
.000 0... : Reserved
.... .0.. : TP-UDL not present
.... ..0. : TP-DCS not present
.... ...0 : TP-PID not present
3.3 終端通過IMS成功接收短信流程圖
TS. 24.341 B.6終端成功接收短信流程如下圖:
原文來自:http://www.sharetechnote.com
整理:kangguoying20201007