Primus talkbroadband with Asterisk

So I have an asterisk (Trixbox Asterisk 1.2.21) installed and working very well with a Sangoma A200 4 port FXO card and a Sangoma A102D 2 port T1/E1 card.  Due to some cost-cutting, we got rid of the PRI connected to the A102 and opted to put that FXO card in use.  After getting a talkbroadband connection from Primus, the task was to input that VOIP line into the Asterisk system.  Primus sent the adapter SPA2102, which thankfully, works on SIP.  It was fairly simple to connect the adapter to the FXO card.  Connected the internet cable in the blue port and then took a RJ11 to RJ9 cable and put it in the first port (serving as the FSX port) of the adapter straight to the first port (the FXO port) in the Sangoma Card.  Installed correctly, the trixbox settings were changed to allow outbound calls from the FXO card (in my system, trunk Zap/g1) and inbound call route was added to allow the system to receive the calls on the system. This was accomplished by adding a new outbound route.

At first, I tried to make a new inbound route by simply adding the VOIP number that came with the Primus adapter in asterisk as a DID, but that didn’t work.  Incoming calls to the VOIP number ended up with a message of “This number is not in service”.  I could see the call landing on the zaptel channel, but it was not ringing any extensions.  The trick was to change the context in the zaptel config file.  The Zaptel.conf file had the context listed as “context=from-pstn”.  Changing that to context=from-zaptel and then pointing that new inbound route to the specific zaptel channel allowed incoming calls to ring the extension.  Being new to asterisk, I’m not sure if I add a PRI in future, would the DIDs still work with context=from-zaptel instead of from-pstn .. but it did solve the issue.

So if you are looking to connect your new primus VOIP adapter to your asterisk PBX, get a FXO card and connect the adapter to the PBX instead of connecting a regular analog phone to it.