2013-06-27 208 views
4

我有2個服務器上有星號:192.168.241.98和192.168.243.112。星號呼叫:403 Forbidden

有第一有效註冊:

register => wagateway:[email protected]:5060 

CLI輸出:

CLI> sip show registry 
Host         dnsmgr Username  Refresh State    Reg.Time     
192.168.243.112:5060     N  wagateway   105 Registered   Wed, 26 Jun 2013 16:42:42 

而且在243.112同行都只是罰款:

CLI> sip show peers 
Name/username    Host         Dyn Forcerport ACL Port  Status  Description      
wacaller/wacaller   192.168.242.235       D a    5062  OK (13 ms)           
wagateway/s    192.168.241.98       D a    5060  OK (1 ms) 

的extensions.conf在243.112 :

在243.

sip.conf:

[wacaller] 
type=friend 
secret=qwerty 
host=dynamic 
context=watest 
qualify=yes 
allow=ulaw 
allow=alaw 

[wagateway] 
type=friend 
secret=qwerty 
fromuser=wagateway 
host=dynamic 
context=watest 
qualify=yes 
allow=ulaw 
allow=alaw 

現在我打電話123123123從wacaller的潮流手機。

243.112 CLI說:

[Jun 27 09:27:54] WARNING[20447][C-0000000b]: chan_sip.c:23213 handle_response_invite: Received response: "Forbidden" from '"WACaller" <sip:[email protected]>;tag=as30b27eae' 

在243.112啜調試:

<--- SIP read from UDP:192.168.242.235:5062 ---> 
INVITE sip:[email protected] SIP/2.0 
Via: SIP/2.0/UDP 192.168.242.235:5062;branch=z9hG4bK97733114;rport 
From: "WACaller" <sip:[email protected]>;tag=1014197566 
To: <sip:[email protected]> 
Call-ID: [email protected] 
CSeq: 240 INVITE 
Contact: "WACaller" <sip:[email protected]:5062> 
Max-Forwards: 70 
User-Agent: Grandstream GXP1400 1.0.4.13 
Privacy: none 
P-Preferred-Identity: "WACaller" <sip:[email protected]> 
Supported: replaces, path, timer 
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE 
Content-Type: application/sdp 
Accept: application/sdp, application/dtmf-relay 
Content-Length: 412 

v=0 
o=wacaller 8000 8000 IN IP4 192.168.242.235 
s=SIP Call 
c=IN IP4 192.168.242.235 
t=0 0 
m=audio 5004 RTP/AVP 0 8 4 18 9 97 2 101 
a=sendrecv 
a=rtpmap:0 PCMU/8000 
a=ptime:20 
a=rtpmap:8 PCMA/8000 
a=rtpmap:4 G723/8000 
a=rtpmap:18 G729/8000 
a=fmtp:18 annexb=no 
a=rtpmap:9 G722/8000 
a=rtpmap:97 iLBC/8000 
a=fmtp:97 mode=30 
a=rtpmap:2 G726-32/8000 
a=rtpmap:101 telephone-event/8000 
a=fmtp:101 0-15 
<-------------> 
--- (16 headers 19 lines) --- 
Sending to 192.168.242.235:5062 (no NAT) 
Sending to 192.168.242.235:5062 (no NAT) 
Using INVITE request as basis request - [email protected] 
Found peer 'wacaller' for 'wacaller' from 192.168.242.235:5062 

<--- Reliably Transmitting (no NAT) to 192.168.242.235:5062 ---> 
SIP/2.0 401 Unauthorized 
Via: SIP/2.0/UDP 192.168.242.235:5062;branch=z9hG4bK97733114;received=192.168.242.235;rport=5062 
From: "WACaller" <sip:[email protected]>;tag=1014197566 
To: <sip:[email protected]>;tag=as5a3de236 
Call-ID: [email protected] 
CSeq: 240 INVITE 
Server: Asterisk PBX SVN-trunk-r385782 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="4f84bef0" 
Content-Length: 0 


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

<--- SIP read from UDP:192.168.242.235:5062 ---> 
ACK sip:[email protected] SIP/2.0 
Via: SIP/2.0/UDP 192.168.242.235:5062;branch=z9hG4bK97733114;rport 
From: "WACaller" <sip:[email protected]>;tag=1014197566 
To: <sip:[email protected]>;tag=as5a3de236 
Call-ID: [email protected] 
CSeq: 240 ACK 
Content-Length: 0 

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

<--- SIP read from UDP:192.168.242.235:5062 ---> 
INVITE sip:[email protected] SIP/2.0 
Via: SIP/2.0/UDP 192.168.242.235:5062;branch=z9hG4bK1881861609;rport 
From: "WACaller" <sip:[email protected]>;tag=1014197566 
To: <sip:[email protected]> 
Call-ID: [email protected] 
CSeq: 241 INVITE 
Contact: "WACaller" <sip:[email protected]:5062> 
Authorization: Digest username="wacaller", realm="asterisk", nonce="4f84bef0", uri="sip:[email protected]", response="53cdb5b8c1822c80870faab15a6dc6d2", algorithm=MD5 
Max-Forwards: 70 
User-Agent: Grandstream GXP1400 1.0.4.13 
Privacy: none 
P-Preferred-Identity: "WACaller" <sip:[email protected]> 
Supported: replaces, path, timer 
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE 
Content-Type: application/sdp 
Accept: application/sdp, application/dtmf-relay 
Content-Length: 412 

v=0 
o=wacaller 8000 8000 IN IP4 192.168.242.235 
s=SIP Call 
c=IN IP4 192.168.242.235 
t=0 0 
m=audio 5004 RTP/AVP 0 8 4 18 9 97 2 101 
a=sendrecv 
a=rtpmap:0 PCMU/8000 
a=ptime:20 
a=rtpmap:8 PCMA/8000 
a=rtpmap:4 G723/8000 
a=rtpmap:18 G729/8000 
a=fmtp:18 annexb=no 
a=rtpmap:9 G722/8000 
a=rtpmap:97 iLBC/8000 
a=fmtp:97 mode=30 
a=rtpmap:2 G726-32/8000 
a=rtpmap:101 telephone-event/8000 
a=fmtp:101 0-15 
<-------------> 
--- (17 headers 19 lines) --- 
Sending to 192.168.242.235:5062 (no NAT) 
Using INVITE request as basis request - [email protected] 
Found peer 'wacaller' for 'wacaller' from 192.168.242.235:5062 
Found RTP audio format 0 
Found RTP audio format 8 
Found RTP audio format 4 
Found RTP audio format 18 
Found RTP audio format 9 
Found RTP audio format 97 
Found RTP audio format 2 
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 G723 for ID 4 
Found audio description format G729 for ID 18 
Found audio description format G722 for ID 9 
Found audio description format iLBC for ID 97 
Found audio description format G726-32 for ID 2 
Found audio description format telephone-event for ID 101 
Capabilities: us - (gsm|ulaw|alaw|h263|testlaw), peer - audio=(g723|ulaw|alaw|g726|g729|ilbc|g722)/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.242.235:5004 
Looking for 123123123 in watest (domain 192.168.243.112) 
list_route: route/path hop: <sip:[email protected]:5062> 

<--- Transmitting (no NAT) to 192.168.242.235:5062 ---> 
SIP/2.0 100 Trying 
Via: SIP/2.0/UDP 192.168.242.235:5062;branch=z9hG4bK1881861609;received=192.168.242.235;rport=5062 
From: "WACaller" <sip:[email protected]>;tag=1014197566 
To: <sip:[email protected]> 
Call-ID: [email protected] 
CSeq: 241 INVITE 
Server: Asterisk PBX SVN-trunk-r385782 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
Session-Expires: 1800;refresher=uas 
Contact: <sip:[email protected]:5060> 
Content-Length: 0 


<------------> 
Audio is at 17372 
Adding codec 100003 (ulaw) to SDP 
Adding codec 100004 (alaw) to SDP 
Adding codec 100002 (gsm) to SDP 
Adding codec 100017 (testlaw) to SDP 
Adding non-codec 0x1 (telephone-event) to SDP 
Reliably Transmitting (NAT) to 192.168.241.98:5060: 
INVITE sip:[email protected]:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK67b16b32;rport 
Max-Forwards: 70 
From: "WACaller" <sip:[email protected]>;tag=as3f5f372a 
To: <sip:[email protected]:5060> 
Contact: <sip:[email protected]:5060> 
Call-ID: [email protected]:5060 
CSeq: 102 INVITE 
User-Agent: Asterisk PBX SVN-trunk-r385782 
Date: Wed, 26 Jun 2013 08:31:48 GMT 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
Content-Type: application/sdp 
Content-Length: 326 

v=0 
o=root 2059284449 2059284449 IN IP4 192.168.243.112 
s=Asterisk PBX SVN-trunk-r385782 
c=IN IP4 192.168.243.112 
t=0 0 
m=audio 17372 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=silenceSupp:off - - - - 
a=ptime:20 
a=sendrecv 

--- 

<--- SIP read from UDP:192.168.241.98:5060 ---> 
SIP/2.0 401 Unauthorized 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK67b16b32;received=192.168.243.112;rport=5060 
From: "WACaller" <sip:[email protected]>;tag=as3f5f372a 
To: <sip:[email protected]:5060>;tag=as22eeeac0 
Call-ID: [email protected]:5060 
CSeq: 102 INVITE 
Server: Asterisk PBX 1.8.12.0 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="603b4bbf" 
Content-Length: 0 

<-------------> 
--- (11 headers 0 lines) --- 
Transmitting (NAT) to 192.168.241.98:5060: 
ACK sip:[email protected]:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK67b16b32;rport 
Max-Forwards: 70 
From: "WACaller" <sip:[email protected]>;tag=as3f5f372a 
To: <sip:[email protected]:5060>;tag=as22eeeac0 
Contact: <sip:[email protected]:5060> 
Call-ID: [email protected]:5060 
CSeq: 102 ACK 
User-Agent: Asterisk PBX SVN-trunk-r385782 
Content-Length: 0 


--- 
Audio is at 17372 
Adding codec 100003 (ulaw) to SDP 
Adding codec 100004 (alaw) to SDP 
Adding codec 100002 (gsm) to SDP 
Adding codec 100017 (testlaw) to SDP 
Adding non-codec 0x1 (telephone-event) to SDP 
Reliably Transmitting (NAT) to 192.168.241.98:5060: 
INVITE sip:[email protected]:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK6cd34725;rport 
Max-Forwards: 70 
From: "WACaller" <sip:[email protected]>;tag=as3f5f372a 
To: <sip:[email protected]:5060> 
Contact: <sip:[email protected]:5060> 
Call-ID: [email protected]:5060 
CSeq: 103 INVITE 
User-Agent: Asterisk PBX SVN-trunk-r385782 
Authorization: Digest username="s", realm="asterisk", algorithm=MD5, uri="sip:[email protected]:5060", nonce="603b4bbf", response="059cae207fb81fb76ea9061f71258895" 
Date: Wed, 26 Jun 2013 08:31:48 GMT 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
Content-Type: application/sdp 
Content-Length: 326 

v=0 
o=root 2059284449 2059284450 IN IP4 192.168.243.112 
s=Asterisk PBX SVN-trunk-r385782 
c=IN IP4 192.168.243.112 
t=0 0 
m=audio 17372 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=silenceSupp:off - - - - 
a=ptime:20 
a=sendrecv 

--- 

<--- SIP read from UDP:192.168.241.98:5060 ---> 
SIP/2.0 403 Forbidden 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK6cd34725;received=192.168.243.112;rport=5060 
From: "WACaller" <sip:[email protected]>;tag=as3f5f372a 
To: <sip:[email protected]:5060>;tag=as22eeeac0 
Call-ID: [email protected]:5060 
CSeq: 103 INVITE 
Server: Asterisk PBX 1.8.12.0 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
Content-Length: 0 

<-------------> 
--- (10 headers 0 lines) --- 
Transmitting (NAT) to 192.168.241.98:5060: 
ACK sip:[email protected]:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK6cd34725;rport 
Max-Forwards: 70 
From: "WACaller" <sip:[email protected]>;tag=as3f5f372a 
To: <sip:[email protected]:5060>;tag=as22eeeac0 
Contact: <sip:[email protected]:5060> 
Call-ID: [email protected]:5060 
CSeq: 103 ACK 
User-Agent: Asterisk PBX SVN-trunk-r385782 
Content-Length: 0 


--- 
[Jun 26 16:31:48] WARNING[20447][C-0000000a]: chan_sip.c:23213 handle_response_invite: Received response: "Forbidden" from '"WACaller" <sip:[email protected]>;tag=as3f5f372a' 
Scheduling destruction of SIP dialog '[email protected]:5060' in 6400 ms (Method: INVITE) 
Scheduling destruction of SIP dialog '[email protected]' in 6400 ms (Method: INVITE) 

啜調試目標服務器上:

<--- SIP read from UDP:192.168.243.112:5060 ---> 
INVITE sip:[email protected]:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK3159e4b1;rport 
Max-Forwards: 70 
From: "WACaller" <sip:[email protected]>;tag=as30b27eae 
To: <sip:[email protected]:5060> 
Contact: <sip:[email protected]:5060> 
Call-ID: [email protected]:5060 
CSeq: 102 INVITE 
User-Agent: Asterisk PBX SVN-trunk-r385782 
Date: Thu, 27 Jun 2013 01:27:54 GMT 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
Content-Type: application/sdp 
Content-Length: 326 

v=0 
o=root 1301894386 1301894386 IN IP4 192.168.243.112 
s=Asterisk PBX SVN-trunk-r385782 
c=IN IP4 192.168.243.112 
t=0 0 
m=audio 15838 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=silenceSupp:off - - - - 
a=ptime:20 
a=sendrecv 
<-------------> 
--- (14 headers 14 lines) --- 
Sending to 192.168.243.112:5060 (NAT) 
Using INVITE request as basis request - [email protected]:5060 
Found peer 'wagateway' for 'wagateway' from 192.168.243.112:5060 

<--- Reliably Transmitting (no NAT) to 192.168.243.112:5060 ---> 
SIP/2.0 401 Unauthorized 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK3159e4b1;received=192.168.243.112;rport=5060 
From: "WACaller" <sip:[email protected]>;tag=as30b27eae 
To: <sip:[email protected]:5060>;tag=as671c0824 
Call-ID: [email protected]:5060 
CSeq: 102 INVITE 
Server: Asterisk PBX 1.8.12.0 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0b63a660" 
Content-Length: 0 


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

<--- SIP read from UDP:192.168.243.112:5060 ---> 
ACK sip:[email protected]:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK3159e4b1;rport 
Max-Forwards: 70 
From: "WACaller" <sip:[email protected]>;tag=as30b27eae 
To: <sip:[email protected]:5060>;tag=as671c0824 
Contact: <sip:[email protected]:5060> 
Call-ID: [email protected]:5060 
CSeq: 102 ACK 
User-Agent: Asterisk PBX SVN-trunk-r385782 
Content-Length: 0 

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

<--- SIP read from UDP:192.168.243.112:5060 ---> 
INVITE sip:[email protected]:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK40e56655;rport 
Max-Forwards: 70 
From: "WACaller" <sip:[email protected]>;tag=as30b27eae 
To: <sip:[email protected]:5060> 
Contact: <sip:[email protected]:5060> 
Call-ID: [email protected]:5060 
CSeq: 103 INVITE 
User-Agent: Asterisk PBX SVN-trunk-r385782 
Authorization: Digest username="s", realm="asterisk", algorithm=MD5, uri="sip:[email protected]:5060", nonce="0b63a660", response="537f37fe2fb8d0fd40733cb190ea70c8" 
Date: Thu, 27 Jun 2013 01:27:54 GMT 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
Content-Type: application/sdp 
Content-Length: 326 

v=0 
o=root 1301894386 1301894387 IN IP4 192.168.243.112 
s=Asterisk PBX SVN-trunk-r385782 
c=IN IP4 192.168.243.112 
t=0 0 
m=audio 15838 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=silenceSupp:off - - - - 
a=ptime:20 
a=sendrecv 
<-------------> 
--- (15 headers 14 lines) --- 
Sending to 192.168.243.112:5060 (no NAT) 
Using INVITE request as basis request - [email protected]:5060 
Found peer 'wagateway' for 'wagateway' from 192.168.243.112:5060 

<--- Reliably Transmitting (no NAT) to 192.168.243.112:5060 ---> 
SIP/2.0 403 Forbidden 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK40e56655;received=192.168.243.112;rport=5060 
From: "WACaller" <sip:[email protected]>;tag=as30b27eae 
To: <sip:[email protected]:5060>;tag=as671c0824 
Call-ID: [email protected]:5060 
CSeq: 103 INVITE 
Server: Asterisk PBX 1.8.12.0 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH 
Supported: replaces, timer 
Content-Length: 0 


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

<--- SIP read from UDP:192.168.243.112:5060 ---> 
ACK sip:[email protected]:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.243.112:5060;branch=z9hG4bK40e56655;rport 
Max-Forwards: 70 
From: "WACaller" <sip:[email protected]>;tag=as30b27eae 
To: <sip:[email protected]:5060>;tag=as671c0824 
Contact: <sip:[email protected]:5060> 
Call-ID: [email protected]:5060 
CSeq: 103 ACK 
User-Agent: Asterisk PBX SVN-trunk-r385782 
Content-Length: 0 

<-------------> 
--- (10 headers 0 lines) --- 
dev-ast*CLI> sip set debug off 
SIP Debugging Disabled 

任何幫助嗎?

回答

0

你有沒有試着用:

exten => 123123123,n,Dial(SIP/wagateway/${EXTEN}) 

INVITE SIP:[email protected]:5060

您要發送的小號分機呼叫在[watest]上下文(它是由如果你沒有指定擴展名默認),但是s不存在,只有123123123.


EDIT1: 好不是添加修改[wacaller]地址:

type=peer ;instead of friend 
insecure=invite,port  
nat=yes 

讓我知道,如果它的工作,謝謝。


EDIT2: 嘗試刪除/註釋掉

;fromuser=wagateway 

檢查Grandstream forum,它是最有可能的手機的問題。

EDIT3: 問題99%在於你註冊到一臺服務器(192.168.243.112),並邀請的事實被髮送到wagateway /秒(192.168.241。98)不同的服務器或IP 註冊表字符串與邀請中的註冊表字符串不同,並且在那裏爲您獲取禁止消息。 這應該幫助: ;不安全=邀請,端口
在主叫中繼網關,如果你想保持這個網絡設置。

問候

+1

** s **擴展名存在,並且添加'/ $ {EXTEN}'不起作用。 –

+0

好吧我看到更好後添加編輯 – mirkobrankovic

+0

沒有工作,對不起。 –

0

相較於我的Asterisk到Asterisk的SIP中繼的一個...

它看起來像我用的是我的sip.confdefaultuser=參數,而不是fromuser=

從將帶有make samples - defaultuser的原始sip.conf描述爲「用於出站代理的認證用戶」。雖然在這種情況下它不是代理,但我相信這是在發出此SIP請求時將使用的參數。

話雖如此 - 你也可以考慮使用iax協議,當你有方便在兩個星號服務器之間建立一箇中繼。它標準爲「Inter-Asterisk eXchange」,我發現它更簡單易用。特別簡單的情況似乎沒有像SIP在穿越NAT時那樣遭受同樣的問題。

下面是兩個星號框之間的SIP中繼的示例。

盒A, 「紐約」:

register => newyork:[email protected] 

[tokyo] 
nat=yes 
type=friend 
context=insidecaller 
host=192.168.1.21 
defaultuser=newyork 
secret=VERYSECRET 
disallow=all 
allow=ulaw 

而且在盒子B, 「東京」:

[newyork] 
directmedia=no 
type=friend 
secret=VERYSECRET 
context=outsidecaller 
host=dynamic 
disallow=all 
allow=ulaw 

說明如何在盒A的配置defaultuser交談東京(又名箱B)匹配設備名稱[newyork]對框B的sip.conf

+0

嗯,在我的情況下,沒有'[tokyo]'這樣的同行'。在東京,我打電話給同行'[newyork]'。這個同伴從紐約註冊爲網關。呼叫去紐約服務器,它應該去專門爲這種情況設計的入境上下文。它沒有。呼叫在兩者之間停止。在'wagateway'將INVITE發送到紐約的's'擴展之後,發生了一些事情,我不知道是什麼。 –

+0

我的錯。有'[tokyo]',它很重要。在配置中添加'端口=邀請,不安全'後,一切都按預期工作。 –

+0

你添加了'insecure = invite,port'還是'port = invite,insecure'? – mirkobrankovic

1

您遇到的另一個問題是一個循環,您將呼叫發送到您的網關,並當來電時你的網關你再次發送到網關,這是爲什麼你得到一個禁止,當你撥打SIP/wagateway(在wagateway)你沒有擴展,你的通話方式是客戶端--->網關--->網關,嘗試將您的擴展名更改爲像下面這樣的東西

[watest] 

exten => 123123123,1,NoOp(Call comming from ${CALLERID(all)}) 
exten => 123123123,n,Answer() 
exten => 123123123,n,PlayBack(tt-monkeys) 
exten => 123123123,n,Hangup()