On the 3102:
Admin login -> Advanced, then to the Voice tab and the PSTN Line sub-tab.
- Line enable = yes
- NAT, Network, SIP Settings - all should be ok at default if I remember correctly (it's been about 6 years since I set this up)
- Proxy: the IP address of your PIAF server
- Register: no, since you are statically addressed
- In Subscriber Information, set a Display Name and a User ID (perhaps make the User ID the number of the incoming PSTN line). No need for a password or other auth stuff.
Below the SIP and credentials sections is the Dial Plan section. This is important because it tells the device what to do with calls coming in on the PSTN line. Set Dial Plan 1 like this, substituting in your PSTN number. This is also what you'll use to define the Inbound Route in FreePBX.
Dial Plan 1: (S0<:18005551212>)
Leave the others.
To be able to place outbound calls from PIAF through the 3102 to PSTN:
- VoIP-to-PSTN Gateway: enable.
- VoIP Caller Auth Method: none.
To pass calls from the PSTN to PIAF:
- PSTN-to-VoIP Gateway: enable.
- PSTN caller auth method: none.
Submit all changes and you're done configuring the 3102, assuming you've plugged in the phone line. There might be some tweaks later but this is the basic setup.
On FreePBX:
Create a SIP trunk. Use this as the Outgoing Settings. Leave Incoming Settings section blank.
Trunk name: whatever you want
Code:
type=peer
host=the IP address of the 3102
qualify=4000
context=from-trunk
Create an Inbound Route. Set as the DID the same number you used in the 3102 Dial Plan 1 section. Direct the inbound route to the VoIP extension of your choice, or to an IVR, ring group, etc.
Create an Outbound Route or modify one. Add your new 3102 trunk as the destination to route calls over the PSTN line.