2013년 3월 6일 수요일

Asterisk 11 에서 TLS 와 SRTP 를 정상적으로 돌린 예

오류를 만났을 때를 대비해 올려 둔다


Client A ( 1000 ) <--> Asterisk ( TLS, SRTP ) <--> Client B ( 1001 )

Client A IP : 192.168.1.151
Client B IP : 192.168.1.131
Asterisk IP : 192.168.1.106

<--- SIP read from TLS:192.168.1.151:58418 --->
INVITE sip:1001@192.168.1.106:5061;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b295a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 5 INVITE
Contact: <sip:1000@192.168.1.151:5062;transport=tls>
Content-Type: application/sdp
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Max-Forwards: 70
Supported: 100rel, replaces, from-change
User-Agent: SIPPER for PhonerLite
P-Preferred-Identity: <sip:1000@192.168.1.106>
Content-Length: 365

v=0
o=- 3664105484 1 IN IP4 192.168.1.151
s=SIPPER for PhonerLite
c=IN IP4 192.168.1.151
t=0 0
m=audio 5062 RTP/SAVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:ZHXu5KBoj8MK32CKMJgQv6IyCaDCJGsxjaP3heIV
a=encryption:optional
a=ssrc:2834382215
a=sendrecv
<------------->
--- (14 headers 14 lines) ---
Sending to 192.168.1.151:58418 (no NAT)
Using INVITE request as basis request - 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
Found peer '1000' for '1000' from 192.168.1.151:58418

<--- Reliably Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b295a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as0c95498a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 5 INVITE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="54692493"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151' in 32000 ms (Method: INVITE)

<--- SIP read from TLS:192.168.1.151:58418 --->
ACK sip:1001@192.168.1.106:5061;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b295a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as0c95498a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 5 ACK
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---

<--- SIP read from TLS:192.168.1.151:58418 --->
INVITE sip:1001@192.168.1.106:5061;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b296a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 INVITE
Contact: <sip:1000@192.168.1.151:5062;transport=tls>
Authorization: Digest username="1000", realm="asterisk", nonce="54692493", uri="sip:1001@192.168.1.106:5061;transport=tls", response="0af5468b1ce97a76e4ad687f79ddd48c", algorithm=MD5
Content-Type: application/sdp
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Max-Forwards: 70
Supported: 100rel, replaces, from-change
User-Agent: SIPPER for PhonerLite
P-Preferred-Identity: <sip:1000@192.168.1.106>
Content-Length: 365

v=0
o=- 3664105484 1 IN IP4 192.168.1.151
s=SIPPER for PhonerLite
c=IN IP4 192.168.1.151
t=0 0
m=audio 5062 RTP/SAVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:ZHXu5KBoj8MK32CKMJgQv6IyCaDCJGsxjaP3heIV
a=encryption:optional
a=ssrc:2834382215
a=sendrecv
<------------->
--- (15 headers 14 lines) ---
Sending to 192.168.1.151:58418 (NAT)
Using INVITE request as basis request - 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
Found peer '1000' for '1000' from 192.168.1.151:58418
  == Using SIP RTP CoS mark 5
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw), peer - audio=(ulaw|alaw)/video=(nothing)/text=(nothing), combined - (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.1.151:5062
Looking for 1001 in default (domain 192.168.1.106)
list_route: hop: <sip:1000@192.168.1.151:5062;transport=tls>

<--- Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 100 Trying
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b296a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 INVITE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:1001@192.168.1.106:5061;transport=TLS>
Content-Length: 0


<------------>
    -- Executing [1001@default:1] NoOp("SIP/1000-00000010", "STRP TEST CALL") in new stack
    -- Executing [1001@default:2] Set("SIP/1000-00000010", "_SIP_SRTP_SDES=1") in new stack
    -- Executing [1001@default:3] Set("SIP/1000-00000010", "_SIPSRTP=enable") in new stack
    -- Executing [1001@default:4] Dial("SIP/1000-00000010", "SIP/1001") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 10452
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 192.168.1.131:1162:
INVITE sip:1001@192.168.1.131:5064;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK62a1d8b9;rport
Max-Forwards: 70
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>
Contact: <sip:1000@192.168.1.106:5061;transport=TLS>
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.2.1
Date: Thu, 07 Mar 2013 05:35:12 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 346

v=0
o=root 1013182859 1013182859 IN IP4 192.168.1.106
s=Asterisk PBX 11.2.1
c=IN IP4 192.168.1.106
t=0 0
m=audio 10452 RTP/SAVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:mMRKpI/m8Km1Of9+Yg+ZXvRhJDbHkpsWkG39TxPd

---
    -- Called SIP/1001

<--- SIP read from TLS:192.168.1.131:1162 --->
SIP/2.0 100 Trying
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK62a1d8b9;rport=5061
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 INVITE
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Server: SIPPER for PhonerLite
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---

<--- SIP read from TLS:192.168.1.131:1162 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK62a1d8b9;rport=5061
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 INVITE
Contact: <sip:1001@192.168.1.131:5064;transport=tls>
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Server: SIPPER for PhonerLite
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
list_route: hop: <sip:1001@192.168.1.131:5064;transport=tls>
    -- SIP/1001-00000011 is ringing

<--- Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b296a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 INVITE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:1001@192.168.1.106:5061;transport=TLS>
Content-Length: 0


<------------>

<--- SIP read from TLS:192.168.1.131:1162 --->
SIP/2.0 200 OK
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK62a1d8b9;rport=5061
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 INVITE
Contact: <sip:1001@192.168.1.131:5064;transport=tls>
Content-Type: application/sdp
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Supported: replaces, from-change
Server: SIPPER for PhonerLite
Content-Length: 341

v=0
o=- 3541565629 1 IN IP4 192.168.1.131
s=SIPPER for PhonerLite
c=IN IP4 192.168.1.131
t=0 0
m=audio 5064 RTP/SAVP 8 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:X8/0CNQMoXIwAHnR83FGV90zS/v2e5CfvEBVIc+f
a=ssrc:519851118
a=sendrecv
<------------->
--- (12 headers 13 lines) ---
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw), peer - audio=(ulaw|alaw)/video=(nothing)/text=(nothing), combined - (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.1.131:5064
list_route: hop: <sip:1001@192.168.1.131:5064;transport=tls>
set_destination: Parsing <sip:1001@192.168.1.131:5064;transport=tls> for address/port to send to
set_destination: set destination to 192.168.1.131:5064
Transmitting (NAT) to 192.168.1.131:1162:
ACK sip:1001@192.168.1.131:5064;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK15518c0a;rport
Max-Forwards: 70
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Contact: <sip:1000@192.168.1.106:5061;transport=TLS>
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 ACK
User-Agent: Asterisk PBX 11.2.1
Content-Length: 0


---
    -- SIP/1001-00000011 answered SIP/1000-00000010
Audio is at 18472
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 200 OK
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b296a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 INVITE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:1001@192.168.1.106:5061;transport=TLS>
Content-Type: application/sdp
Content-Length: 344

v=0
o=root 167695273 167695273 IN IP4 192.168.1.106
s=Asterisk PBX 11.2.1
c=IN IP4 192.168.1.106
t=0 0
m=audio 18472 RTP/SAVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:aZZxOF0pTT+ZX6yqPO+2OFYQSn6NACHVUya5wQQt

<------------>

<--- SIP read from TLS:192.168.1.151:58418 --->
ACK sip:1001@192.168.1.106:5061;transport=TLS SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK808480975685e211b296a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 ACK
Contact: <sip:1000@192.168.1.151:5062;transport=tls>
Authorization: Digest username="1000", realm="asterisk", nonce="54692493", uri="sip:1001@192.168.1.106:5061;transport=TLS", response="0798b41a3be5d62178429ba127c43925", algorithm=MD5
Max-Forwards: 70
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---

<--- SIP read from TLS:192.168.1.151:58418 --->
BYE sip:1001@192.168.1.106:5061;transport=TLS SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK00fc0e9e5685e211b296a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 7 BYE
Contact: <sip:1000@192.168.1.151:5062;transport=tls>
Authorization: Digest username="1000", realm="asterisk", nonce="54692493", uri="sip:1001@192.168.1.106:5061;transport=TLS", response="dd5cbc609545f27c554309306dc71135", algorithm=MD5
Max-Forwards: 70
User-Agent: SIPPER for PhonerLite
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Sending to 192.168.1.151:58418 (NAT)
Scheduling destruction of SIP dialog '802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151' in 32000 ms (Method: BYE)

<--- Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 200 OK
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK00fc0e9e5685e211b296a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 7 BYE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
    -- Executing [h@default:1] Hangup("SIP/1000-00000010", "") in new stack
  == Spawn extension (default, h, 1) exited non-zero on 'SIP/1000-00000010'
Scheduling destruction of SIP dialog '0890653214d997963645c7254cd05250@192.168.1.106:5061' in 32000 ms (Method: INVITE)
set_destination: Parsing <sip:1001@192.168.1.131:5064;transport=tls> for address/port to send to
set_destination: set destination to 192.168.1.131:5064
Reliably Transmitting (NAT) to 192.168.1.131:1162:
BYE sip:1001@192.168.1.131:5064;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK5217b6fa;rport
Max-Forwards: 70
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 103 BYE
User-Agent: Asterisk PBX 11.2.1
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---
  == Spawn extension (default, 1001, 4) exited non-zero on 'SIP/1000-00000010'

<--- SIP read from TLS:192.168.1.131:1162 --->
SIP/2.0 200 OK
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK5217b6fa;rport=5061
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 103 BYE
Contact: <sip:1001@192.168.1.131:5064;transport=tls>
Server: SIPPER for PhonerLite
Content-Length: 0

댓글 없음: