No success on PSTN Trunk with SPA-3000

Hi everyone.
I’ve already configured a FreePBX 14.0.3.13 system (although on Asterisk page says that current version is 13.22.0) on a Raspberry PI box (beautiful gadget, BTW) and some extensions without any issue. I want to configure a PSTN trunk using a SPA-3000 and I’ve followed the know guide from the wiki

FreePBX system: 192.168.168.139
SPA-3000: 192.168.168.173

I can make calls between the “Line 1” extension confgured on the SPA-3000 (extension number=3000) and the other extensions (and viceversa). If I left activated the “PSTN Ring Thru Line 1” option, I can answer incoming calls on the PSTN on the Line 1 extensions.

On the info tab of the SPA-3000 I see the “Line 1” registration status es OK but the PSTN registration state is failed. However, on the FreePBX info page/ChanSIP Info, I’m seeing “1 sip peer online”.

So far, I could not make work neither the PSTN-2-VOIP feature nor the VOIP-2-PSTN one.

For the Inbound (PSTN to VOIP) part, I believe the issue is with dial plan on the SPA-3000, I configured “SO<:101>” to forward any PSTN incoming call to the 101 extension, but this is not working. I considered “DIDNumber” on the guide is related to the extension number I want to call for this DialPlan. I’ve also tried with
“SO<:101 @192.168.168.139>” directing to the IP address of the FreePBX.

For the Outbound (VOIP to PSTN) part, the dial pattern already matches (I want to dial a 0 then the 7 numbers of any local call) but the calls didn’t get through.

So, questions:
-What will be the best way to troubleshoot both ways? Is there a “real-time” log of calls and erros I can access on the FreePBX console?
-“DIDnumber” and dialplan seems OK?
-Although sounds logical, let me ask the silly question: It’s needed that the “PSTN Line Status” on the SPA-3000 get on “Registered”? (It seems from FreePBX side that is already registered!

I’m trying to attach snapshots with configuration details from both systems, but as I’m a new users it seems I can’t upload any attachment or link. If useful, I’ve uploaded it to tinyurl:

tinyurl. com / MyFreePBXTrunkDetails

Thanks in advance for your guidance!

I have an SPA3102 in my system, which is pretty similar to the SPA3000. You either need to get the SPA to register, or configure it to work without registration. Assuming the former (the way mine is set up), try these outgoing trunk settings:

host=dynamic
username=3001
secret=13023001
type=peer

And for incoming:

secret=13023001
type=user

Reboot the SPA and see if it shows registered. If not, check that PSTN Line -> Password is set to 13023001 and if no luck, type
sip set debug on
at the Asterisk console, reboot and report what happens on the registration attempts.

For PSTN->VoIP, try setting:
Dial Plan 2: (S0<:1234>) [Note: S0, not SO. Replace 1234 with your DID number (for use in future Inbound Route)]
PSTN Answer Delay: 4
PSTN Ring Thru Delay: 1
Make sure that your extension 101 is online and working (it wasn’t in your screenshot), test incoming.

For VoIP->PSTN, I don’t understand your outbound route. For initial testing, set Prepend and Prefix both blank and set Match Pattern to
XX.
then dial on your extension, exactly what should be sent to the PSTN.

I almost certainly missed some stuff; report what still doesn’t work and we’ll take it from there.

2 Likes

Hey Stewart, thank you very much for your quick response and for your time to support a new user.

I’ve changed Outgoing peer details on "SIP Config" from FreePBX Trunk as suggested. I understood for the incoming, those details should be configured on "USER Details" (and the extension number, 3001 in this case, in "USER Context". I’ve made both changes.

SPA keeps showing "Failure" on the registration state for the PSTN Line Status, however, on the Asterisk console, It shows that the 3001 user (the one used on the trunk) is already registered:

raspbx*CLI> sip show peers
Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description
PSTN_ChanSIP_Trunk/3001   (Unspecified)                            D  Yes        Yes            0        Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 1 offline]
raspbx*CLI> sip show users
Username                   Secret           Accountcode      Def.Context      ACL  Forcerport
3001                       13023001                          from-trunk-sip-  No   Yes

The message I got frequently on the console is:

[2018-09-06 20:39:58] WARNING[30408]: res_pjsip_pubsub.c:3374 pubsub_on_rx_publish_request: No registered publish handler for event presence

But, when the SPA tried to register the PSTN, console shows the following messages:

[2018-09-06 20:48:23] NOTICE[5269]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request 'REGISTER' from '"PSTN Trunk" <sip:[email protected]>' failed for '192.168.168.173:5062' (callid: [email protected]) - No matching endpoint found
[2018-09-06 20:48:23] NOTICE[5269]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request 'REGISTER' from '"PSTN Trunk" <sip:[email protected]>' failed for '192.168.168.173:5062' (callid: [email protected]) - No matching endpoint found
[2018-09-06 20:48:23] NOTICE[5269]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request 'REGISTER' from '"PSTN Trunk" <sip:[email protected]>' failed for '192.168.168.173:5062' (callid: [email protected]) - Failed to authenticate
[2018-09-06 20:48:23] NOTICE[5269]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request 'REGISTER' from '"PSTN Trunk" <sip:[email protected]>' failed for '192.168.168.173:5062' (callid: [email protected]) - No matching endpoint found
[2018-09-06 20:48:23] NOTICE[5269]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request 'REGISTER' from '"PSTN Trunk" <sip:[email protected]>' failed for '192.168.168.173:5062' (callid: [email protected]) - Failed to authenticate

Now, regarding your recommended setting For PSTN-VOIP:

DID number will be the extension number where I want to receive the PSTN Incoming calls, right? Or it’s related to the "public" number my PSTN Line have now?

Anyway, I’ve tried with both scenarios, and also both delays, none works. I supose it’s related to the registration thing… (Extension 1010 is online on a softphone and it make and receive calls without any issue).

For the VOIP-PSTN part:

I’ve removed prefix, and configured the pattern to XX.

The I’ve tried to dial out a local number directly from the softphone, it shows a "503 Service Unavailable" error, and on the console, the following messages were shown:

[2018-09-06 21:01:50] WARNING[5798][C-00000000]: app_dial.c:2527 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
[2018-09-06 21:01:50] WARNING[5798][C-00000000]: app_macro.c:321 _macro_exec: No such context 'macro-outisbusy' for macro 'outisbusy'. Was called by 3430000@from-internal
Really destroying SIP dialog '[email protected]:5160' Method: INVITE

When I’ve changed dial pattern, freepbx reloaded and a lot messages shown on console, I don’t see any direct relation with current issue, but anyway those are at the end of the message.

It’s seems like a good step in the right direction. Now with the sip debug there’s more info on the issue, but I don’t understand why it says the SIP trunk is established but at the same time it’s not recognized…

Anyway, please let me know if I’m missing a big step here. Thanks again for your help!

[2018-09-06 20:58:54] ERROR[5660]: config_options.c:708 aco_process_config: Unable to load config file 'acl.conf'
[2018-09-06 20:58:54] WARNING[5660]: named_acl.c:413 ast_named_acl_reload: Could not reload ACL config
[2018-09-06 20:58:54] NOTICE[5660]: cdr.c:4459 cdr_toggle_runtime_options: CDR simple logging enabled.
[2018-09-06 20:58:54] NOTICE[5660]: res_odbc.c:616 load_odbc_config: Registered ODBC class 'asteriskcdrdb' dsn->[MySQL-asteriskcdrdb]
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 199 of /etc/asterisk/extensions_additional.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 200 of /etc/asterisk/extensions_additional.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 827 of /etc/asterisk/extensions_additional.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 828 of /etc/asterisk/extensions_additional.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 829 of /etc/asterisk/extensions_additional.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 830 of /etc/asterisk/extensions_additional.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 878 of /etc/asterisk/extensions_additional.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 879 of /etc/asterisk/extensions_additional.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 127 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 128 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 129 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 130 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 131 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 132 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 133 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 172 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 173 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 174 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 186 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 187 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx_config.c:1843 pbx_load_config: The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line 188 of extensions.conf
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-did-direct' tries to include nonexistent context 'ext-findmefollow'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-internal-xfer' tries to include nonexistent context 'from-internal-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-internal-noxfer' tries to include nonexistent context 'from-internal-noxfer-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-pstn' tries to include nonexistent context 'from-pstn-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-internal-noxfer-additional' tries to include nonexistent context 'from-internal-noxfer-additional-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-internal-additional' tries to include nonexistent context 'from-internal-additional-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-parked-call' tries to include nonexistent context 'macro-parked-call-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'func-apply-sipheaders' tries to include nonexistent context 'func-apply-sipheaders-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'func-set-sipheader' tries to include nonexistent context 'func-set-sipheader-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-dial-one' tries to include nonexistent context 'macro-dial-one-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-hangupcall' tries to include nonexistent context 'macro-hangupcall-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-blkvm-check' tries to include nonexistent context 'macro-blkvm-check-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-blkvm-clr' tries to include nonexistent context 'macro-blkvm-clr-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-blkvm-set' tries to include nonexistent context 'macro-blkvm-set-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-blkvm-setifempty' tries to include nonexistent context 'macro-blkvm-setifempty-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'originate-skipvm' tries to include nonexistent context 'originate-skipvm-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-simple-dial' tries to include nonexistent context 'macro-simple-dial-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-exten-vm' tries to include nonexistent context 'macro-exten-vm-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-vm' tries to include nonexistent context 'macro-vm-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-block-cf' tries to include nonexistent context 'macro-block-cf-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-setmusic' tries to include nonexistent context 'macro-setmusic-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-dial-confirm' tries to include nonexistent context 'macro-dial-confirm-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-dahdi' tries to include nonexistent context 'from-dahdi-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-zaptel' tries to include nonexistent context 'from-zaptel-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-outbound-callerid' tries to include nonexistent context 'macro-outbound-callerid-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-user-callerid' tries to include nonexistent context 'macro-user-callerid-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-privacy-mgr' tries to include nonexistent context 'macro-privacy-mgr-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-dialout-trunk' tries to include nonexistent context 'macro-dialout-trunk-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'sub-pincheck' tries to include nonexistent context 'sub-pincheck-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-auto-blkvm' tries to include nonexistent context 'macro-auto-blkvm-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-auto-confirm' tries to include nonexistent context 'macro-auto-confirm-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-confirm' tries to include nonexistent context 'macro-confirm-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'sub-presencestate-display' tries to include nonexistent context 'sub-presencestate-display-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'bad-number' tries to include nonexistent context 'bad-number-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-blackhole' tries to include nonexistent context 'app-blackhole-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'outrt-1' tries to include nonexistent context 'outrt-1-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'outbound-allroutes' tries to include nonexistent context 'outbound-allroutes-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-prepend-cid' tries to include nonexistent context 'macro-prepend-cid-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'ext-trunk' tries to include nonexistent context 'ext-trunk-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-trunk-sip-PSTN_ChanSIP_Trunk' tries to include nonexistent context 'from-trunk-sip-PSTN_ChanSIP_Trunk-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'from-did-direct-ivr' tries to include nonexistent context 'from-did-direct-ivr-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'ext-local' tries to include nonexistent context 'ext-local-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'ext-did-catchall' tries to include nonexistent context 'ext-did-catchall-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'ext-did-0001' tries to include nonexistent context 'ext-did-0001-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'ext-did' tries to include nonexistent context 'ext-did-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'ext-test' tries to include nonexistent context 'ext-test-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-chanspy' tries to include nonexistent context 'app-chanspy-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-pickup' tries to include nonexistent context 'app-pickup-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'findmefollow-ringallv2' tries to include nonexistent context 'findmefollow-ringallv2-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'ext-local-confirm' tries to include nonexistent context 'ext-local-confirm-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-dial' tries to include nonexistent context 'macro-dial-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-vmmain' tries to include nonexistent context 'app-vmmain-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-dialvm' tries to include nonexistent context 'app-dialvm-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'vm-callme' tries to include nonexistent context 'vm-callme-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'ext-group' tries to include nonexistent context 'ext-group-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-systemrecording' tries to include nonexistent context 'macro-systemrecording-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'systemrecording-gui' tries to include nonexistent context 'systemrecording-gui-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'sub-hr24format' tries to include nonexistent context 'sub-hr24format-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-speakingclock' tries to include nonexistent context 'app-speakingclock-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'sub-hr12format' tries to include nonexistent context 'sub-hr12format-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-speakextennum' tries to include nonexistent context 'app-speakextennum-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-echo-test-echo' tries to include nonexistent context 'app-echo-test-echo-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-echo-test' tries to include nonexistent context 'app-echo-test-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-calltrace-perform' tries to include nonexistent context 'app-calltrace-perform-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'app-calltrace' tries to include nonexistent context 'app-calltrace-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'ext-featurecodes' tries to include nonexistent context 'ext-featurecodes-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'macro-one-touch-record' tries to include nonexistent context 'macro-one-touch-record-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'sub-record-hh-check' tries to include nonexistent context 'sub-record-hh-check-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'sub-record-check' tries to include nonexistent context 'sub-record-check-custom'
[2018-09-06 20:58:54] WARNING[5660]: pbx.c:8547 ast_context_verify_includes: Context 'sub-record-cancel' tries to include nonexistent context 'sub-record-cancel-custom'
[2018-09-06 20:58:54] ERROR[5660]: res_sorcery_config.c:261 sorcery_config_internal_load: Unable to load config file 'pjproject.conf'
[2018-09-06 20:58:54] ERROR[5269]: res_pjsip_config_wizard.c:1089 object_type_loaded_observer: Unable to load config file 'pjsip_wizard.conf'
[2018-09-06 20:58:54] ERROR[5269]: res_pjsip_config_wizard.c:1089 object_type_loaded_observer: Unable to load config file 'pjsip_wizard.conf'
[2018-09-06 20:58:54] ERROR[5269]: res_pjsip_config_wizard.c:1089 object_type_loaded_observer: Unable to load config file 'pjsip_wizard.conf'
[2018-09-06 20:58:54] ERROR[5269]: res_pjsip_endpoint_identifier_ip.c:403 ip_identify_apply: Identify '101-identify' is not configured to match anything.
[2018-09-06 20:58:54] ERROR[5269]: res_sorcery_config.c:338 sorcery_config_internal_load: Could not create an object of type 'identify' with id '101-identify' from configuration file 'pjsip.conf'
[2018-09-06 20:58:54] ERROR[5269]: res_pjsip_endpoint_identifier_ip.c:403 ip_identify_apply: Identify '102-identify' is not configured to match anything.
[2018-09-06 20:58:54] ERROR[5269]: res_sorcery_config.c:338 sorcery_config_internal_load: Could not create an object of type 'identify' with id '102-identify' from configuration file 'pjsip.conf'
[2018-09-06 20:58:54] ERROR[5269]: res_pjsip_endpoint_identifier_ip.c:403 ip_identify_apply: Identify '3000-identify' is not configured to match anything.
[2018-09-06 20:58:54] ERROR[5269]: res_sorcery_config.c:338 sorcery_config_internal_load: Could not create an object of type 'identify' with id '3000-identify' from configuration file 'pjsip.conf'
[2018-09-06 20:58:54] ERROR[5269]: res_pjsip_config_wizard.c:1089 object_type_loaded_observer: Unable to load config file 'pjsip_wizard.conf'
[2018-09-06 20:58:54] NOTICE[5269]: sorcery.c:1253 sorcery_object_load: Type 'system' is not reloadable, maintaining previous values
[2018-09-06 20:58:55] ERROR[5269]: res_pjsip_config_wizard.c:1089 object_type_loaded_observer: Unable to load config file 'pjsip_wizard.conf'
[2018-09-06 20:58:55] ERROR[5660]: ari/config.c:312 process_config: No configured users for ARI
[2018-09-06 20:58:55] NOTICE[5660]: res_fax.c:4375 set_config: Configuration file 'res_fax.conf' not found, not changing options.
[2018-09-06 20:58:55] ERROR[5660]: res_pjsip_config_wizard.c:1089 object_type_loaded_observer: Unable to load config file 'pjsip_wizard.conf'
[2018-09-06 20:58:55] NOTICE[5660]: iax2/provision.c:562 iax_provision_reload: No IAX provisioning configuration found, IAX provisioning disabled.
[2018-09-06 20:58:55] ERROR[5660]: res_pjsip_config_wizard.c:1089 object_type_loaded_observer: Unable to load config file 'pjsip_wizard.conf'
[2018-09-06 20:58:55] NOTICE[5660]: confbridge/conf_config_parser.c:2089 verify_default_profiles: Adding default_menu menu to app_confbridge
[2018-09-06 20:58:55] WARNING[5660]: app_voicemail.c:13882 actual_load_config: maxsilence should be less than minsecs or you may get empty messages
[2018-09-06 20:58:55] NOTICE[5660]: app_queue.c:8729 reload_queue_rules: No queuerules.conf file found, queues will not follow penalty rules
[2018-09-06 20:58:55] ERROR[5299]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo("raspbx.metrodns.org", "(null)", ...): Name or service not known
[2018-09-06 20:58:55] WARNING[5299]: chan_sip.c:32719 reload_config: Invalid address for externhost keyword: raspbx.metrodns.org
[2018-09-06 20:59:34] WARNING[5269]: res_pjsip_pubsub.c:3374 pubsub_on_rx_publish_request: No registered publish handler for event presence

Oops, I missed that your FreePBX is recent enough to have defaults of pjsip on port 5060 and chan_sip on port 5160. You can check this in Asterisk SIP Settings. For pjsip, it’s called Port to Listen On; for chan_sip it’s called Bind Port. If you change these, you need to restart (not just reload) Asterisk.

Assuming chan_sip on 5160, in the SPA change PSTN Line -> Proxy to
192.168.168.139:5160
reboot and recheck. If it still won’t register, use the Asterisk console to set
sip set debug on
and post the REGISTER requests sent by the SPA and any responses sent by Asterisk.
The normal sequence is:
SPA sends REGISTER (without Authorization header).
Asterisk responds 401 UnAuthorized.
SPA sends REGISTER with Authorization header.
Asterisk responds 200 OK.

If Asterisk sees the SPA as registered,
sip show peers
will show its IP address in the host column.

1 Like

Hi Stewart!

You’re right, Chan SIP "Bind Port" is on 5160 and "TLS Bind Port" on 5161, PJSIP "Por to Listen On" is on 5060

I’ve changed the proxy address on SPA PSTN Line to reflect this (192.168.168.139:5160) but it stills don’t register.

When reboot the SPA, it tried to register with the following messages :

[2018-09-07 09:27:46] NOTICE[5299]: chan_sip.c:28691 handle_request_register: Registration from 'PSTN Trunk <sip:[email protected]:5160>' failed for '192.168.168.173:5062' - Wrong password
Scheduling destruction of SIP dialog '[email protected]' in 32000 ms (Method: REGISTER)
raspbx*CLI>
[2018-09-07 09:28:11] WARNING[17608]: res_pjsip_pubsub.c:3374 pubsub_on_rx_publish_request: No registered publish handler for event presence
Really destroying SIP dialog '[email protected]' Method: REGISTER

It seems clear that now the issue was with the password, but I was (almost) sure ext 3001 was created. It wasn’t, I’ve created the extension (as a CchanSIP one) and rebooted.

PSTN Line is REGISTERED NOW and VOILÁ! Incoming calls to the PSTN are now being redirected to the extension 101 and are working fine!! Thanks a lot for this!

Now, for the outbound part, Dial pattern is configured as "XX." as suggested, but calls are not completed, from a extension it’s get the Busy tone. Form the Asterisk console, I got the following messages:

raspbx*CLI>
[2018-09-07 14:40:39] WARNING[24703][C-00000008]: app_dial.c:2527 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
[2018-09-07 14:40:39] WARNING[24703][C-00000008]: app_macro.c:321 _macro_exec: No such context 'macro-outisbusy' for macro 'outisbusy'. Was called by 6962023@from-internal
Really destroying SIP dialog '[email protected]:5160' Method: INVITE
Reliably Transmitting (no NAT) to 192.168.168.173:5062:
OPTIONS sip:[email protected]:5062 SIP/2.0
Via: SIP/2.0/UDP 192.168.168.139:5160;branch=z9hG4bK03053fcc
Max-Forwards: 70
From: "Unknown" <sip:[email protected]:5160>;tag=as641c0c60
To: <sip:[email protected]:5062>
Contact: <sip:[email protected]:5160>
Call-ID: [email protected]:5160
CSeq: 102 OPTIONS
User-Agent: FPBX-14.0.3.13(13.22.0)
Date: Fri, 07 Sep 2018 19:40:57 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:192.168.168.173:5062 --->
SIP/2.0 200 OK
To: <sip:[email protected]:5062>;tag=4ba5c7e6e36c9ca3i1
From: "Unknown" <sip:[email protected]:5160>;tag=as641c0c60
Call-ID: [email protected]:5160
CSeq: 102 OPTIONS
Via: SIP/2.0/UDP 192.168.168.139:5160;branch=z9hG4bK03053fcc
Server: Linksys/SPA3000-3.1.20(GW)
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: x-sipura, replaces

<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog '[email protected]:5160' Method: OPTIONS
raspbx*CLI>

First line of the messages points to "No subscriber" but I understand the trunk already established will be used, right? What can be missing?

Thanks again!

I’m puzzled as to what is wrong. The intention was to set up the SPA’s PSTN Line section as a trunk in Asterisk. If you set it up as an extension, it can work for incoming except for caller ID (it ‘picks up’ the extension and dials 101), but won’t work for outgoing (calls to an extension don’t supply a destination number). It appears that though the trunk registration failed for reasons not yet known, when you configured a conflicting extension it registered ok and inbound calls took that path.

One approach is to delete extension 3001 and track down why registration for the trunk is failing. Are you using the Line 1 (FXS) port on the SPA? If so, make sure that its SIP Port and User ID don’t conflict with the PSTN Line. If not, just leave it disabled.

Make sure that Register String for the trunk in question is blank and that username 3001 or 192.168.168.173 isn’t used anywhere in your config except for the trunk. Try setting a new short password in ‘secret’ for outgoing and incoming, and in Password for the SPA’s PSTN Line.

If you still have trouble, post details including the SIP trace.

1 Like

Hi Stewart!
Thanks again for your time!

OK so I understood the PSTN should register to the Asterisk via the trunk details. You’re right, incoming calls are still working but no luck with the VOIP to PSTN ones.

So, I’ve deleted extension 3001 config.
Yes, I’m using the “Line 1” port on the SPA and a “3000” extension is assigned there.
Does this extension number (user/scret) works only from a “user extension” perspective and it does not imapct the “trunk” settings? It’s not configured anywhere else anyway. From what I’m learning now, I understand it’s not needed at all for the gateway features to work (both of them, PSTN to VOIP and VOIP to PSTN). So it’s seems safe to delete this extension 3000 from the Asterisk and configure the line to “Disabled” on the SPA. I’ve did it.

PSTN registration still failed, same mesasge than before with “wrong-password” error appeared.

Following your suggestion to a simpler password, I’ve changed SIP settings on the trunk on FreePBX for:
Outgoing:
host=dynamic
username=3001
secret=3001
type=peer

Incoming:
username=3001
secret=3001
type=user

Then, Just by looking at the config, I considered Incoming setting being different to outgoing ones a chance of failure, I’ve changed Incoming to:
username=3001
secret=3001
type=peer

Then, the SPA registered! Incoming calls are still working and now with Call ID feature also!
But, outgoing calls doesn’t…

Last log, when I try to place a call from an active extension to the outside world is:

[2018-09-11 19:04:03] WARNING[23295][C-00000014]: app_dial.c:2527 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
[2018-09-11 19:04:03] WARNING[23295][C-00000014]: app_macro.c:321 _macro_exec: No such context 'macro-outisbusy' for macro 'outisbusy'. Was called by 3430000@from-internal
[2018-09-11 19:04:03] WARNING[23295][C-00000014]: channel.c:5080 ast_prod: Prodding channel 'PJSIP/101-00000013' failed
Really destroying SIP dialog '[email protected]:5160' Method: INVITE

I was reading that the Cause 20 means that it is not registered, and here my following question: Trunk shouyld be “registered” for both ways (Incoming and Outcoming)? Or it’s just a “connection” that once registered can be used to calls in any way?
I’ve run a show peers command and it keeps showing an “Unspecified” peer for the same 3001 User, could be that?

raspbx*CLI> sip show peers
Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description
3001/3001                 192.168.168.173                          D  Yes        Yes            5160     Unmonitored
PSTN_ChanSIP_Trunk/3001   (Unspecified)                            D  Yes        Yes            0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline]

Thanks again for your support, I’m seeing we are closer to the issue! Tks!

Side note:

I’ve configured a Syslog serer to receive messages from SPA, but it’s not worth it, it shows only rebooted reasons (“W4” and “C4”) and a register info. No info regarding SIP connections or errors, even when on “max” debug level.

Rgrds.

To see the SIP conversation in your SPA syslog, set PSTN Line -> SIP Debug Option to full. With luck, you’ll see some activity on attempted outbound calls.

I don’t understand your ‘sip show peers’ output at all. First, I’d expect extension 3000 to show there (assuming that it is registered ok and working), though this is likely unrelated to the trouble you’re having with the FXO. Also, I don’t know why you are seeing two entries for the trunk; my system shows only one.

This is the only SPA I have and it’s in production, so I don’t want to experiment with settings, but these are the ones that are working here:

I use the same name for General -> Trunk Name and Outgoing -> Trunk Name. Yours have different capitalization, though I have no idea whether that matters. I also use the same name as the SPA username (and also don’t know whether that matters). So, for example, I would have for PEER Details:
host=dynamic
username=PSTN_ChanSIP_Trunk
secret=3001
type=peer

And for USER Details:
secret=3001
type=user
context=from-trunk

Of course, with these settings you would change in the SPA, PSTN Line-> User ID to PSTN_ChanSIP_Trunk .

After these changes, restart Asterisk (or reboot the entire server). With luck, you should see for sip show peers:
PSTN_ChanSIP_Trunk/PSTN_ChanSIP_Trunk 192.168.168.173 D Yes Yes 5062 Unmonitored
and no other entries for the PSTN Line side of the device.

2 Likes

You need to specify the correct port for the trunk. FXO runs on port 5062 if my memory is correct.

In my setup, the trunk port is not coded into the config but is learned from the incoming registration, just like extension ports are learned.

I suggest you code it and try outgoing calls after coding it.

It has run that way for six years and outgoing calls work fine. The SPA is behind a NAT so the source port number could potentially change. There is an OBi110 at another location with the same setup. In both cases, the FXS ports are unused; I don’t know whether that matters.

It doesn’t, the fxs runs on one port, the fxo runs on another

-OK, I’ve activated SIP Debug to full on the SPA, let’s see what the syslog server gets.

-There’s no ext 3000 registered as I’ve deactivated "Line1" on the SPA and removed ext 3000 on the FreePBX. I understood "line1" is not needed for the Gateway functions to work, so in order to reduce the complexity variables, i turned it off.

I’ve changed mine to reflect this approach, definitely, the trunkname must be same than “Username” in Peer details. Now I got registered and only one peer:

raspbx*CLI> sip show peers
Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description
PSTN_ChanSIP_Trunk/PSTN_C 192.168.168.173                          D  Yes        Yes            5160     Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]

And, both incoming and outgoing calls to/from a softphone extension are working well now!!

Therefore, FXO port config was not needed.

Thanks a lot for your support, I’ll now fine tune the dial pattern and adjust passwords and details.

TKS Again!

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