SPA8000 Trunk with FreePBX

I am trying to connect an SPA8000 via it’s Trunking feature to my FreePBX system and I am presented with 403 Forbidden and “Wrong Password” entries in the logs. If anyone has had any experience with this that can shed some light, that would be great. I think my problem is in the trunk config (listed below) but here’s details that I’ve gathered.

System: FreePBX 12.0.38 / Asterisk 13.1

Here is the SPA8000 trying to register. It’s challenged, it replies to the challenge and then the 403 is given.

U spa8000.wan.ip:5080 -> freepbx.wan.ip:5060
REGISTER sip:sip.domain.com SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.145:5080;branch=z9hG4bK-f34d1c5d.
From: <sip:[email protected]>;tag=8316069b39dc0286o2.
To: <sip:[email protected]>.
Call-ID: [email protected].
CSeq: 30343 REGISTER.
Max-Forwards: 70.
Contact: <sip:[email protected]:5080>;expires=3600.
User-Agent: Linksys/SPA8000-6.1.12.
Allow-Events: talk, hold, conference.
Content-Length: 0.
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER.
Supported: x-sipura, replaces.
 
U 2freepbx.wan.ip:5060 -> spa8000.wan.ip:5080
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/UDP 192.168.1.145:5080;branch=z9hG4bK-f34d1c5d;received=174.137.79.28;rport=5080.
From: <sip:[email protected]>;tag=8316069b39dc0286o2.
To: <sip:[email protected]>;tag=as20159fef.
Call-ID: [email protected].
CSeq: 30343 REGISTER.
Server: FPBX-12.0.38(13.1.0).
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE.
Supported: replaces, timer.
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="3a24587a".
Content-Length: 0.

U spa8000.wan.ip:5080 -> freepbx.wan.ip:5060
REGISTER sip:sip.domain.com SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.145:5080;branch=z9hG4bK-56c1dba6.
From: <sip:[email protected]>;tag=8316069b39dc0286o2.
To: <sip:[email protected]>.
Call-ID: [email protected].
CSeq: 30344 REGISTER.
Max-Forwards: 70.
Authorization: Digest username="username",realm="asterisk",nonce="3a24587a",uri="sip:sip.domain.com",algorithm=MD5,response="0cbff8c413d4c0a535bef0dff1aa5c98".
Contact: <sip:[email protected]:5080>;expires=3600.
User-Agent: Linksys/SPA8000-6.1.12.
Allow-Events: talk, hold, conference.
Content-Length: 0.
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER.
Supported: x-sipura, replaces.

U freepbx.wan.ip:5060 -> spa8000.wan.ip:5080
SIP/2.0 403 Forbidden.
Via: SIP/2.0/UDP 192.168.1.145:5080;branch=z9hG4bK-56c1dba6;received=174.137.79.28;rport=5080.
From: <sip:[email protected]>;tag=8316069b39dc0286o2.
To: <sip:[email protected]>;tag=as20159fef.
Call-ID: [email protected].
CSeq: 30344 REGISTER.
Server: FPBX-12.0.38(13.1.0).
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE.
Supported: replaces, timer.
Content-Length: 0.
.

And when I look in my Asterisk logs I see this:

[2015-02-26 11:00:46] NOTICE[1342] chan_sip.c: Registration from '<sip:[email protected]>' failed for 'spa8000.wan.ip:5080' - Wrong password

Here is the Trunk config, this is where I think I am having the problem:

host=dynamic
username=username
secret=password
type=peer
dtmfmode=RFC2833
context=from-trunk
canreinvite=yes
nat=yes
qualify=yes
disallow=all
allow=ulaw&alaw

Is your username actually “username”? - same question for secret.
What does your register string look like?

Hah! No, that is just there for the generic output for the ticket.

username:[email protected]/TrunkName is how it looks.

Sorry, I was thinking you were trying to connect to a FXO adapter.
Your device is an 8 FXS (analog telephones) ATA. You have to set up extensions within your FreePBX and
then configure each line of your SPA8000 to connect to the FreePBX box - not the other way around.
You setup a FreePBX trunk to connect to a sip provider / fxo adapter / or PSTN line with a dhadi card.
So on your ATA;
proxy is the ip of the FreePBX box.
userID is the extension #
Password is whatever.
Bob’s your uncle.

That’s not how I’m trying to use the SPA8000. Can get the SPA8000 to registered via extensions all day long. The new firmware for the SPA8000 allows for the SPA8000 to do SIP Trunking. It can now support 4 SIP Trunks that you can assigned lines 1 through 8 on.

I’m trying to connect the SPA8000 TO the FreePBX via a SIP Trunk to have one peer vs 6 separate registrations because the SPA8000 is just doing FXS conversion to an old TDM PBX. So the service is really a SIP Trunk with 6 voice channels, however, the current method is an SPA8000 registered on six separate lines that are in a Ring Group that hunts those lines. It’s a poor way to deliver the solution and with the new firmware allowing the SPA8000 to now do Trunking helps deliver that solution the proper way.

I’m just having issues getting the SPA8000 to register on the SIP Trunk I created on the FreePBX. That’s why I’m looking to see if anyone has used an SPA8000 SIP Trunk with a FreePBX…

Hi Blaze;

Ok, I sort of understand. But it’s my understanding that a freepbx trunk is strictly a client.
So you can’t get the ATA to register to it.
To connect the ATA -> PBX box you would have to set up an extension. (It’s a trunk to the ATA)
I apologize if I’m still not understanding the problem.

No, you can connect other FreePBXes and other PBXes to a FreePBX system. Remember it’s Asterisk, even companies like Vitelity are using Asterisk servers to handle all their users including the users who have SIP trunks.

So Asterisk is just not a client when it comes to SIP Trunks. I haven’t had to do SIP trunk from a client to a FreePBX in over a year and I’ve lost my notes on it all. But last year for another customer I was working with I had a FreePBX as their central system and had 3CX and PAnasonic PBX systems using SIP trunks on the FreePBX and making and receiving calls just fine.