與在其他通信系統(tǒng)中工作原理相同,終端使用IMS進(jìn)行語音通話的第一步就是要先完成注冊(cè);UE通過IMS代理服務(wù)器注冊(cè)到CSCF單元;其注冊(cè)的方式有兩種:
REGISTER sip:test.3gpp.com SIP/2.0
f: <sip:+[email]11234567890@test.3gpp.com[/email]>;tag=2722997041
t: <sip:+[email]11234567890@test.3gpp.com[/email]>
CSeq: 575513373 REGISTER
i: 2722997021_2363003016@2001::21f:29ff:fe7c:8f51
v: SIP/2.0/UDP [2001::21f:29ff:fe7c:8f51]:5060;branch=z9hG4bK656994275
Max-Forwards: 70
m: <sip:+11234567890@[2001::21f:29ff:fe7c:8f51]:5060>
P-Access-Network-Info: 3GPP-E-UTRAN-FDD; utran-cell-id-3gpp=3114800102FFFFFFF
l: 0
Authorization:
Digest uri="sip:test.3gpp.com",
username="[email]001010123456789@test.3gpp.com[/email]",
response="",
realm="test.3gpp.com",
nonce=""
Expires: 7200
首次注冊(cè)可能因參數(shù)與認(rèn)證服務(wù)域名不匹配,收到“代碼錯(cuò)誤”的回復(fù);
Step 2 : 401 UNAUTHORIZED --------------------------------
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP [2001::21f:29ff:fe7c:8f51]:5060;branch=z9hG4bK656994275
From: <sip:+[email]11234567890@test.3gpp.com[/email]>;tag=2722997041
To: <sip:+[email]11234567890@test.3gpp.com[/email]>;tag=T3E04A4B5
Call-ID: 2722997021_2363003016@2001::21f:29ff:fe7c:8f51
CSeq: 575513373 REGISTER
Content-Length: 0
WWW-Authenticate:
Digest realm="test.3gpp.com",
nonce="qlWqVapVqlWqVapVqlWqVUUQA5HEt9VVZ3t1TM221cg=",
qop="auth",
opaque="MTcyMjU3ODA2NDo=SU1TLVNJUCBTZXJ2ZXI=",
algorithm=AKAv1-MD5
P-Associated-URI: <sip:+[email]11234567890@TEST.3GPP.COM[/email]>
P-Associated-URI: <tel:+11234567890>
*STEP2中參數(shù)必須與STEP1中匹配,加密算法需UE支持,否則UE將無法繼續(xù)注冊(cè);
參數(shù)nonce是根據(jù)終端的"RAND + AUTN + Server Specific Data"計(jì)算所得的認(rèn)證數(shù)據(jù);
Step 3 : REGISTER -----------------------------------
REGISTER sip:test.3gpp.com SIP/2.0
f: <sip:+[email]11234567890@test.3gpp.com[/email]>;tag=2722997284
t: <sip:+[email]11234567890@test.3gpp.com[/email]>
CSeq: 575513374 REGISTER
i: 2722997021_2363003016@2001::21f:29ff:fe7c:8f51
v: SIP/2.0/UDP [2001::21f:29ff:fe7c:8f51]:5060;branch=z9hG4bK843051065
Max-Forwards: 70
m: <sip:+11234567890@[2001::21f:29ff:fe7c:8f51]:5060>
P-Access-Network-Info: 3GPP-E-UTRAN-FDD; utran-cell-id-3gpp=3114800102FFFFFFF
l: 0
Authorization:
Digest username="[email]001010123456789@test.3gpp.com[/email]",
realm="test.3gpp.com",
uri="sip:test.3gpp.com",
qop=auth,
nonce="qlWqVapVqlWqVapVqlWqVUUQA5HEt9VVZ3t1TM221cg=",
nc=00000001,
cnonce="11259375",
algorithm=AKAv1-MD5,
response="a3f549b13f477562f4445b7277cd83c1",
opaque="MTcyMjU3ODA2NDo=SU1TLVNJUCBTZXJ2ZXI="
Expires: 7200
*Expires:為本次注冊(cè)有效時(shí)間,超時(shí)后需要更新
Step 4 : 200 OK -----------------------------------
SIP/2.0 200 OK
Via: SIP/2.0/UDP [2001::21f:29ff:fe7c:8f51]:5060;branch=z9hG4bK843051065
From: <sip:+[email]11234567890@test.3gpp.com[/email]>;tag=2722997284
To: <sip:+[email]11234567890@test.3gpp.com[/email]>;tag=T44F6AE74
Call-ID: 2722997021_2363003016@2001::21f:29ff:fe7c:8f51
CSeq: 575513374 REGISTER
Contact: <sip:+11234567890@[2001::21f:29ff:fe7c:8f51]:5060>;q=0.500;expires = 7200
Content-Length: 0
Date: Mon, 22 Apr 2013 15:43:15 GMT
Authentication-Info:
qop=auth,
rspauth="a3f549b13f477562f4445b7277cd83c1",
cnonce="11259375",
nc=00000001
P-Associated-URI: <sip:+[email]11234567890@TEST.3GPP.COM[/email]>
P-Associated-URI: <tel:+11234567890>
P-Associated-URI: <sip:+[email]11234567890@TEST.3GPP.COM[/email]>
P-Associated-URI: <tel:+11234567890>