TUTORIAL SPA400 port selection

n9yty

Member
Joined
Mar 24, 2009
Messages
48
Reaction score
3
I will repeat here what I just posted elsewhere, because this information was pieced together from lots of bits here and there, I have not seen it put all together in one place.

We picked up two SPA400 units to interface to our old POTS lines until we are ready to fully migrate to VoIP, and even then we would keep some POTS lines for backups.

However, we wanted to duplicate our old PBX inbound hunt groups and outbound dialing order for line analysis purposes. Everything I had read said that you could not specify what port was used on the SPA400, but it turns out that you actually CAN do it. At least in the latest firmware. I have v1.1.2.2 and it seems to be working fine.

In the SPA400 Setup->SPA900 tab you have to set values for the PORT_ID fields. I used the last four digits of the incoming phone line, but they could be anything.

In Asterisk, I set up separate inbound routes with DID values matching what was in the PORT_ID field and it allows me to route a call that come in on a particular port to a particular destination. Caller ID will flow through, and as a bonus (?) the SPA400 attaches the PORT_ID value to the end of the caller-id NAME field.

For outbound selection, just a bit more work. I am an Asterisk newbie, so if someone knows a better way to do this and can re-post better instructions done in a cleaner fashion, it woul be great!

I set up the trunk as described in many places on the net for the SPA400, but then additionally I defined a custom trunk for each port on the SPA400's. These custom trunks are limited to 1 channel, and have a dial string of:

Local/$OUTNUM$@from-trunk-spa400a-1

I then created a custom context for each custom trunk in my extensions_custom.conf file:

[from-trunk-spa400a-1]
exten => _1.,1,Dial(SIP/spa400a/L1${EXTEN})
exten => _1.,n,Congestion

The spa400a in the above Dial() line must match the trunk name in the definition for the main SPA400 trunk in Asterisk. The L1 prefix tells the SPA400 to use port 1 when making this call.

So, the rest is a matter of defining custom trunks for all the other ports, including contexts for all the other ports in extensions_custom.conf (changing the names and Lx to match the port (1-4)), and then in your outbound routes just putting in the custom trunks in the order you want the individual ports on the SPA400's to be used.

I find this to be working fine here unless I've missed something in my notes or testing.

Steve
 

Jay Deal

Phhhhhhhhttttttt :)
Joined
Dec 26, 2013
Messages
267
Reaction score
85
Nearly 5 years later after this post (and almost 10 years after the SPA400 was introduced), I am configuring a SPA400 and having a problem with inbound. It's not that I can't receive inbound, it's just the inbound DID always shows up as the main SPA400 trunk user name and not one of the Port ID names assigned in the SPA9000 setup page.

Anybody that can remember setting up one of these things, do you recall anything beyond specifying an inbound route with a DID that matched the value assigned in the SPA9000 port ID field? Is that all it took to get inbound calls to route based on the port they came in on? I've tried that and it's not working. Maybe there is another step I have missed. Any suggestions surely appreciated.
 

geopeterwc

Guru
Joined
Aug 17, 2010
Messages
385
Reaction score
131
A couple of years ago I also purchased an SPA400 to integrate with my PIAF. In preparation, I collected information from a number of sources, including Linksys, this forum, and a thread (from somewhere) about how to configure the device with Trixbox. Some of this information may be from five years ago or so. What you're looking for may be in one (or more) of these documents. Good luck!

/Pete./
 

Attachments

  • Linksys SPA400 with Solo.pdf
    48.6 KB · Views: 103
  • Linksys SPA400 Configuration.pdf
    35 KB · Views: 105
  • SPA400_manual-240.pdf
    147.7 KB · Views: 89
  • SPA400_manual-241.pdf
    382.7 KB · Views: 86

Jay Deal

Phhhhhhhhttttttt :)
Joined
Dec 26, 2013
Messages
267
Reaction score
85
Thank you for posting those and putting them here in a central location for future searchers like myself - sure would have saved some aggravation :banghead:as it took me several days of searching to find out how to get as far as I DID (VOIP pun intended).

It's a little ironic that I have no problem with outbound port selection as with the SPA400 that was supposed to be the hard thing to make work. Using the OPs instructions, it works perfectly.

For my inbound problem, it's got to be something simple. I'll scour your documents and hopefully find a nuance that I overlooked. Once I solve it, I'll post my experience so that others are aware if they come across the same issue.

Thanks again:thumbsup:
 

geopeterwc

Guru
Joined
Aug 17, 2010
Messages
385
Reaction score
131
Thank you for posting those and putting them here in a central location for future searchers like myself - sure would have saved some aggravation as it took me several days of searching to find out how to get as far as I DID (VOIP pun intended).

It's a little ironic that I have no problem with outbound port selection as with the SPA400 that was supposed to be the hard thing to make work. Using the OPs instructions, it works perfectly.

For my inbound problem, it's got to be something simple. I'll scour your documents and hopefully find a nuance that I overlooked. Once I solve it, I'll post my experience so that others are aware if they come across the same issue.

Thanks again:thumbsup:

I've replaced the "Trixbox" user guide with a clean copy, and added a document from Linksys that might also be of some help. As I recall (I'm not using the SPA400 now), I had similar issues when I was trying to use the SPA400. I did get it to work but, for myriad reasons, my PIAF has been running very well, without analog DID's from AT&T.

I'll look again at my configuration notes from back then ... if I find anything I'll share it here. I'm looking forward to what you find that resolves your inbound problem.

It's been said, and I suspect that many here would concur, that using the OBI110 (one FXS and one FXO) is a preferred alternative to the difficult to configure (and use) SPA400.

/Pete./
 

Jay Deal

Phhhhhhhhttttttt :)
Joined
Dec 26, 2013
Messages
267
Reaction score
85
I would have to agree with you there, the Obi110 is great alternative to the SPA400 and it has the additional benefit of being currently supported. It just happens that I picked up the SPA400 very economically. I have to admit that if I had to do it again, I would have tried to pick up some used 110's. I guess at this point it really now boils down to the hobbyist challenge of making it work and learning something at the same time.
 

Jay Deal

Phhhhhhhhttttttt :)
Joined
Dec 26, 2013
Messages
267
Reaction score
85
OK, well after a couple more days of tinkering, I think I finally got it. What I needed to do was create four additional trunks, I'll call them "trunk-lites" in order to properly detect the SPA400's port ID string indidually from each of the 4 ports on the SPA400. These "trunk-lites" use fromuser to identify the incoming DID, not user. The trunk-lites consist of the following entries:

SIP trunk (not custom like you need for outgoing)

1. Trunk name: Call it anything you like.
2. Outbound Caller ID: Matches the entry in the SPA400's SPA9000 interface tab for port ID. Needs to match exactly and I believe is case sensitive
3. Peer details:

host=IP of SPA400
user=The entry for "User ID" from the SPA9000 interface tab and used in the main trunk that is setup in FreePBX to communicate with the SPA400. By default this is 9000.
context=from-trunk
froumuser=Is the outbound caller ID specified above.

So you make four of these trunk lites and then you need to specify 4 inbound routes as you normally would with any other trunk.

Summary: Connecting the SPA400 to PBXIAF and configuring outbound and inbound:

1. Create a main trunk as outlined in the pdf instructions posted by geopeterwc above . Using those as a guide what ultimately worked as my main trunk peer details consisted of the following:

port=5060
host=IP address of the SPA400
insecure=very
context=from-pstn-toheader
username=The entry for "User ID" from the SPA9000 interface tab
type=friend
trustrpid=yes <<<<This I added and might have helped
dtmfmode=rfc2833
canreinvite=no
nat=yes
disallow=all
allow=ulaw

No entries in inbound section

Registry string: "User ID" @ SPA400 IP Address / "User ID"
My registry string was this >>> [email protected]/9000

2. Create the 4 custom trunks as outlined by the OP above for outbound SPA400 port selection. Don't forget the four distinct entries in extensions_custom.conf you need to make at the bottom of the configuration file which you can do through the GUI and Config Edit.

3. Create the 4 "trunk-lites" as I have done for inbound DID detection.

4. Setup 4 outbound routes using the OP's 4 custom trunks.

5. Setup 4 inbound routes which use the DID from the "trunk-lites" I had to create.

And that should be it.

I wanted to mention one tool that I came across from the FreePBX network wiki ( http://wiki.freepbx.org/display/RN/Capture TCPDumps ) which I found very helpful. It's a program called tcpdump which you can get by typing sudo apt-get install tcpdump at the CLI through SSHing to your PBX. Run the program using the suggested configurations in the wiki and when you are done collecting info press control-C to stop the recording. The resulting dump file is put in the /tmp directory, called capture.pcap and I downloaded it through Putty to my Windows 7 machine to view the contents in Notepad. Lots of information in that dump that I hadn't seen in the Asterisk CLI.
 

benhadad

New Member
Joined
Nov 24, 2013
Messages
16
Reaction score
0
Wow I tried doing this setup about may 2014 and didn't see any information that could get me to the point of using 4 POTS lines with my VM PIAF. I am eager now to see if I can get it to work. Have a Non-profit that had spa-400 with a SPA9000 along with aastra 55i . They tried to use another setup to replace their Nortel unit, but at the time didn't have a great internet connection.
 

benhadad

New Member
Joined
Nov 24, 2013
Messages
16
Reaction score
0
Thanks for the help, so far got the SPA400 working where it acts like 1 trunk with 4 channels and the inbound DID show up. Now trying to configure it so that each port is addressable also.

I dropped the SPA9000 as it wasnt needed in this setup. I have several AASTRA 57i phones that I am hoping to get configure where the 1-4 Line buttons can be used to answer incoming calls and placing outgoing calls via the SPA400.
 

Kirk Mason

New Member
Joined
Oct 4, 2014
Messages
1
Reaction score
0
I am as newbie as it gets. Is it possible that someone could show how this would look in pbxinaflash or FreePBX ? Tried what I could without luck. I still cannot select the individual truck lines but dial out on the next available one.
 

Members online

Forum statistics

Threads
25,810
Messages
167,755
Members
19,240
Latest member
nikko
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top