PRACK是SIP消息中保证临时消息(101-199)可靠传输的机制。为达到该目的,UAC有两种选择,在inivite消息中加入Require:100rel或者Supported:100rel。UAS在接受到上述消息中,也存在选择的问题。
如果SIP UAC支持PRACK,则应该在INVITE消息的Allow字段携带PRACK,同时要在Suppoted字段中携带100rel,如果被叫回复的1XX临时响应中(一般是183)携带有Require: 100rel和RSeq字段,收到UAS回复的1XX消息的UAC应该发送PRACK,否则不发送不发送PRACK字段。
当Inivte中含有Require:100rel。UAS如果不支持PRACK需要使用420(不正确的扩展)来拒绝呼叫。否则临时消息中加入Require:100rel和Rseq字段,接到该消息UAC发送PRACK。
下面为其中的一个具体示例:
INVITE sip:+8699999@ims.ge.xxxx.com;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK78BB08C70016d07401a8c0
From: "WIN226069200927" <sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>
CSeq: 1 INVITE
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
Contact: <sip:+8699999@192.168.1.116:5060;transport=tcp>;+sip.instance="<urn:uuid:22de3a79-ebe0-435b-9077-b5d9bfb95e02>"
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,UPDATE,REFER
Resource-Priority: dsn-000000.0
User-Agent: Polycom RealPresence Desktop for Windows (3.9.0.69889)
Supported: 100rel,timer,replaces,resource-priority
MRD: MRE; MRC-V=1.0.1
Multiplexing: EP
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 2165
v=0
o=- 1602753082 1602753082 IN IP4 192.168.1.116
s=MRD=MRE MRC-V=1.0.1
c=IN IP4 192.168.1.116
b=AS:1024
t=0 0
a=sendrecv
a=vnd.polycom.MBA.p2p:v=1.0.1
m=audio 3230 RTP/AVP 118 115 114 9 102 113 101 103 0 8 15 18 119
a=sendrecv
a=rtpmap:118 SIRENLPR/48000/1
a=fmtp:118 bitrate=64000
a=rtpmap:115 G7221/32000
a=fmtp:115 bitrate=48000
a=rtpmap:114 G7221/32000
a=fmtp:114 bitrate=32000
a=rtpmap:9 G722/8000
a=fmtp:9 bitrate=64000
a=rtpmap:102 G7221/16000
a=fmtp:102 bitrate=32000
a=rtpmap:113 G7221/32000
a=fmtp:113 bitrate=24000
a=rtpmap:101 G7221/16000
a=fmtp:101 bitrate=24000
a=rtpmap:103 G7221/16000
a=fmtp:103 bitrate=16000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:15 G728/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:119 telephone-event/8000
a=fmtp:119 0-15
m=video 3232 RTP/AVP 111 109 110 96 34 31 106 105 116
a=sendrecv
a=rtcp-fb:* nack pli
a=rtcp-fb:* ccm fir
a=rtcp-fb:* ccm tmmbr
a=vnd.polycom.forceVideoMode:9
a=rtpmap:111 H264/90000
a=fmtp:111 profile-level-id=64001f; packetization-mode=1; max-br=20010; sar=13
a=vnd.polycom.avcplus.p2p:111 max-temp-layer-p2p=3
a=rtpmap:109 H264/90000
a=fmtp:109 profile-level-id=42801f; max-br=20010; sar=13
a=vnd.polycom.avcplus.p2p:109 max-temp-layer-p2p=3
a=rtpmap:110 H264/90000
a=fmtp:110 profile-level-id=42801f; packetization-mode=1; max-br=20010; sar=13
a=vnd.polycom.avcplus.p2p:110 max-temp-layer-p2p=3
a=rtpmap:96 H263-1998/90000
a=fmtp:96 CIF4=1;CIF=1;QCIF=1;SQCIF=1;CUSTOM=352,240,1;CUSTOM=704,480,1;CUSTOM=1024,768,1;CUSTOM=800,600,1;CUSTOM=640,480,1;T
a=rtpmap:34 H263/90000
a=fmtp:34 CIF4=1;CIF=1;QCIF=1;SQCIF=1
a=rtpmap:31 H261/90000
a=fmtp:31 CIF=1;QCIF=1
a=rtpmap:106 H264-SVC/90000
a=fmtp:106 profile-level-id=56001f; packetization-mode=1; max-br=20010; sar=13
a=rtpmap:105 H264-SVC/90000
a=fmtp:105 profile-level-id=53e01f; packetization-mode=1; max-br=20010; sar=13
a=rtpmap:116 vnd.polycom.lpr/9000
a=fmtp:116 V=2;minPP=0;PP=150;RS=52;RP=10;PS=1400
m=application 3238 UDP/BFCP *
a=sendrecv
a=setup:actpass
a=connection:new
a=floorctrl:c-s
m=application 3236 RTP/AVP 100
a=sendrecv
a=rtpmap:100 H224/4800
SIP/2.0 100 Trying
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK78BB08C70016d07401a8c0;received=122.224.115.1;rport=63649
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
From: "WIN226069200927"<sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>
CSeq: 1 INVITE
Content-Length: 0
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK78BB08C70016d07401a8c0;received=122.224.115.1;rport=63649
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
From: "WIN226069200927"<sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>;tag=y8bhldlx
CSeq: 1 INVITE
Proxy-Authenticate: Digest realm="ims.ge.xxxxx.com",nonce="4kdfCTFDN2yxatf535ld3A==",algorithm=MD5,qop="auth"
Warning: 399 38002.588.S.261.5.105.0.17.34315.0.0.ge.chinamobile.com "Proxy authentication required"
Reason: Q.850;cause=21,SIP;cause=407
Content-Length: 0
ACK sip:+8699999@ims.ge.xxxxx.com;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK78BB08C70016d07401a8c0
From: "WIN226069200927" <sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>;tag=y8bhldlx
CSeq: 1 ACK
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
Contact: <sip:+861099999@192.168.1.116:5060;transport=tcp>;+sip.instance="<urn:uuid:22de3a79-ebe0-435b-9077-b5d9bfb95e02>"
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,UPDATE,REFER
User-Agent: Polycom RealPresence Desktop for Windows (3.9.0.69889)
Max-Forwards: 70
Content-Length: 0
INVITE sip:+8699999@ims.ge.xxxxx.com;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK2CEFE14B0016d07401a8c0
From: "WIN226069200927" <sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>
CSeq: 2 INVITE
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
Contact: <sip:+861099999@192.168.1.116:5060;transport=tcp>;+sip.instance="<urn:uuid:22de3a79-ebe0-435b-9077-b5d9bfb95e02>"
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,UPDATE,REFER
Resource-Priority: dsn-000000.0
User-Agent: Polycom RealPresence Desktop for Windows (3.9.0.69889)
Supported: 100rel,timer,replaces,resource-priority
MRD: MRE; MRC-V=1.0.1
Multiplexing: EP
Proxy-Authorization: Digest username="861099999@ims.ge.xxxxx.com", realm="ims.ge.xxxxx.com", nonce="4kdfCTFDN2yxatf535ld3A==", qop=auth, cnonce="XsWKG9GNC0fKzpn", nc=00000001, uri="sip:+8699999@ims.ge.xxxxx.com;transport=tcp", response="6e17335fb50cba9cfdef9b1c6b54aaf6", algorithm=MD5
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 2165
v=0
o=- 1602753082 1602753082 IN IP4 192.168.1.116
s=MRD=MRE MRC-V=1.0.1
c=IN IP4 192.168.1.116
b=AS:1024
t=0 0
a=sendrecv
a=vnd.polycom.MBA.p2p:v=1.0.1
m=audio 3230 RTP/AVP 118 115 114 9 102 113 101 103 0 8 15 18 119
a=sendrecv
a=rtpmap:118 SIRENLPR/48000/1
a=fmtp:118 bitrate=64000
a=rtpmap:115 G7221/32000
a=fmtp:115 bitrate=48000
a=rtpmap:114 G7221/32000
a=fmtp:114 bitrate=32000
a=rtpmap:9 G722/8000
a=fmtp:9 bitrate=64000
a=rtpmap:102 G7221/16000
a=fmtp:102 bitrate=32000
a=rtpmap:113 G7221/32000
a=fmtp:113 bitrate=24000
a=rtpmap:101 G7221/16000
a=fmtp:101 bitrate=24000
a=rtpmap:103 G7221/16000
a=fmtp:103 bitrate=16000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:15 G728/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:119 telephone-event/8000
a=fmtp:119 0-15
m=video 3232 RTP/AVP 111 109 110 96 34 31 106 105 116
a=sendrecv
a=rtcp-fb:* nack pli
a=rtcp-fb:* ccm fir
a=rtcp-fb:* ccm tmmbr
a=vnd.polycom.forceVideoMode:9
a=rtpmap:111 H264/90000
a=fmtp:111 profile-level-id=64001f; packetization-mode=1; max-br=20010; sar=13
a=vnd.polycom.avcplus.p2p:111 max-temp-layer-p2p=3
a=rtpmap:109 H264/90000
a=fmtp:109 profile-level-id=42801f; max-br=20010; sar=13
a=vnd.polycom.avcplus.p2p:109 max-temp-layer-p2p=3
a=rtpmap:110 H264/90000
a=fmtp:110 profile-level-id=42801f; packetization-mode=1; max-br=20010; sar=13
a=vnd.polycom.avcplus.p2p:110 max-temp-layer-p2p=3
a=rtpmap:96 H263-1998/90000
a=fmtp:96 CIF4=1;CIF=1;QCIF=1;SQCIF=1;CUSTOM=352,240,1;CUSTOM=704,480,1;CUSTOM=1024,768,1;CUSTOM=800,600,1;CUSTOM=640,480,1;T
a=rtpmap:34 H263/90000
a=fmtp:34 CIF4=1;CIF=1;QCIF=1;SQCIF=1
a=rtpmap:31 H261/90000
a=fmtp:31 CIF=1;QCIF=1
a=rtpmap:106 H264-SVC/90000
a=fmtp:106 profile-level-id=56001f; packetization-mode=1; max-br=20010; sar=13
a=rtpmap:105 H264-SVC/90000
a=fmtp:105 profile-level-id=53e01f; packetization-mode=1; max-br=20010; sar=13
a=rtpmap:116 vnd.polycom.lpr/9000
a=fmtp:116 V=2;minPP=0;PP=150;RS=52;RP=10;PS=1400
m=application 3238 UDP/BFCP *
a=sendrecv
a=setup:actpass
a=connection:new
a=floorctrl:c-s
m=application 3236 RTP/AVP 100
a=sendrecv
a=rtpmap:100 H224/4800
SIP/2.0 100 Trying
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK2CEFE14B0016d07401a8c0;received=122.224.115.1;rport=63649
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
From: "WIN226069200927"<sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>
CSeq: 2 INVITE
Content-Length: 0
SIP/2.0 183 Session Progress
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK2CEFE14B0016d07401a8c0;received=122.224.115.1;rport=63649
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
From: "WIN226069200927"<sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>;tag=3758
CSeq: 2 INVITE
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,REGISTER,INFO,PRACK,SUBSCRIBE,NOTIFY,UPDATE,MESSAGE,REFER,PUBLISH
Contact: <sip:103.212.118.1:5060;transport=tcp;did=mdxbu1-1602734578610;Hpt=8e72_16;CxtId=3;TRC=ffffffff-ffffffff>;servhuawei
Require: 100rel,100rel
RSeq: 1
P-Early-Media: gated
Content-Length: 304
Content-Type: application/sdp
v=0
o=- 1073768536 1073768536 IN IP4 103.212.118.2
s=SBC call
b=AS:1024
t=0 0
m=audio 22962 RTP/AVP 0 119
c=IN IP4 103.20.114.2
a=rtpmap:0 PCMU/8000
a=rtpmap:119 telephone-event/8000
a=ptime:20
m=video 22964 RTP/AVP 34
c=IN IP4 103.20.114.2
a=rtpmap:34 H263/90000
a=fmtp:34 CIF=1/MaxBR=3840
PRACK sip:103.212.118.1:5060;transport=tcp;did=mdxbu1-1602734578610;Hpt=8e72_16;CxtId=3;TRC=ffffffff-ffffffff SIP/2.0
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK26A1A7D50016d07401a8c0
From: "WIN226069200927" <sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>;tag=3758
CSeq: 3 PRACK
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
Contact: <sip:+861099999@192.168.1.116:5060;transport=tcp>;+sip.instance="<urn:uuid:22de3a79-ebe0-435b-9077-b5d9bfb95e02>"
User-Agent: Polycom RealPresence Desktop for Windows (3.9.0.69889)
RAck: 1 2 INVITE
Proxy-Authorization: Digest username="861099999@ims.ge.xxxxx.com", realm="ims.ge.xxxxx.com", nonce="4kdfCTFDN2yxatf535ld3A==", qop=auth, cnonce="XsWKG9GNC0fKzpn", nc=00000002, uri="sip:+8699999@ims.ge.xxxxx.com;transport=tcp", response="452202ddc18b1b933e7f1d76ee9d0fce", algorithm=MD5
Max-Forwards: 70
Content-Length: 0
SIP/2.0 200 OK
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK26A1A7D50016d07401a8c0;received=122.224.115.1;rport=63649
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
From: "WIN226069200927"<sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>;tag=3758
CSeq: 3 PRACK
Content-Length: 0
SIP/2.0 200 OK
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bK2CEFE14B0016d07401a8c0;received=122.224.115.1;rport=63649
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
From: "WIN226069200927"<sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>;tag=3758
CSeq: 2 INVITE
Authentication-Info: nextnonce="WObta02snlkVDH6OeTYUIQ==",qop=auth,rspauth="ae61b08697e936d7a1a0420ac6374eaa",cnonce="XsWKG9GNC0fKzpn",nc=00000001
Contact: <sip:103.212.118.1:5060;transport=tcp;did=mdxbu1-1602734578610;Hpt=8e72_16;CxtId=3;TRC=ffffffff-ffffffff>;servhuawei
Require: timer
Session-Expires: 1800;refresher=uac
Content-Length: 0
ACK sip:103.212.118.1:5060;transport=tcp;did=mdxbu1-1602734578610;Hpt=8e72_16;CxtId=3;TRC=ffffffff-ffffffff SIP/2.0
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bKACF8216C0016d07401a8c0
From: "WIN226069200927" <sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>;tag=3758
CSeq: 2 ACK
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
Contact: <sip:+861099999@192.168.1.116:5060;transport=tcp>;+sip.instance="<urn:uuid:22de3a79-ebe0-435b-9077-b5d9bfb95e02>"
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,UPDATE,REFER
User-Agent: Polycom RealPresence Desktop for Windows (3.9.0.69889)
Max-Forwards: 70
Content-Length: 0
BYE sip:103.212.118.1:5060;transport=tcp;did=mdxbu1-1602734578610;Hpt=8e72_16;CxtId=3;TRC=ffffffff-ffffffff SIP/2.0
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bKCDF6648F0016d07401a8c0
From: "WIN226069200927" <sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>;tag=3758
CSeq: 4 BYE
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
Contact: <sip:+861099999@192.168.1.116:5060;transport=tcp>;+sip.instance="<urn:uuid:22de3a79-ebe0-435b-9077-b5d9bfb95e02>"
User-Agent: Polycom RealPresence Desktop for Windows (3.9.0.69889)
Max-Forwards: 70
Content-Length: 0
SIP/2.0 200 OK
Via: SIP/2.0/TCP 192.168.1.116:5060;branch=z9hG4bKCDF6648F0016d07401a8c0;received=122.224.115.1;rport=63649
Call-ID: e7e2e738-1017a271-35fd09c6@192.168.1.116
From: "WIN226069200927"<sip:+861099999@ims.ge.xxxxx.com>;tag=3C4B6CC4-47FC1DCD
To: <sip:+8699999@ims.ge.xxxxx.com>;tag=3758
CSeq: 4 BYE
Content-Length: 0