Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
understanding-SIP.pdf
Скачиваний:
113
Добавлен:
01.03.2016
Размер:
3.99 Mб
Скачать

 

356

SIP: Understanding the Session Initiation Protocol

M11

REL CauseCode=16 Normal Clearing

M12

SIP/2.0 200 OK

 

 

Via: SIP/2.0/UDP 8.19.19.06:5060;branch=z9hG4bK321

 

 

From: <sip:filo.farnsworth@television.tv>;tag=12

 

 

To: <sip:+12025551313@gw.carrier.com;user=phone>;tag=37

 

 

Call-ID: 49235243082018498

 

 

CSeq: 3 BYE

M13

RLC

16.4 PSTN to SIP Call Through a Gateway

Figure 16.4 shows a call originating from a telephone in the PSTN that terminates on a SIP phone in the Internet. The compact form of SIP is used throughout the example. Note that there is no compact form for CSeq or Max-Forwards.

M1 Setup

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CdPN=6512345, NPI=E.164

 

 

 

 

 

 

Dialed telephone number

 

NOA=International

 

 

 

 

 

 

 

CgPN=4567890, NPI=E.164,

 

 

 

 

 

 

 

 

PSTN caller’s number

 

NOA=International

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 16.4 PSTN to SIP call flow through a gateway.

 

 

Call Flow Examples

357

M2

INVITE sip:+6512345@incoming.com;user=phone SIP/2.0

 

 

v: SIP/2.0/UDP 65.3.4.1:5060;branch=z9hG4bK343

Compact form of

 

 

Max-Forwards: 70

headers includes tag

 

 

f: <sip:+45.67890@incoming.com;user=phone>;tag=6a589b1

 

 

t: <sip:+65.12345@incoming.com;user=phone>

 

 

 

i: a3-65-99-1d

 

 

 

CSeq: 1 INVITE

 

 

 

m: 65.3.4.1

 

 

 

c: application/sdp

 

 

 

l: 126

 

 

 

v=0

 

 

 

o=- 2890844535 2890844535 IN IP4 65.3.4.1

 

 

 

s=-

 

 

 

t=0 0

 

 

 

c=IN IP4 65.3.4.1

 

 

 

m=audio 62432 RTP/AVP 0

 

 

 

a=rtpmap:0 PCMU/8000

 

M3

SIP/2.0 100 Trying

 

 

 

v: SIP/2.0/UDP 65.3.4.1:5060;branch=z9hG4bK343

 

 

 

f: <sip:+45.67890@incoming.com;user=phone>;tag=6a589b1

 

 

t: sip:+65.12345@incoming.com;user=phone

 

 

 

i: a3-65-99-1d

 

 

 

CSeq: 1 INVITE

 

M4

Service Query: +65-12345

 

M5

Location Service Response:

Number maps to SIP URI

 

 

sip:user@home.com

M6

INVITE sip:user@home.com SIP/2.0

 

 

 

v: SIP/2.0/UDP 176.5.8.2:5060;branch=z9hG4bK942834822.1

 

 

v: SIP/2.0/UDP 65.3.4.1:5060;branch=z9hG4bK343

 

 

 

Max-Forwards: 69

 

 

 

f: <sip:+45.67890@incoming.com;user=phone>;tag=6a589b1

 

 

t: sip:+65.12345@incoming.com;user=phone

 

 

 

i: a3-65-99-1d

 

 

 

CSeq: 1 INVITE

 

 

 

m: 65.3.4.1

 

 

 

c: application/sdp

 

 

 

l: 126

 

 

 

v=0

 

 

 

o=- 2890844535 2890844535 IN IP4 65.3.4.1

 

 

 

s=-

 

 

 

t=0 0

 

 

 

c=IN IP4 65.3.4.1

 

 

 

m=audio 62432 RTP/AVP 0

 

 

 

a=rtpmap:0 PCMU/8000

 

M7

SIP/2.0 180 Ringing

 

 

 

v: SIP/2.0/UDP 176.5.8.2:5060;branch=z9hG4bK942834822.1

 

 

v: SIP/2.0/UDP 65.3.4.1:5060;branch=z9hG4bK343

 

 

 

f: <sip:+45.67890@incoming.com;user=phone>;tag=6a589b1

 

 

t: <sip:+65.12345@incoming.com;user=phone>;tag=8657

 

 

i: a3-65-99-1d

 

 

 

m: sip:user@client.home.com

 

 

 

CSeq: 1 INVITE

 

 

358

SIP: Understanding the Session Initiation Protocol

M8

SIP/2.0 180 Ringing

 

 

v: SIP/2.0/UDP 65.3.4.1:5060;branch=z9hG4bK343

 

 

f: <sip:+45.67890@incoming.com;user=phone>;tag=6a589b1

 

 

t: <sip:+65.12345@incoming.com;user=phone>;tag=8657

 

 

i: a3-65-99-1d

 

 

CSeq: 1 INVITE

M9

Alerting

M10

SIP/2.0 200 OK

 

 

v: SIP/2.0/UDP 176.5.8.2:5060;branch=z9hG4bK942834822.1

 

 

v: SIP/2.0/UDP 65.3.4.1:5060;branch=z9hG4bK343

 

 

f: <sip:+45.67890@incoming.com;user=phone>;tag=6a589b1

 

 

t: <sip:+65.12345@incoming.com;user=phone>;tag=8657

 

 

i: a3-65-99-1d

 

 

CSeq: 1 INVITE

 

 

m: sip:user@client.home.com

 

 

c: application/sdp

 

 

l: 125

 

 

v=0

 

 

o=- 2890844565 2890844565 IN IP4 7.8.9.10

 

 

s=-

 

 

t=0 0

 

 

c=IN IP4 7.8.9.10

 

 

m=audio 5004 RTP/AVP 0

 

 

a=rtpmap:0 PCMU/8000

M11

SIP/2.0 200 OK

 

 

v: SIP/2.0/UDP 65.3.4.1:5060;branch=z9hG4bK343

 

 

f: <sip:+45.67890@incoming.com;user=phone>;tag=6a589b1

 

 

t: <sip:+65.12345@incoming.com;user=phone>;tag=8657

 

 

i: a3-65-99-1d

 

 

CSeq: 1 INVITE

 

 

M: sip:user@home.com

 

 

c: application/sdp

 

 

l: 125

 

 

v=0

 

 

o=- 2890844565 2890844565 IN IP4 7.8.9.10

 

 

s=-

 

 

t=0 0

 

 

c=IN IP4 7.8.9.10

 

 

m=audio 5004 RTP/AVP 0

 

 

a=rtpmap:0 PCMU/8000

M12

Connect

M13

ACK sip:user@home.com SIP/2.0

 

 

v: SIP/2.0/UDP 65.3.4.1:5060;branch=z9hG4bK453

 

 

Max-Forwards: 70

 

 

f: <sip+45.67890@incoming.com;user=phone>;tag=6a589b1

 

 

t: <sip+65.12345@incoming.com;user=phone>;tag=8657

 

 

i: a3-65-99-1d

 

 

CSeq: 1 ACK

Call Flow Examples

359

16.5 Parallel Search

In this example the caller receives multiple possible locations for the called party from a redirect server. Instead of trying the locations one at a time, the UA implements a parallel search for the called party by simultaneously sending the INVITE to three different locations, as shown in Figure 16.5. The SIP specification gives an example of this behavior in a proxy server, which is called a forking proxy.

In this example the first location responds with a 404 Not Found response. The second location responds with a 180 Ringing response, while the third location returns a 180 Ringing then a 200 OK response. The caller then sends an ACK to the third location to establish the call. Because one successful response has been received, a CANCEL is sent to the second location to terminate the search.

Figure 16.5 Parallel search example call flow.

360

SIP: Understanding the Session Initiation Protocol

The second location sends a 200 OK to the CANCEL and a 487 Request Terminated to the INVITE. This example shows some customized reason phrases in messages M7, M10, and M11. This example also shows a Call-ID with an IP address which is not recommended.

M1

INVITE sip:faraday@effect.org SIP/2.0

 

 

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK3 Port

 

;received=7.9.18.12

60000 is used

 

Max-Forwards: 70

 

 

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk>;

 

tag=4

 

 

To: <sip:faraday@effect.org>

 

 

Call-ID: mNjdwWjkBfWrd@7.9.18.12

CSeq initialized to 54

 

CSeq: 54 INVITE

 

Contact:<sip:james.maxwell@kings.cambridge.edu.uk>

 

Content-Type: application/sdp

 

 

Content-Length: 129

 

 

v=0

 

 

o=max 2890844521 2890844521 IN IP4 7.9.18.12

 

s=-

 

 

t=0 0

 

 

c=IN IP4 7.9.18.12

 

 

m=audio 32166 RTP/AVP 96

 

 

a=rtpmap:96 iLBC/8000

 

M2

SIP/2.0 300 Multiple locations

Redirect server returns three locations

 

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK3

 

;received=7.9.18.12

 

 

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk>

 

;tag=4

 

 

To:<sip:faraday@effect.org>;tag=1024

 

 

Call-ID: mNjdwWjkBfWrd@7.9.18.12

 

 

CSeq: 54 INVITE

 

 

Contact: <sip:faraday@lab.royalsoc.gb>

 

 

Contact: <sip:+44.555.1212@sip-phone.effect.org;user=phone>

 

Contact: <sip:michael.faraday@commonroom.club.gb>

M3

ACK sip:faraday@effect.org

 

 

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK3

 

Max-Forwards: 70

 

 

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk>

 

;tag=4

 

 

To: <sip:faraday@effect.org>;tag=1024

 

 

Call-ID: mNjdwWjkBfWrd@7.9.18.12

 

 

CSeq: 54 INVITE

 

M4

INVITE sip:faraday@lab.royalsoc.gb SIP/2.0

 

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK1

 

Max-Forwards: 70

 

 

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk>

 

;tag=5

Tag is not copied

 

To: <sip:faraday@effect.org>

 

Call-ID: mNjdwWjkBfWrd@7.9.18.12

Call-ID unchanged

 

CSeq: 55 INVITE

CSeq incremented

Contact: <sip:james.maxwell@kings.cambridge.edu.uk>

Content-Type: application/sdp

Call Flow Examples

361

Content-Length: 129

v=0

o=max 2890844521 2890844521 IN IP4 7.9.18.12 s=-

t=0 0

c=IN IP4 7.9.18.12 m=audio 32166 RTP/AVP 96 a=rtpmap:96 iLBC/8000

M5 INVITE sip:+44.555.1212@sip-phone.effect.org;user=phone SIP/2.0 Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK2 Max-Forwards: 70

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk> ;tag=5

To: <sip:faraday@effect.org> Call-ID: mNjdwWjkBfWrd@7.9.18.12 CSeq: 55 INVITE

Contact: <sip:james.maxwell@kings.cambridge.edu.uk> Content-Type: application/sdp

Content-Length: 129

v=0

o=max 2890844521 2890844521 IN IP4 7.9.18.12 s=-

t=0 0

c=IN IP4 7.9.18.12 m=audio 32166 RTP/AVP 96 a=rtpmap:96 iLBC/8000

M6 INVITE sip:faraday@commonroom.club.gb SIP/2.0

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK3 Max-Forwards: 70

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk> ;tag=5

To: <sip:faraday@effect.org> Call-ID: mNjdwWjkBfWrd@7.9.18.12 CSeq: 55 INVITE

Contact: <sip:james.maxwell@kings.cambridge.edu.uk> Content-Type: application/sdp

Content-Length: 129

v=0

o=max 2890844521 2890844521 IN IP4 7.9.18.12 s=-

t=0 0

c=IN IP4 7.9.18.12 m=audio 32166 RTP/AVP 96 a=rtpmap:96 iLBC/8000

M7 SIP/2.0 404 The member you have requested is not available Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK1 ;received=7.9.18.12

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk> ;tag=5

To: <sip:faraday@effect.org>;tag=f6 Call-ID: mNjdwWjkBfWrd@7.9.18.12 CSeq: 55 INVITE

 

362

SIP: Understanding the Session Initiation Protocol

M8

ACK sip:faraday@lab.royalsoc.gb SIP/2.0

 

 

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000z9hG4bK1

 

 

Max-Forwards: 70

 

 

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk>

 

 

;tag=5

 

 

To: <sip:faraday@effect.org>;tag=f6

 

 

Call-ID: mNjdwWjkBfWrd@7.9.18.12

 

 

CSeq: 55 ACK

M9

SIP/2.0 180 Ringing

 

 

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK2

 

 

;received=7.9.18.12

 

 

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk>

 

 

;tag=5

 

 

To: <sip:faraday@effect.org>;tag=6321

 

 

Call-ID: mNjdwWjkBfWrd@7.9.18.12

 

 

Contact: <sip:+44.555.1212@sip-phone.effect.org>

 

 

CSeq: 55 INVITE

M10

SIP/2.0 180 Please wait while we locate Mr. Faraday

 

 

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK3

 

 

;received=7.9.18.12

 

 

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk>

 

 

;tag=5

 

 

To: <sip:faraday@effect.org>;tag=531

 

 

Call-ID: mNjdwWjkBfWrd@7.9.18.12

 

 

Contact: <sip:faraday@commonroom.club.gb>

 

 

CSeq: 55 INVITE

M11

SIP/2.0 200 Mr. Faraday at your service?

 

 

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK3

 

 

;received=7.9.18.12

 

 

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk>

 

 

;tag=5

 

 

To: <sip:faraday@effect.org>;tag=531

 

 

Call-ID: mNjdwWjkBfWrd@7.9.18.12

 

 

CSeq: 55 INVITE

 

 

User-Agent: PDV/v4

 

 

Contact: <sip:faraday@commonroom.club.gb>

 

 

Content-Type: application/sdp

 

 

Content-Length: 131

 

 

v=0

 

 

o=max 2890844521 2890844521 IN IP4 6.22.17.89

 

 

t=0 0

 

 

c=IN IP4 6.22.17.89

 

 

m=audio 43782 RTP/AVP 4

 

 

a=rtpmap:4 DVI/8000

M12

ACK sip:faraday@commonroom.club.gb;user=ip SIP/2.0

 

 

Via: SIP/2.0/UDP kings.cambridge.edu.uk:60000;branch=z9hG4bK3

 

 

Max-Forwards: 70

 

 

From: J.C. Maxwell <sip:james.maxwell@kings.cambridge.edu.uk>

 

 

;tag=5

 

 

To: <sip:faraday@effect.org>;tag=531

 

 

Call-ID: mNjdwWjkBfWrd@7.9.18.12

 

 

CSeq: 55 ACK

M13 CANCEL sip:+44.555.1212@sip-phone.effect.org;user=phone SIP/2.0