PSTN Trunk with SPA3120 [Solved]

Hi, total newbie here , trying to get a SPA3120 working with FreePBX12/Asterisk11 (yes i know its an old build, but its the only one i could make run in a vm.)

I’ve got the Line1 side of the ATA sorted and communicating with the FreePBX as extension 776 , and other softphones can call it , and it can call them. I too have sorted out outbound dialing from all extensions to my SIP provider. (who is used for outbound only.)

My only trouble that i cant get my fat head around, is setting up the inbound route (PSTN on the ATA) through into FreePBX… How do i config the ATA (PSTN) side and have it route into the FreePBX?, is it an inbound trunk , and/or an inbound route or inbound extension i am meant to be configuring ?? (and what do all those settings look like?)

I can make calls between “Line 1” configured on the SPA-3120 (extension number=776) and the other extensions (and viceversa). If I go and activate the “PSTN Ring Thru Line 1” option, I can answer incoming calls from the PSTN on the Line 1 handset but thats routing straight through the ATA3120 from PSTN port to LINE Port where the handset is connected (which i dont want, as i want all incoming PSTN to end up being processed buy a FreePBX IVR before being handed off to the handset extension 776.

Help please!!

You need to first create a trunk and point it to the FXO UDP port, which by default is 5061 on that model if I recall correctly.

Hi, already i’m confused… (doesn’t take much.) I have one single outgoing trunk… which is where i detail the connection info to my SIP provider. (for outbound calls) , so you are saying i need to create another Trunk , for interfacing with the ATA, are we talking an inbound trunk this time?

Do you have a PSTN line connected to the FXO port on the SPA-3102? If so and if you want to use the FXO port to make and receive calls from the PSTN that is connected to it, then you need a trunk for that.

I have a PSTN line connected to the PSTN port of the ATA … i have an analog telephone connected to the ‘phone’ port of the ATA… freePBX softphones can call that analog telephone, which i created an extension for. it too can call softphones, as well as everything can make outbound SIP calls via my outbound trunk to my provider.

Inbound calls on the PSTN ring out… the ATA info screen shows “ringing” but the only way i can get it to pass the call to the analog telephone is my leveraging the “PSTN Ring Thru Line 1” option on the ATA.

That is why you need a trunk for it

I am a total novice, so please be patient with me :wink:

Under ‘Add Trunk’ , there is General Settings , Outgoing Settings, Incoming Settings, and Registration… what needs to be added ? its incoming PSTN calls so is it some settings in the Inbound Settings area ?

There are many posts about the SPA3102 in this forum. Perhaps this thread will be useful:

In post 13, the OP made a summary of working settings. It’s for UK; change the Outbound Route Dial Patterns for something appropriate for your country (and what gets routed to your SIP trunk).

Thanks for that @Stewart1 , looks to be good info, though i dont have pjsip as a choice on my older revision.

Outgoing calls are working, its incoming calls from the PSTN , being correctly passed into FreePBX where i’m currently struggling.

Don’t need pjsip, it works also with chan_sip

I have a 3102 on chan_sip. Try these trunk settings:
Trunk Name: pstn-fxo
Peer Details:
host=dynamic
username=pstn-fxo
secret=(same as password in 3102)
type=friend
qualify=yes
context=from-trunk

Leave the Incoming section blank.

This trunk is using registration, so set Register to yes on the 3102’s PSTN Line tab.

@Stewart1, @arielgrin Thanks for the assistance. PSTN side is apparently registered. but incoming calls just ring out. ATA doesnt seem to answer them and hand it over to the FreePBX.




Update: Aha ! I think i’m on a winner…
Changed the Trunk’s format to
Outbound caller ID: <777>

while the ATA’s Dial Plan1 is set to S0<:777>

where 777 is the IVR’s extension… and it appears to work… (more testing required, but i think i’m in the home stretch.)

Ok, so i thought that was it…24x7 through to the IVR … now the Boss is telling me no…
Business hours to the IVR , AfterHours to an on-call extension.

So ive created the timeGroup & Time Condition… but how to make incoming calls follow those rules? not obvious how to direct that pstn_fxo trunk we created to look at the time condition. Do i have to make that trunk use an Inbound Route (not created) , that follows the TimeCondition ?

In the SPA, change Dial Plan 1 to send your PSTN phone number, e.g.
S0<:031234567890>

Then create an Inbound Route with DID Number 031234567890, Caller ID Number (leave blank) and Destination (your Time Condition).

1 Like

Thanks @Stewart1 , that was easy.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.