这次 SIP 呼叫失败是由于防火墙还是 NAT 造成的?

这次 SIP 呼叫失败是由于防火墙还是 NAT 造成的?

我正在尝试找出此呼叫失败的原因,方法是:

<--- SIP read from UDP:63.247.69.226:5060 --->
SIP/2.0 100 Trying

进而

Everyone is busy/congested at this time (1:0/0/1)

完整调试会话:

mordor*CLI> 
mordor*CLI> 
mordor*CLI> sip set debug off
SIP Debugging Disabled
mordor*CLI> sip set debug on
SIP Debugging enabled
mordor*CLI> channel originate SIP/piter extension 18003569377@outbound
  == Using SIP RTP CoS mark 5
Audio is at 11012
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 192.168.1.5:5063:
INVITE sip:[email protected]:5063 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.8:5060;branch=z9hG4bK263def10;rport
Max-Forwards: 70
From: "Anonymous" <sip:[email protected]>;tag=as3cc65ffd
To: <sip:[email protected]:5063>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
Date: Mon, 04 Jul 2016 09:47:09 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Type: application/sdp
Content-Length: 312

v=0
o=root 2081787154 2081787154 IN IP4 192.168.1.8
s=Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
c=IN IP4 192.168.1.8
t=0 0
m=audio 11012 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

---
    -- Called piter

<--- SIP read from UDP:192.168.1.5:5063 --->
SIP/2.0 100 Trying
To: <sip:[email protected]:5063>
From: "Anonymous" <sip:[email protected]>;tag=as3cc65ffd
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Via: SIP/2.0/UDP 192.168.1.8:5060;branch=z9hG4bK263def10
Server: Linksys/SPA942-6.1.5(a)
Content-Length: 0

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

<--- SIP read from UDP:192.168.1.5:5063 --->
SIP/2.0 180 Ringing
To: <sip:[email protected]:5063>;tag=1702b369152c1657i3
From: "Anonymous" <sip:[email protected]>;tag=as3cc65ffd
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Via: SIP/2.0/UDP 192.168.1.8:5060;branch=z9hG4bK263def10
Contact: "piter" <sip:[email protected]:5063>
Server: Linksys/SPA942-6.1.5(a)
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
sip_route_dump: route/path hop: <sip:[email protected]:5063>
    -- SIP/piter-0000000e is ringing

<--- SIP read from UDP:192.168.1.5:5063 --->
SIP/2.0 200 OK
To: <sip:[email protected]:5063>;tag=1702b369152c1657i3
From: "Anonymous" <sip:[email protected]>;tag=as3cc65ffd
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Via: SIP/2.0/UDP 192.168.1.8:5060;branch=z9hG4bK263def10
Contact: "piter" <sip:[email protected]:5063>
Server: Linksys/SPA942-6.1.5(a)
Content-Length: 206
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: replaces
Content-Type: application/sdp

v=0
o=- 2140205 2140205 IN IP4 192.168.1.5
s=-
c=IN IP4 192.168.1.5
t=0 0
m=audio 16416 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
<------------->
--- (12 headers 11 lines) ---
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|gsm), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
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.5:16416
sip_route_dump: route/path hop: <sip:[email protected]:5063>
Transmitting (NAT) to 192.168.1.5:5063:
ACK sip:[email protected]:5063 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.8:5060;branch=z9hG4bK6a3a6746;rport
Max-Forwards: 70
From: "Anonymous" <sip:[email protected]>;tag=as3cc65ffd
To: <sip:[email protected]:5063>;tag=1702b369152c1657i3
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
Content-Length: 0


---
    -- SIP/piter-0000000e answered
    -- Executing [18003569377@outbound:1] NoOp("SIP/piter-0000000e", "") in new stack
    -- Executing [18003569377@outbound:2] Log("SIP/piter-0000000e", "NOTICE, Dialing out from "piter" <> to 8003569377 through SIP/12345678GW1") in new stack
[Jul  4 02:47:12] NOTICE[13652][C-00000007]: Ext. 18003569377:2 @ outbound:  Dialing out from "piter" <> to 8003569377 through SIP/12345678GW1
    -- Executing [18003569377@outbound:3] Dial("SIP/piter-0000000e", "SIP/12345678GW1/8003569377,60") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 16374
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 63.247.69.226:5060:
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP <my.external.ip.address>:5060;branch=z9hG4bK40fff6ea;rport
Max-Forwards: 70
From: "piter" <sip:[email protected]>;tag=as79460c11
To: <sip:[email protected]:5060>
Contact: <sip:asterisk@<my.external.ip.address>:5060>
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
Date: Mon, 04 Jul 2016 09:47:12 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Type: application/sdp
Content-Length: 318

v=0
o=root 1092551220 1092551220 IN IP4 <my.external.ip.address>
s=Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
c=IN IP4 <my.external.ip.address>
t=0 0
m=audio 16374 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

---
    -- Called SIP/12345678GW1/8003569377
       > 0x7fd8bc003860 -- Probation passed - setting RTP source address to 192.168.1.5:16416

<--- SIP read from UDP:63.247.69.226:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP <my.external.ip.address>:5060;branch=z9hG4bK40fff6ea;rport=49192;received=<my.external.ip.address>
From: "piter" <sip:[email protected]>;tag=as79460c11
To: <sip:[email protected]:5060>
Call-ID: [email protected]
CSeq: 102 INVITE
Content-Length: 0

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

<--- SIP read from UDP:63.247.69.226:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP <my.external.ip.address>:5060;branch=z9hG4bK40fff6ea;rport=49192;received=<my.external.ip.address>
From: "piter" <sip:[email protected]>;tag=as79460c11
To: <sip:[email protected]:5060>;tag=14575c43173f48ab35024af4364ef5fa.cbfb
Call-ID: [email protected]
CSeq: 102 INVITE
Proxy-Authenticate: Digest realm="gw1.siptrunk.com", nonce="V3oy+Fd6MKB3huy6iBHjbvTIK9i+xRjZYUpDfJ2/BcrVMlyQNNwwhRmWoIjB", qop="auth"
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Transmitting (NAT) to 63.247.69.226:5060:
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP <my.external.ip.address>:5060;branch=z9hG4bK40fff6ea;rport
Max-Forwards: 70
From: "piter" <sip:[email protected]>;tag=as79460c11
To: <sip:[email protected]:5060>;tag=14575c43173f48ab35024af4364ef5fa.cbfb
Contact: <sip:asterisk@<my.external.ip.address>:5060>
Call-ID: [email protected]
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
Content-Length: 0


---
Audio is at 16374
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 63.247.69.226:5060:
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP <my.external.ip.address>:5060;branch=z9hG4bK3e38a92a;rport
Max-Forwards: 70
From: "piter" <sip:[email protected]>;tag=as79460c11
To: <sip:[email protected]:5060>
Contact: <sip:asterisk@<my.external.ip.address>:5060>
Call-ID: [email protected]
CSeq: 103 INVITE
User-Agent: Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
Proxy-Authorization: Digest username="12345678", realm="gw1.siptrunk.com", algorithm=MD5, uri="sip:[email protected]:5060", nonce="V3oy+Fd6MKB3huy6iBHjbvTIK9i+xRjZYUpDfJ2/BcrVMlyQNNwwhRmWoIjB", response="294576e37f5430f6d5191445bd4429d1", qop=auth, cnonce="32702902", nc=00000001
Date: Mon, 04 Jul 2016 09:47:12 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Type: application/sdp
Content-Length: 318

v=0
o=root 1092551220 1092551221 IN IP4 <my.external.ip.address>
s=Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
c=IN IP4 <my.external.ip.address>
t=0 0
m=audio 16374 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:63.247.69.226:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP <my.external.ip.address>:5060;branch=z9hG4bK3e38a92a;rport=49192;received=<my.external.ip.address>
From: "piter" <sip:[email protected]>;tag=as79460c11
To: <sip:[email protected]:5060>
Call-ID: [email protected]
CSeq: 103 INVITE
Content-Length: 0

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

<--- SIP read from UDP:63.247.69.226:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP <my.external.ip.address>:5060;branch=z9hG4bK3e38a92a;rport=49192;received=<my.external.ip.address>
From: "piter" <sip:[email protected]>;tag=as79460c11
To: <sip:[email protected]:5060>;tag=14575c43173f48ab35024af4364ef5fa.bf26
Call-ID: [email protected]
CSeq: 103 INVITE
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---
Transmitting (NAT) to 63.247.69.226:5060:
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP <my.external.ip.address>:5060;branch=z9hG4bK3e38a92a;rport
Max-Forwards: 70
From: "piter" <sip:[email protected]>;tag=as79460c11
To: <sip:[email protected]:5060>;tag=14575c43173f48ab35024af4364ef5fa.bf26
Contact: <sip:asterisk@<my.external.ip.address>:5060>
Call-ID: [email protected]
CSeq: 103 ACK
User-Agent: Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
Content-Length: 0


---
Scheduling destruction of SIP dialog '[email protected]' in 6400 ms (Method: INVITE)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [18003569377@outbound:4] PlayTones("SIP/piter-0000000e", "congestion") in new stack
    -- Executing [18003569377@outbound:5] Hangup("SIP/piter-0000000e", "") in new stack
  == Spawn extension (outbound, 18003569377, 5) exited non-zero on 'SIP/piter-0000000e'
Scheduling destruction of SIP dialog '[email protected]:5060' in 6400 ms (Method: INVITE)
Reliably Transmitting (NAT) to 192.168.1.5:5063:
BYE sip:[email protected]:5063 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.8:5060;branch=z9hG4bK487f69fb;rport
Max-Forwards: 70
From: "Anonymous" <sip:[email protected]>;tag=as3cc65ffd
To: <sip:[email protected]:5063>;tag=1702b369152c1657i3
Call-ID: [email protected]:5060
CSeq: 103 BYE
User-Agent: Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
X-Asterisk-HangupCause: Unallocated (unassigned) number
X-Asterisk-HangupCauseCode: 1
Content-Length: 0


---

<--- SIP read from UDP:192.168.1.5:5063 --->
SIP/2.0 200 OK
To: <sip:[email protected]:5063>;tag=1702b369152c1657i3
From: "Anonymous" <sip:[email protected]>;tag=as3cc65ffd
Call-ID: [email protected]:5060
CSeq: 103 BYE
Via: SIP/2.0/UDP 192.168.1.8:5060;branch=z9hG4bK487f69fb
Server: Linksys/SPA942-6.1.5(a)
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog '[email protected]:5060' Method: INVITE

<--- SIP read from UDP:192.168.1.5:5062 --->
NOTIFY sip:192.168.1.8 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.5:5062;branch=z9hG4bK-aeeaf71e
From: "thufir" <sip:[email protected]>;tag=2dc2ec8b9eeabd55o2
To: <sip:192.168.1.8>
Call-ID: [email protected]
CSeq: 1427 NOTIFY
Max-Forwards: 70
Contact: "thufir" <sip:[email protected]:5062>
Event: keep-alive
User-Agent: Linksys/SPA942-6.1.5(a)
Content-Length: 0

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

<--- Transmitting (NAT) to 192.168.1.5:5062 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.5:5062;branch=z9hG4bK-aeeaf71e;received=192.168.1.5;rport=5062
From: "thufir" <sip:[email protected]>;tag=2dc2ec8b9eeabd55o2
To: <sip:192.168.1.8>;tag=as210aafe6
Call-ID: [email protected]
CSeq: 1427 NOTIFY
Server: Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '[email protected]' in 32000 ms (Method: NOTIFY)

<--- SIP read from UDP:192.168.1.5:5063 --->
NOTIFY sip:192.168.1.8 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.5:5063;branch=z9hG4bK-1f7b1f9d
From: "piter" <sip:[email protected]>;tag=426902db72b1b45o3
To: <sip:192.168.1.8>
Call-ID: [email protected]
CSeq: 1427 NOTIFY
Max-Forwards: 70
Contact: "piter" <sip:[email protected]:5063>
Event: keep-alive
User-Agent: Linksys/SPA942-6.1.5(a)
Content-Length: 0

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

<--- Transmitting (NAT) to 192.168.1.5:5063 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.5:5063;branch=z9hG4bK-1f7b1f9d;received=192.168.1.5;rport=5063
From: "piter" <sip:[email protected]>;tag=426902db72b1b45o3
To: <sip:192.168.1.8>;tag=as465f40b3
Call-ID: [email protected]
CSeq: 1427 NOTIFY
Server: Asterisk PBX 13.1.0~dfsg-1.1ubuntu3
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '[email protected]' in 32000 ms (Method: NOTIFY)
mordor*CLI> sip set debug off
SIP Debugging Disabled
mordor*CLI> 

并找到了一篇关于最正确我使用的路由器NetGear WNR1000v2-N150 无线路由器。但是,我不认为这是路由器的问题,因为

  1. 我可以拨打'[电子邮件保护]` 通过网络上的 Android 平板电脑
  2. 我可以使用与 telnyx 相同的语法拨出

我必须换出并重新加载sip.confextensions.conf,但如果通过 Asterisk 进行的出站拨号适用于一个 SIP 中继提供商,那么按理说它应该适用于另一个 SIP 中继提供商,并且路由器配置不是问题。 或者,是吗?

答案1

这不是 NAT 或防火墙问题。似乎 re-INVITE 处理不正确。尝试禁用 re-INVITE,这应该可以解决这个问题。

相关内容