在IMS和SIP中有一種交互信息,這就是CPIM(Common Presence and Instant Messaging),消息格式由 RFC3862 定義;我個(gè)人理解:此類消息類似于電腦游戲中參與對(duì)象之間的實(shí)時(shí)會(huì)話;
1.CPIM特點(diǎn)
消息可實(shí)現(xiàn)端到端保護(hù)格式(基于計(jì)算機(jī)簽名規(guī)范);
獨(dú)立于任何特定的應(yīng)用協(xié)議;
能夠傳送一系列不同的地址類型;
基于一個(gè)8位(干凈的)信息傳輸協(xié)議;
可進(jìn)化, 可由多方擴(kuò)展;
信息元數(shù)據(jù)與信息內(nèi)容清楚地分開;
使用簡(jiǎn)單,規(guī)則和易于解析的語(yǔ)法;
消息簡(jiǎn)潔、格式低開銷;
2.CPIM結(jié)構(gòu)
CPIM消息由兩部分構(gòu)成:
第一部分:消息元數(shù)據(jù)Header;
第二部分:消息內(nèi)容;
這兩部分內(nèi)容與按照其Content-type定義的MIME類型封裝,且相互獨(dú)立;相互之間用空格行隔開。
3.CPIM示例
MESSAGE sip:+[email]14448880011@sharetechnote.com[/email];user=phone SIP/2.0
P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.oma.cpm.msg
Contribution-ID: 477b66ae9662e3ad18549bf5dabf9d26d5e707ca
Conversation-ID: 1710887c7ca47dc2c1274c11673eb0df5a604fd3
P-Preferred-Identity: <sip:310410123456789@sharetechnote.com>
Request-Disposition: no-fork
User-Agent: TEST IMS 5.0
CSeq: 1 MESSAGE
Max-Forwards: 70
P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=31041000010000000
Route: <sip:[2001:0:0:1::2]:5060;lr>
a: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.oma.cpm.msg"
c: message/cpim
f: <sip:310410123456789@sharetechnote.com>;tag=1384874566
i: 3712948749@2001::1:88fe:fccf:2870:5dee
l: 322
m: <sip:310410123456789@[2001::1:88fe:fccf:2870:5dee]:5060>;
+sip.instance="<urn:gsma:imei:35469106-056673-0>"
t: <sip:+[email]14448880011@sharetechnote.com[/email];user=phone>
v: SIP/2.0/TCP [2001::1:88fe:fccf:2870:5dee]:5060;branch=z9hG4bK2629405539smg;transport=TCP
From: <sip:310410123456789@sharetechnote.com> // CPIM Message Header
To: <sip:+[email]14448880011@sharetechnote.com[/email];user=phone> // CPIM Message Header
DateTime: 2015-02-17T06:54:27Z // CPIM Message Header
NS: imdn <urn:ietf:params:imdn> // CPIM Name Spage
imdn.Message-ID: PH7qAIV8cgH5
imdn.Disposition-Notification: positive-delivery, display
Content-type: text/plain;charset=UTF-8 // CPIM MIME Header
Content-Length: 15
123456789abcdef // Message Content
4.數(shù)據(jù)Header中字段說(shuō)明
Header | 解釋 | 示例 |
---|
From | 消息的發(fā)送者或發(fā)起者 Indicates the sender or originator of a message. | From: MR SANDERS im:piglet@100akerwood.com |
To | 消息的接收者 Specifies an intended recipient of a message. | To: Depressed Donkey im:eeyore@100akerwood.com |
cc | 可以理解成抄送的目標(biāo)接收者 Indicates a courtesy copy recipient of a message. | cc: Winnie the Pooh im:pooh@100akerwood.com |
DateTime | 消息的發(fā)送時(shí)間Specifies the date and time a message was sent. | DateTime: 2000-12-13T13:40:00-08:00 |
Subject | 消息主題 和 語(yǔ)種描述 | Subject:;lang=en Eeyore’s feeling very depressed today |
NS | 命名空間前綴 Declare a local namespace prefix. | NS: MyAlias mid:MessageFeatures@id.foo.com |
Require | Specify a header or feature that must be implemented by the receiver for correct message processing. | Require: MyFeatures.VitalMessageOption MyFeatures.VitalMessageOption: Confirmation-requested |
原文來(lái)自:http://www.sharetechnote.com/和[url]https://blog.csdn.net/xiaxl/article/details/104718006/[/url]
整理:kangguoying20201005
"5G NSA網(wǎng)絡(luò)接入問(wèn)題排查要點(diǎn)”已在微信公眾號(hào)"跟著老康學(xué)5G"中推出,敬請(qǐng)關(guān)注!