(1)登记, 发起和定位用户.
(2) 进行媒体协商 --通常采用SDP方式来携带媒体参数.
(3)由被叫方来决定是否接纳该呼叫.
(4)呼叫媒体流建立并交互.
(5)呼叫更改或处理.
(6)呼叫终止.
2.Registration - 登记
每当用户打开SIP终端时(如PC,IP PHONE), 将向*****/登记服务器发起登记过程
登记过程需要周期刷新
登记服务器将把SIP终端所登记的信息传送到位置服务器存放.
REGISTER sip:bell-tel.com SIP/2.0
Via: SIP/2.0/UDP saturn.bell-tel.com
From: sip:[email protected]
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 1 REGISTER
Contact: <sip:[email protected] tel.com:3890;transport=udp>
Expires: 7200
3.简单的 SIP 呼叫建立和拆除流程图
1. INVITE sip:[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>
Call-ID: [email protected]
CSeq: 1 INVITE
Contact: <sip:[email protected];user=phone;transport=udp>
User-Agent: Cisco ATA v2.11 ata186 (0803a)
Expires: 300
Content-Length: 245
Content-Type: application/sdp
v=0
o=02120001 573 573 IN IP4 100.1.0.252
s=ATA186 Call
c=IN IP4 100.1.0.252
t=0 0
m=audio 10000 RTP/AVP 0 4 8 101
a=rtpmap:0 PCMU/8000/1
a=rtpmap:4 G723/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
2. SIP/2.0 100 Trying
Via: SIP/2.0/UDP 100.1.0.252
Call-ID: [email protected]
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>
CSeq: 1 INVITE
Content-Length: 0
3. INVITE sip:[email protected]:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 100.1.0.25:5060;branch=beb4b540-65a2ea80-f79d94fd-6870ff45-1
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>
Call-ID: [email protected]
CSeq: 1 INVITE
Contact: <sip:[email protected];user=phone;transport=udp>
User-Agent: Cisco ATA v2.11 ata186 (0803a)
Expires: 300
Content-Length: 245
Content-Type: application/sdp
v=0
o=02120001 573 573 IN IP4 100.1.0.252
s=ATA186 Call
c=IN IP4 100.1.0.252
t=0 0
m=audio 10000 RTP/AVP 0 4 8 101
a=rtpmap:0 PCMU/8000/1
a=rtpmap:4 G723/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
4. SIP/2.0 100 Trying
Via: SIP/2.0/UDP 100.1.0.25:5060;branch=beb4b540-65a2ea80-f79d94fd-6870ff45-1
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>
Call-ID: [email protected]
CSeq: 1 INVITE
Content-Length: 0
5. INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 100.2.0.2:5060
Via: SIP/2.0/UDP 100.1.0.25:5060;branch=beb4b540-65a2ea80-f79d94fd-6870ff45-1
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>
CSeq: 1 INVITE
Call-ID: [email protected]
Content-Length: 245
Contact: <sip:[email protected];transport=udp;user=phone>
Content-Type: application/sdp
Expires: 300
User-Agent: Cisco ATA v2.11 ata186 (0803a)
Record-Route: <sip:[email protected]:5060;maddr=100.2.0.2>
v=0
o=02120001 573 573 IN IP4 100.1.0.252
s=ATA186 Call
c=IN IP4 100.1.0.252
t=0 0
m=audio 10000 RTP/AVP 0 4 8 101
a=rtpmap:0 PCMU/8000/1
a=rtpmap:4 G723/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
6. SIP/2.0 100 Trying
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>;tag=14502
Call-Id: [email protected]
Cseq: 1 INVITE
Via: SIP/2.0/UDP 100.2.0.2:5060
Via: SIP/2.0/UDP 100.1.0.25:5060;branch=beb4b540-65a2ea80-f79d94fd-6870ff45-1
Via: SIP/2.0/UDP 100.1.0.252
Contact: sip:[email protected]
User-Agent: Pingtel/1.1.1 (VxWorks)
Content-Length: 0
7. SIP/2.0 180 Ringing
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>;tag=14502
Call-Id: [email protected]
Cseq: 1 INVITE
Via: SIP/2.0/UDP 100.2.0.2:5060
Via: SIP/2.0/UDP 100.1.0.25:5060;branch=beb4b540-65a2ea80-f79d94fd-6870ff45-1
Via: SIP/2.0/UDP 100.1.0.252
Contact: sip:[email protected]
User-Agent: Pingtel/1.1.1 (VxWorks)
Content-Length: 0
8. SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 100.1.0.25:5060;branch=beb4b540-65a2ea80-f79d94fd-6870ff45-1
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>;tag=14502
Cseq: 1 INVITE
Call-Id: [email protected]
Content-Length: 0
Contact: sip:[email protected]
User-Agent: Pingtel/1.1.1 (VxWorks)
9. SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>;tag=14502
CSeq: 1 INVITE
Call-ID: [email protected]
Content-Length: 0
Contact: sip:[email protected]
User-Agent: Pingtel/1.1.1 (VxWorks)
10. SIP/2.0 200 OK
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>;tag=14502
Call-Id: [email protected]
Cseq: 1 INVITE
Content-Type: application/sdp
Content-Length: 193
Via: SIP/2.0/UDP 100.2.0.2:5060
Via: SIP/2.0/UDP 100.1.0.25:5060;branch=beb4b540-65a2ea80-f79d94fd-6870ff45-1
Via: SIP/2.0/UDP 100.1.0.252
Record-Route: <sip:[email protected]:5060;maddr=100.2.0.2>
Contact: sip:[email protected]
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY
User-Agent: Pingtel/1.1.1 (VxWorks)
v=0
o=Pingtel 5 5 IN IP4 100.2.0.8
s=phone-call
c=IN IP4 100.2.0.8
t=0 0
m=audio 8766 RTP/AVP 0 8 101
a=rtpmap:0 pcmu/8000/1
a=rtpmap:8 pcma/8000/1
a=rtpmap:101 telephone-event/8000/1
11. SIP/2.0 200 OK
Via: SIP/2.0/UDP 100.1.0.25:5060;branch=beb4b540-65a2ea80-f79d94fd-6870ff45-1
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>;tag=14502
Cseq: 1 INVITE
Call-Id: [email protected]
Content-Length: 193
Allow: INVITE
Allow: ACK
Allow: CANCEL
Allow: BYE
Allow: REFER
Allow: OPTIONS
Allow: NOTIFY
Contact: sip:[email protected]
Content-Type: application/sdp
Record-Route: <sip:[email protected]:5060;maddr=100.2.0.2>
User-Agent: Pingtel/1.1.1 (VxWorks)
v=0
o=Pingtel 5 5 IN IP4 100.2.0.8
s=phone-call
c=IN IP4 100.2.0.8
t=0 0
m=audio 8766 RTP/AVP 0 8 101
a=rtpmap:0 pcmu/8000/1
a=rtpmap:8 pcma/8000/1
a=rtpmap:101 telephone-event/8000/1
12. SIP/2.0 200 OK
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>;tag=14502
CSeq: 1 INVITE
Call-ID: [email protected]
Content-Length: 193
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY
Contact: sip:[email protected]
Content-Type: application/sdp
Record-Route: <sip:[email protected]:5060;maddr=100.2.0.2>
User-Agent: Pingtel/1.1.1 (VxWorks)
v=0
o=Pingtel 5 5 IN IP4 100.2.0.8
s=phone-call
c=IN IP4 100.2.0.8
t=0 0
m=audio 8766 RTP/AVP 0 8 101
a=rtpmap:0 pcmu/8000/1
a=rtpmap:8 pcma/8000/1
a=rtpmap:101 telephone-event/8000/1
13. ACK sip:[email protected] SIP/2.0
Route: <sip:[email protected]:5060>
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>;tag=14502
Call-ID: [email protected]
CSeq: 1 ACK
User-Agent: Cisco ATA v2.11 ata186 (0803a)
Content-Length: 0
14. ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 100.1.0.252
From: <sip:[email protected];user=phone>;tag=1981486230
To: <sip:[email protected];user=phone>;tag=14502
CSeq: 1 ACK
Call-ID: [email protected]
Content-Length: 0
User-Agent: Cisco ATA v2.11 ata186 (0803a)
15. OPTIONS sip:[email protected]:5060;maddr=100.2.0.2 SIP/2.0
Route: <sip:[email protected];transport=udp;user=phone>
From: <sip:[email protected];user=phone>;tag=14502
To: <sip:[email protected];user=phone>;tag=1981486230
Call-Id: [email protected]
Cseq: 1 OPTIONS
Accept-Language: en
Supported: sip-cc, sip-cc-01, timer
User-Agent: Pingtel/1.1.1 (VxWorks)
Via: SIP/2.0/UDP 100.2.0.8
Content-Length: 0
16. SIP/2.0 200 Ok
Via: SIP/2.0/UDP 100.2.0.8
From: <sip:[email protected];user=phone>;tag=14502
To: <sip:[email protected];user=phone>;tag=1981486230
Call-ID: [email protected]
Cseq: 1 OPTIONS
Content-Length: 0
17. BYE sip:[email protected]:5060;maddr=100.2.0.2 SIP/2.0
Route: <sip:[email protected];transport=udp;user=phone>
From: <sip:[email protected];user=phone>;tag=14502
To: <sip:[email protected];user=phone>;tag=1981486230
Call-Id: [email protected]
Cseq: 2 BYE
Accept-Language: en
Supported: sip-cc, sip-cc-01, timer
User-Agent: Pingtel/1.1.1 (VxWorks)
Via: SIP/2.0/UDP 100.2.0.8
Content-Length: 0
18. SIP/2.0 200 Ok
Via: SIP/2.0/UDP 100.2.0.8
From: <sip:[email protected];user=phone>;tag=14502
To: <sip:[email protected];user=phone>;tag=1981486230
Call-ID: [email protected]
Cseq: 2 BYE
Content-Length: 0
19. BYE sip:[email protected];transport=udp;user=phone SIP/2.0
Via: SIP/2.0/UDP 100.2.0.2:5060
Via: SIP/2.0/UDP 100.2.0.8
From: <sip:[email protected];user=phone>;tag=14502
To: <sip:[email protected];user=phone>;tag=1981486230
Cseq: 2 BYE
Call-Id: [email protected]
Content-Length: 0
Supported: sip-cc
Supported: sip-cc-01
Supported: timer
Accept-Language: en
User-Agent: Pingtel/1.1.1 (VxWorks)
20. SIP/2.0 200 OK
Via: SIP/2.0/UDP 100.2.0.2:5060
Via: SIP/2.0/UDP 100.2.0.8
From: <sip:[email protected];user=phone>;tag=14502
To: <sip:[email protected];user=phone>;tag=1981486230
Call-Id: [email protected]
Cseq: 2 BYE
Server: Cisco ATA v2.11 ata186 (0803a)
Content-Length: 0