I’ve been at this for weeks now, but I have an asterisk box running FreePBX, and have been unable to get SIP trunks to work incoming. I can make outgoing calls just fine, but incoming fails 100%.
Outgoing config looks like this: (private details obscured)
host=voip.host.net
nat=yes
secret=xxx
type=peer
username=1xxxxxxxxx
Outgoing config varies, but I’ve tried many variations on this:
context=from-pstn
fromdomain=voip.host.net
fromuser=1xxxxxxxxx
host=voip.host.net
insecure=very
secret=xxx
type=peer
username=1xxxxxxxxx
In the CLI, I set the debug to 10, and usually get something like this: (private details obscured)
[code]<— SIP read from 65.94.x.x:5060 —>
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 65.94.x.x:5060;branch=z9hG4bK708ed979;rport
From: “UNAVAILABLE” sip:[email protected];tag=as010c6b06
To: sip:[email protected]
Contact: sip:[email protected]
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: Cisco-SIPGateway/IOS-12.x
Max-Forwards: 70
Date: Mon, 17 Mar 2008 20:37:45 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 332
v=0
o=root 10276 10276 IN IP4 65.94.x.x
s=session
c=IN IP4 65.94.x.x
t=0 0
m=audio 46046 RTP/AVP 0 18 4 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:4 G723/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
<------------->
[Mar 17 16:40:26] — (13 headers 15 lines) —
[Mar 17 16:40:26] Sending to 65.94.x.x : 5060 (NAT)
[Mar 17 16:40:26] Using INVITE request as basis request - [email protected]
[Mar 17 16:40:26] Found peer ‘VOIPHOST2’
[Mar 17 16:40:26]
<— Reliably Transmitting (NAT) to 65.94.x.x:5060 —>
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 65.94.x.x:5060;branch=z9hG4bK708ed979;received=65.94.x.x;rport=5060
From: “UNAVAILABLE” sip:[email protected];tag=as010c6b06
To: sip:[email protected];tag=as5c726278
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Proxy-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="58995dfb"
Content-Length: 0
<------------>
[Mar 17 16:40:26] Scheduling destruction of SIP dialog ‘[email protected]’ in 6400 ms (Method: INVITE)
[Mar 17 16:40:26]
<— SIP read from 65.94.x.x:5060 —>
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 65.94.x.x:5060;branch=z9hG4bK708ed979;rport
From: “UNAVAILABLE” sip:[email protected];tag=as010c6b06
To: sip:[email protected];tag=as5c726278
Contact: sip:[email protected]
Call-ID: [email protected]
CSeq: 102 ACK
User-Agent: Cisco-SIPGateway/IOS-12.x
Max-Forwards: 70
Content-Length: 0
<------------->
[Mar 17 16:40:26] — (10 headers 0 lines) —
[Mar 17 16:40:26]
<— SIP read from 65.94.x.x:5060 —>
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 65.94.x.x:5060;branch=z9hG4bK752123c9;rport
From: “UNAVAILABLE” sip:[email protected];tag=as010c6b06
To: sip:[email protected]
Contact: sip:[email protected]
Call-ID: [email protected]
CSeq: 103 INVITE
User-Agent: Cisco-SIPGateway/IOS-12.x
Max-Forwards: 70
Proxy-Authorization: Digest username=“1xxxxxxxxx”, realm=“asterisk”, algorithm=MD5, uri="sip:[email protected]", nonce=“58995dfb”, response=“6332ef9b353a065fa4bc7e6e6405a64b”, opaque=""
Date: Mon, 17 Mar 2008 20:37:45 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 332
v=0
o=root 10276 10277 IN IP4 65.94.x.x
s=session
c=IN IP4 65.94.x.x
t=0 0
m=audio 46046 RTP/AVP 0 18 4 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:4 G723/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
<------------->
[Mar 17 16:40:26] — (14 headers 15 lines) —
[Mar 17 16:40:26] Sending to 65.94.x.x : 5060 (NAT)
[Mar 17 16:40:26] Using INVITE request as basis request - [email protected]
[Mar 17 16:40:26] Found peer ‘VOIPHOST2’
[Mar 17 16:40:26]
<— Reliably Transmitting (NAT) to 65.94.x.x:5060 —>
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 65.94.x.x:5060;branch=z9hG4bK752123c9;received=65.94.x.x;rport=5060
From: “UNAVAILABLE” sip:[email protected];tag=as010c6b06
To: sip:[email protected];tag=as5c726278
Call-ID: [email protected]
CSeq: 103 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0[/code]
I believe the problem is related to the line(s) that say sip:[email protected] as the @192.168.0.50 is my internal IP address for the asterisk server. I’ve tried unsuccessfully to put my domain name in the configuration, as well as nat=yes in 10 different places, but I haven’t found the magic combination yet. I would think that it should say something more along the lines of sip:[email protected] or even sip:[email protected] (public IP address)
Any help would be greatly appreciated. Thanks in advance!