Trunk setup

Hi, I am new to this forum and FreePBX.

I am running FreePBX on a Raspberry Pi 3 and have my soft phones (Counterpath Xlite), Yealink W52p extension all set up OK. In addition I have have a Linksys SPA3102 setup as an extension (analogue phone) and as my Analogue line to SIP converter. all extensions can call one another OK.

My SIP trunk has been setup but I cannot make calls to the PSTN or receive calls from the PSTN.

My setup is based in the UK.

Is there anyone with a similar setup (in particular using the Linksys SPA3102) that could give me some help in getting the PSTN access working.

Many thanks in advance

Peter

Hi Peter,
Please could you provide your trunk settings, and those in the SPA device? It would also be helpful if you could provide an Asterisk log (available in the FreePBX ‘Reports’ menu) so we can start to work out what might be going wrong.

Anthony

As requested please find below trunk and SPA information.

I have changed my home number to either “My PSTN Number” or 01483000000.

SPA

Info

Product Information
Product Name: SPA-3102 Serial Number: CF600M402942
Software Version: 3.3.6(GW) Hardware Version: 1.4.5(a)
MAC Address: 000E08C38982 Client Certificate: Installed
Customization: Open

System Status
Current Time: 12/21/2017 09:10:15 Elapsed Time: 21:35:00
RTP Packets Sent: 0 RTP Bytes Sent: 0
RTP Packets Recv: 0 RTP Bytes Recv: 0
SIP Messages Sent: 2688 SIP Bytes Sent: 1182819
SIP Messages Recv: 2681 SIP Bytes Recv: 1138674
External IP:

Line 1 Status
Hook State: On Registration State: Registered
Last Registration At: 12/21/2017 08:24:31 Next Registration In: 825 s
Message Waiting: No Call Back Active: No
Last Called Number: Last Caller Number: 100
Mapped SIP Port:
Call 1 State: Idle Call 2 State: Idle
Call 1 Tone: None Call 2 Tone: None
Call 1 Encoder: Call 2 Encoder:
Call 1 Decoder: Call 2 Decoder:
Call 1 FAX: Call 2 FAX:
Call 1 Type: Call 2 Type:
Call 1 Remote Hold: Call 2 Remote Hold:
Call 1 Callback: Call 2 Callback:
Call 1 Peer Name: Call 2 Peer Name:
Call 1 Peer Phone: Call 2 Peer Phone:
Call 1 Duration: Call 2 Duration:
Call 1 Packets Sent: Call 2 Packets Sent:
Call 1 Packets Recv: Call 2 Packets Recv:
Call 1 Bytes Sent: Call 2 Bytes Sent:
Call 1 Bytes Recv: Call 2 Bytes Recv:
Call 1 Decode Latency: Call 2 Decode Latency:
Call 1 Jitter: Call 2 Jitter:
Call 1 Round Trip Delay: Call 2 Round Trip Delay:
Call 1 Packets Lost: Call 2 Packets Lost:
Call 1 Packet Error: Call 2 Packet Error:
Call 1 Mapped RTP Port: Call 2 Mapped RTP Port:

PSTN Line Status
Hook State: On Line Voltage: 0 (V)
Loop Current: 0.0 (mA) Registration State: Registered
Last Registration At: 12/21/2017 08:24:28 Next Registration In: 822 s
Last Called VoIP Number: Last Called PSTN Number:
Last VoIP Caller: Last PSTN Caller: ,
Last PSTN Disconnect Reason: PSTN Activity Timer: 30000 (ms)
Mapped SIP Port: Call Type:
VoIP State: Idle PSTN State: Idle
VoIP Tone: PSTN Tone:
VoIP Peer Name: PSTN Peer Name:
VoIP Peer Number: PSTN Peer Number:
VoIP Call Encoder: VoIP Call Decoder:
VoIP Call FAX: VoIP Call Remote Hold:
VoIP Call Duration: VoIP Call Packets Sent:
VoIP Call Packets Recv: VoIP Call Bytes Sent:
VoIP Call Bytes Recv: VoIP Call Decode Latency:
VoIP Call Jitter: VoIP Call Round Trip Delay:
VoIP Call Packets Lost: VoIP Call Packet Error:
VoIP Call Mapped RTP Port:

Line 1

Line Enable:

Streaming Audio Server (SAS)
SAS Enable: SAS DLG Refresh Intvl:
SAS Inbound RTP Sink:

NAT Settings
NAT Mapping Enable: NAT Keep Alive Enable:
NAT Keep Alive Msg: NAT Keep Alive Dest:

Network Settings
SIP ToS/DiffServ Value: SIP CoS Value: [0-7]
RTP ToS/DiffServ Value: RTP CoS Value: [0-7]
Network Jitter Level: Jitter Buffer Adjustment:

SIP Settings
SIP Port: SIP 100REL Enable:
EXT SIP Port: Auth Resync-Reboot:
SIP Proxy-Require: SIP Remote-Party-ID:
SIP GUID: SIP Debug Option:
RTP Log Intvl: Restrict Source IP:
Referor Bye Delay: Refer Target Bye Delay:
Referee Bye Delay: Refer-To Target Contact:
Sticky 183:

Call Feature Settings
Blind Attn-Xfer Enable: MOH Server:
Xfer When Hangup Conf:

Proxy and Registration
Proxy:
Outbound Proxy:
Use Outbound Proxy: Use OB Proxy In Dialog:
Register: Make Call Without Reg:
Register Expires: Ans Call Without Reg:
Use DNS SRV: DNS SRV Auto Prefix:
Proxy Fallback Intvl: Proxy Redundancy Method:
Voice Mail Server: Mailbox Subscribe Expires:

Subscriber Information
Display Name: User ID:
Password: Use Auth ID:
Auth ID:
Mini Certificate:
SRTP Private Key:

Supplementary Service Subscription
Call Waiting Serv: Block CID Serv:
Block ANC Serv: Dist Ring Serv:
Cfwd All Serv: Cfwd Busy Serv:
Cfwd No Ans Serv: Cfwd Sel Serv:
Cfwd Last Serv: Block Last Serv:
Accept Last Serv: DND Serv:
CID Serv: CWCID Serv:
Call Return Serv: Call Redial Serv:
Call Back Serv: Three Way Call Serv:
Three Way Conf Serv: Attn Transfer Serv:
Unattn Transfer Serv: MWI Serv:
VMWI Serv: Speed Dial Serv:
Secure Call Serv: Referral Serv:
Feature Dial Serv: Service Announcement Serv:

Audio Configuration
Preferred Codec: Silence Supp Enable:
Use Pref Codec Only: Silence Threshold:
G729a Enable: Echo Canc Enable:
G723 Enable: Echo Canc Adapt Enable:
G726-16 Enable: Echo Supp Enable:
G726-24 Enable: FAX CED Detect Enable:
G726-32 Enable: FAX CNG Detect Enable:
G726-40 Enable: FAX Passthru Codec:
DTMF Process INFO: FAX Codec Symmetric:
DTMF Process AVT: FAX Passthru Method:
DTMF Tx Method: FAX Process NSE:
Hook Flash Tx Method: FAX Disable ECAN:
Release Unused Codec: FAX Enable T38:
FAX T38 Redundancy: FAX Tone Detect Mode:
Symmetric RTP:

Gateway Accounts
Gateway 1: GW1 NAT Mapping Enable:
GW1 Auth ID: GW1 Password:
Gateway 2: GW2 NAT Mapping Enable:
GW2 Auth ID: GW2 Password:
Gateway 3: GW3 NAT Mapping Enable:
GW3 Auth ID: GW3 Password:
Gateway 4: GW4 NAT Mapping Enable:
GW4 Auth ID: GW4 Password:

VoIP Fallback To PSTN
Auto PSTN Fallback:

Dial Plan
Dial Plan:
Enable IP Dialing: Emergency Number:

FXS Port Polarity Configuration
Idle Polarity: Caller Conn Polarity:
Callee Conn Polarity:

PSTN Line

Line Enable:

NAT Settings
NAT Mapping Enable: NAT Keep Alive Enable:
NAT Keep Alive Msg: NAT Keep Alive Dest:

Network Settings
SIP ToS/DiffServ Value: SIP CoS Value: [0-7]
RTP ToS/DiffServ Value: RTP CoS Value: [0-7]
Network Jitter Level: Jitter Buffer Adjustment:

SIP Settings
SIP Port: SIP 100REL Enable:
EXT SIP Port: Auth Resync-Reboot:
SIP Proxy-Require: SIP Remote-Party-ID:
SIP GUID: SIP Debug Option:
RTP Log Intvl: Restrict Source IP:
Referor Bye Delay: Refer Target Bye Delay:
Referee Bye Delay: Refer-To Target Contact:
Sticky 183:

Proxy and Registration
Proxy:
Outbound Proxy:
Use Outbound Proxy: Use OB Proxy In Dialog:
Register: Make Call Without Reg:
Register Expires: Ans Call Without Reg:
Use DNS SRV: DNS SRV Auto Prefix:
Proxy Fallback Intvl: Proxy Redundancy Method:

Subscriber Information
Display Name: User ID:
Password: Use Auth ID:
Auth ID:
Mini Certificate:
SRTP Private Key:

Audio Configuration
Preferred Codec: Silence Supp Enable:
Use Pref Codec Only: Echo Canc Enable:
G729a Enable: Echo Canc Adapt Enable:
G723 Enable: Echo Supp Enable:
G726-16 Enable: FAX CED Detect Enable:
G726-24 Enable: FAX CNG Detect Enable:
G726-32 Enable: FAX Passthru Codec:
G726-40 Enable: FAX Codec Symmetric:
DTMF Process INFO: FAX Passthru Method:
DTMF Process AVT: DTMF Tx Method:
Release Unused Codec: FAX Process NSE:
Symmetric RTP: FAX Disable ECAN:

Dial Plans
Dial Plan 1:
Dial Plan 2: Inbound Routes
Route: PSTN
Edit Extension 106 (Portable)
Top of Form
• General
• Advanced
• Privacy
• Fax
• Other
Description

DID Number
014830000
CallerID Number

CID Priority Route
Yes No
Alert Info

Ringer Volume Override

CID name prefix

Music On Hold

Set Destination

Dial Plan 3:
Dial Plan 4:
Dial Plan 5:
Dial Plan 6:
Dial Plan 7:
Dial Plan 8:

VoIP-To-PSTN Gateway Setup
VoIP-To-PSTN Gateway Enable: VoIP Caller Auth Method:
VoIP PIN Max Retry: One Stage Dialing:
Line 1 VoIP Caller DP: VoIP Caller Default DP:
Line 1 Fallback DP:
VoIP Caller ID Pattern:
VoIP Access List:
VoIP Caller 1 PIN: VoIP Caller 1 DP:
VoIP Caller 2 PIN: VoIP Caller 2 DP:
VoIP Caller 3 PIN: VoIP Caller 3 DP:
VoIP Caller 4 PIN: VoIP Caller 4 DP:
VoIP Caller 5 PIN: VoIP Caller 5 DP:
VoIP Caller 6 PIN: VoIP Caller 6 DP:
VoIP Caller 7 PIN: VoIP Caller 7 DP:
VoIP Caller 8 PIN: VoIP Caller 8 DP:

VoIP Users and Passwords (HTTP Authentication)
VoIP User 1 Auth ID: VoIP User 1 DP:
VoIP User 1 Password:
VoIP User 2 Auth ID: VoIP User 2 DP:
VoIP User 2 Password:
VoIP User 3 Auth ID: VoIP User 3 DP:
VoIP User 3 Password:
VoIP User 4 Auth ID: VoIP User 4 DP:
VoIP User 4 Password:
VoIP User 5 ID Auth ID: VoIP User 5 DP:
VoIP User 5 Password:
VoIP User 6 Auth ID: VoIP User 6 DP:
VoIP User 6 Password:
VoIP User 7 Auth ID: VoIP User 7 DP:
VoIP User 7 Password:
VoIP User 8 Auth ID: VoIP User 8 DP:
VoIP User 8 Password:

PSTN-To-VoIP Gateway Setup
PSTN-To-VoIP Gateway Enable: PSTN Caller Auth Method:
PSTN Ring Thru Line 1: PSTN PIN Max Retry:
PSTN CID For VoIP CID: PSTN CID Number Prefix:
PSTN Caller Default DP: Off Hook While Calling VoIP:
Line 1 Signal Hook Flash To PSTN: PSTN CID Name Prefix:
PSTN Caller ID Pattern:
PSTN Access List:
PSTN Caller 1 PIN: PSTN Caller 1 DP:
PSTN Caller 2 PIN: PSTN Caller 2 DP:
PSTN Caller 3 PIN: PSTN Caller 3 DP:
PSTN Caller 4 PIN: PSTN Caller 4 DP:
PSTN Caller 5 PIN: PSTN Caller 5 DP:
PSTN Caller 6 PIN: PSTN Caller 6 DP:
PSTN Caller 7 PIN: PSTN Caller 7 DP:
PSTN Caller 8 PIN: PSTN Caller 8 DP:

FXO Timer Values (sec)
VoIP Answer Delay: VoIP PIN Digit Timeout:
PSTN Answer Delay: PSTN PIN Digit Timeout:
PSTN-To-VoIP Call Max Dur: PSTN Ring Thru Delay:
VoIP-To-PSTN Call Max Dur: PSTN Ring Thru CWT Delay:
VoIP DLG Refresh Intvl: PSTN Ring Timeout:
PSTN Dialing Delay: PSTN Dial Digit Len:
PSTN Hook Flash Len:

PSTN Disconnect Detection
Detect CPC: Detect Polarity Reversal:
Detect PSTN Long Silence: Detect VoIP Long Silence:
PSTN Long Silence Duration: VoIP Long Silence Duration:
PSTN Silence Threshold: Min CPC Duration:
Detect Disconnect Tone:
Disconnect Tone:

International Control
FXO Port Impedance: Ring Frequency Min:
SPA To PSTN Gain: Ring Frequency Max:
PSTN To SPA Gain: Ring Validation Time:
Tip/Ring Voltage Adjust: Ring Indication Delay:
Operational Loop Current Min: Ring Timeout:
On-Hook Speed: Ring Threshold:
Current Limiting Enable: Ringer Impedance:
Line-In-Use Voltage:

FreePBX

Asterisk Log

[2017-12-21 09:01:23] VERBOSE[5403] res_pjsip/pjsip_configuration.c: Contact 101/sip:[email protected]:64302;rinstance=9fa5e100c085adf2 is now Unreachable. RTT: 0.000 msec
[2017-12-21 09:01:24] VERBOSE[5403] res_pjsip/pjsip_configuration.c: Endpoint 101 is now Unreachable
[2017-12-21 09:01:51] VERBOSE[31844] res_pjsip_registrar.c: Added contact ‘sip:[email protected]:64302;rinstance=9fa5e100c085adf2’ to AOR ‘101’ with expiration of 3600 seconds
[2017-12-21 09:01:51] VERBOSE[18780] res_pjsip/pjsip_configuration.c: Contact 101/sip:[email protected]:64302;rinstance=9fa5e100c085adf2 has been created
[2017-12-21 09:01:51] VERBOSE[18780] res_pjsip/pjsip_configuration.c: Endpoint 101 is now Reachable
[2017-12-21 09:01:51] VERBOSE[18780] res_pjsip/pjsip_configuration.c: Contact 101/sip:[email protected]:64302;rinstance=9fa5e100c085adf2 has been deleted
[2017-12-21 09:01:51] VERBOSE[31844] res_pjsip_registrar.c: Removed contact ‘sip:[email protected]:64302;rinstance=9fa5e100c085adf2’ from AOR ‘101’ due to request
[2017-12-21 09:01:51] VERBOSE[5403] res_pjsip/pjsip_configuration.c: Contact 101/sip:[email protected]:64302;rinstance=9fa5e100c085adf2 has been deleted
[2017-12-21 09:01:51] VERBOSE[5403] res_pjsip/pjsip_configuration.c: Endpoint 101 is now Unreachable
[2017-12-21 09:01:51] VERBOSE[18780] res_pjsip/pjsip_configuration.c: Contact 101/sip:[email protected]:64302;rinstance=9fa5e100c085adf2 is now Reachable. RTT: 0.000 msec
[2017-12-21 09:01:51] VERBOSE[26152] res_pjsip_registrar.c: Added contact ‘sip:[email protected]:64302;rinstance=9fa5e100c085adf2’ to AOR ‘101’ with expiration of 3600 seconds
[2017-12-21 09:01:51] VERBOSE[5403] res_pjsip/pjsip_configuration.c: Contact 101/sip:[email protected]:64302;rinstance=9fa5e100c085adf2 has been created
[2017-12-21 09:01:51] VERBOSE[5403] res_pjsip/pjsip_configuration.c: Endpoint 101 is now Reachable
[2017-12-21 09:15:54] VERBOSE[1300][C-00000026] netsock2.c: Using SIP RTP TOS bits 184
[2017-12-21 09:15:54] VERBOSE[1300][C-00000026] netsock2.c: Using SIP RTP CoS mark 5
[2017-12-21 09:15:54] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:1] ResetCDR(“SIP/106-0000001e”, “”) in new stack
[2017-12-21 09:15:54] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:2] NoCDR(“SIP/106-0000001e”, “”) in new stack
[2017-12-21 09:15:54] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:3] Progress(“SIP/106-0000001e”, “”) in new stack
[2017-12-21 09:15:54] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:4] Wait(“SIP/106-0000001e”, “1”) in new stack
[2017-12-21 09:15:55] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:5] Playback(“SIP/106-0000001e”, “silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer”) in new stack
[2017-12-21 09:15:55] VERBOSE[11094][C-00000026] file.c: <SIP/106-0000001e> Playing ‘silence/1.ulaw’ (language ‘en’)
[2017-12-21 09:15:56] VERBOSE[11094][C-00000026] file.c: <SIP/106-0000001e> Playing ‘cannot-complete-as-dialed.ulaw’ (language ‘en’)
[2017-12-21 09:15:59] VERBOSE[11094][C-00000026] file.c: <SIP/106-0000001e> Playing ‘check-number-dial-again.ulaw’ (language ‘en’)
[2017-12-21 09:16:01] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:6] Wait(“SIP/106-0000001e”, “1”) in new stack
[2017-12-21 09:16:01] VERBOSE[11094][C-00000026] pbx.c: Spawn extension (from-internal, 123, 6) exited non-zero on ‘SIP/106-0000001e’
[2017-12-21 09:16:01] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:1] Macro(“SIP/106-0000001e”, “hangupcall”) in new stack
[2017-12-21 09:16:01] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:1] GotoIf(“SIP/106-0000001e”, “1?theend”) in new stack
[2017-12-21 09:16:01] VERBOSE[11094][C-00000026] pbx_builtins.c: Goto (macro-hangupcall,s,3)
[2017-12-21 09:16:01] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:3] ExecIf(“SIP/106-0000001e”, “0?Set(CDR(recordingfile)=)”) in new stack
[2017-12-21 09:16:01] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:4] NoOp(“SIP/106-0000001e”, " monior file= ") in new stack
[2017-12-21 09:16:01] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:5] AGI(“SIP/106-0000001e”, “attendedtransfer-rec-restart.php,”) in new stack
[2017-12-21 09:16:01] VERBOSE[11094][C-00000026] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/attendedtransfer-rec-restart.php
[2017-12-21 09:16:02] VERBOSE[11094][C-00000026] res_agi.c: <SIP/106-0000001e>AGI Script attendedtransfer-rec-restart.php completed, returning 0
[2017-12-21 09:16:02] VERBOSE[11094][C-00000026] pbx.c: Executing [[email protected]:6] Hangup(“SIP/106-0000001e”, “”) in new stack
[2017-12-21 09:16:02] VERBOSE[11094][C-00000026] app_macro.c: Spawn extension (macro-hangupcall, s, 6) exited non-zero on ‘SIP/106-0000001e’ in macro ‘hangupcall’
[2017-12-21 09:16:02] VERBOSE[11094][C-00000026] pbx.c: Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/106-0000001e’

Trunk Settings

Edit Trunk
In use by 1 route
Top of Form
• General
• Dialed Number Manipulation Rules
• pjsip Settings
Trunk Name

Hide CallerID
Yes No
Outbound CallerID

CID Options
Allow Any CID Block Foreign CIDs Remove CNAM Force Trunk CID
Maximum Channels
Asterisk Trunk Dial Options
Override System
Continue if Busy
Yes No
Disable Trunk
Yes No
Monitor Trunk Failures
Yes No
Bottom of Form
Dialled Number Manipulation Rules

Edit Trunk
In use by 1 route
• General
• Dialed Number Manipulation Rules
• pjsip Settings

Dial Number Manipulation Rules
These rules can manipulate the dialed number before sending it out this trunk. If no rule applies, the number is not changed. The original dialed number is passed down from the route where some manipulation may have already occurred. This trunk has the option to further manipulate the number. If the number matches the combined values in the prefix plus the match pattern boxes, the rule will be applied and all subsequent rules ignored.
Upon a match, the prefix, if defined, will be stripped. Next the prepend will be inserted in front of the match pattern and the resulting number will be sent to the trunk. All fields are optional.

Rules:
X matches any digit from 0-9
Z matches any digit from 1-9
N matches any digit from 2-9
[1237-9] matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)
. wildcard, matches one or more characters (not allowed before a | or +)

Dial patterns wizards
() | [
() |

PJSIP Settings

Edit Trunk
In use by 1 route
• General
• Dialed Number Manipulation Rules
• pjsip Settings
PJSIP Settings
• General
• Advanced
• Codecs
Username

Secret

Authentication
Outbound Inbound Both None
Registration
Send Receive None
Language Code

SIP Server

SIP Server Port
Context

Transport

Outbound Rules

• Route Settings
• Dial Patterns
• Import/Export Patterns
• Additional Settings
Route Name

Route CID

Override Extension
Yes No
Route Password

Route Type
Emergency Intra-Company
Music On Hold?

Time Match Time Zone:

Use System Timezone

Time Match Time Group

Route Position

Trunk Sequence for Matched Routes

Outbound Routes
Edit Route: PSTN: PSTN
• Route Settings
• Dial Patterns
• Import/Export Patterns
• Additional Settings

Dial Patterns that will use this Route
Pattern Help

Dial patterns wizards
() | [/ ]
() | [
Outbound Routes
Edit Route: PSTN: PSTN
• Route Settings
• Dial Patterns
• Import/Export Patterns
• Additional Settings
Note that the meaning of these options has changed. Please read the wiki for futher information on these changes.
Call Recording
ForceYesDon’t CareNoNever
PIN Set

Inbound Rules

Inbound Routes
Route: PSTN
Edit Extension 106 (Portable)
• General
• Advanced
• Privacy
• Fax
• Other
Description

DID Number

CallerID Number

CID Priority Route
Yes No
Alert Info

Ringer Volume Override

CID name prefix

Music On Hold

Set Destination

Hello I have recently setup a system using SIPGATE in the UK … I now have it working; I am new to this as well; so I am not 100% certain how I got it working; but it did need some tweaking especially with my routers firewall that was blocking voice in one direction. Which service provider are you using out of interest? If sipgate I may be able to send you something that helps from my installation?

Hi Robert,

I am not using a SIP service provider. I am using the Linksys SPA3102 to convert SIP to analogue and hence connect to my existing PSTN provider.

Glad to hear you have your system up and running.

All the best

Peter

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