Loopback Trunk/Sip and connecting Grandstream HT814 V2

Here is the problem I’m trying to solve. Pizza place has analog phones at each table that when picked up auto-dial to 2 phones in the kitchen.

What I have.

raspbx up and running. I’ve setup a loopback trunk set to dial string local/$OUTNUM$@ext-did & an additional trunk set to dial string local/$OUTNUM$@from-trunk

Outbound Routes set to dial patterns of 10 digit phone numbers

Trunk Sequence for Matched Routes set to my loopback 1 and 2

five extensions starting at 101 to 105

I have an HT814 V2

Profile 1 Primary SIP Server set to ip of Freepbx

FXS PORT set to SIP user ID to 101, Authenticate ID to 101 Password set to the secret given in the extensions list.

What I don’t have… zero connectivity

this system will never need to reach an outside line (as of now) only able to dial call the kitchen with the added bonus of the caller ID showing the table number. I am thinking of using Yealink IP phones for the kitchen staff to answer.

What am I missing here?

What you have described so far does not require any trunks – just set Auto Dial to dial the kitchen extension, with two phones registered to it (set Max Contacts for that extension to 4).

Next, set Auto Dial Delay to (for example) 2 seconds, so you can quickly dial a different number for testing. Also, turn off Call Features so you can dial (for example) *65 (speak extension number) or another table extension.

Do the table phones register? If so,what happens when you call *43 (echo test) or another extension?

If not, what if anything appears in the Asterisk log when registration is attempted? If nothing, run sngrep and report what if anything appears there. If REGISTER requests are present, they are being blocked by FreePBX firewall or another firewall running on the system. If also nothing, check whether you can ping the HT from the PBX.

I can’t get this pi to install sngrep I was getting “Updating from such a repository can’t be done securely, and is therefore disabled by default.”

I was able to run “sudo apt-get update --allow-insecure-repositories”

but now getting 404 not found

I’m out of practice on Unix I am lost.

HT shows “Not Registered” on each port. I have not been able to make it connect.

OK, so HT shows not registered but Asterisk log /var/log/asterisk/full shows no activity at all. Run tcpdump to see whether any REGISTER requests coming in.

If yes, check

iptables -vL

for blocking by software firewall. If no, check ping to HT from PBX, IP addresses, etc.

I did a complete reset on everything. I rebuilt the rasPBX and Factory reset the HT. Only changes to the PI were to set the time zone.

What I have done so far. Added extensions 101-104 to FreePBX, then checked /var/log/asterisk/full. Below is what I am getting. I figure it’s a bit of a win since it’s actually trying to register.

But I’m stumped at this point.

[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - No matching endpoint found
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - No matching endpoint found
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - Failed to authenticate
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - No matching endpoint found
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - Failed to authenticate
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - No matching endpoint found
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - Failed to authenticate
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - No matching endpoint found
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - Failed to authenticate
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - No matching endpoint found
[2025-12-12 01:06:44] NOTICE[2682] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Table 1" <sip:[email protected]>' failed for '192.168.254.15:5060' (callid: [email protected]) - Failed to authenticate

Above repeats for all 4 lines/ports

That’s the setup. Although the FXS password looks blank, I copied them from FreePBX

Confirm that you copied from the Secret field of the corresponding extension.

At the Asterisk command prompt, type

pjsip show endpoint 101

and post the output.

Also, at the Asterisk command prompt, type

pjsip set logger on

wait for a registration retry and post the SIP trace (from console or from Asterisk log).

I copied and pasted exactly what the secret from FreePBX extension 101 to SIP Authentication Password on the HT FXS PORT

root@raspbx:~# asterisk -r

Asterisk 16.13.0, Copyright (C) 1999 - 2018, Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 16.13.0 currently running on raspbx (pid = 1137)
raspbx*CLI> pjsip show endpoint 101
Unable to find object 101.

raspbx*CLI> pjsip set logger on
PJSIP Logging enabled
<— Received SIP request (863 bytes) from UDP:192.168.254.15:5060 —>
REGISTER sip:192.168.254.14 SIP/2.0
Via: SIP/2.0/UDP 192.168.254.15:5060;branch=z9hG4bK826631074;rport
Route: sip:192.168.254.14:5060;lr
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 3363 REGISTER
Contact: sip:[email protected]:5060;reg-id=1;+sip.instance=“urn:uuid:00000000-0000-1000-8000-EC74D7887F14
Authorization: Digest username=“101”, realm=“asterisk”, nonce=“1765511788/b98e3d5e2159476c285f49d297396170”, uri=“sip:192.168.254.14”, response=“ffc36ca047bbe827d538572f84909ea5”, algorithm=md5, cnonce=“00955754”, opaque=“44d3fe004251fd18”, qop=auth, nc=00000006
Max-Forwards: 70
User-Agent: Grandstream HT814V2 1.0.5.4
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - No matching endpoint found
[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - Failed to authenticate
<— Transmitting SIP response (496 bytes) to UDP:192.168.254.15:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.254.15:5060;rport=5060;received=192.168.254.15;branch=z9hG4bK826631074
Call-ID: [email protected]
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected];tag=z9hG4bK826631074
CSeq: 3363 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1765511810/d505a9a466483e3530c619e6a3308885”,opaque=“3a2576d71bf4849d”,algorithm=md5,qop=“auth”
Server: FPBX-15.0.16.75(16.13.0)
Content-Length: 0

<— Received SIP request (864 bytes) from UDP:192.168.254.15:5060 —>
REGISTER sip:192.168.254.14 SIP/2.0
Via: SIP/2.0/UDP 192.168.254.15:5060;branch=z9hG4bK1580732864;rport
Route: sip:192.168.254.14:5060;lr
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 3364 REGISTER
Contact: sip:[email protected]:5060;reg-id=1;+sip.instance=“urn:uuid:00000000-0000-1000-8000-EC74D7887F14
Authorization: Digest username=“101”, realm=“asterisk”, nonce=“1765511810/d505a9a466483e3530c619e6a3308885”, uri=“sip:192.168.254.14”, response=“a13c736b79262692ae189aa2662fc90b”, algorithm=md5, cnonce=“03669364”, opaque=“3a2576d71bf4849d”, qop=auth, nc=00000001
Max-Forwards: 70
User-Agent: Grandstream HT814V2 1.0.5.4
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - No matching endpoint found
[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - Failed to authenticate
<— Transmitting SIP response (498 bytes) to UDP:192.168.254.15:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.254.15:5060;rport=5060;received=192.168.254.15;branch=z9hG4bK1580732864
Call-ID: [email protected]
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected];tag=z9hG4bK1580732864
CSeq: 3364 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1765511810/d505a9a466483e3530c619e6a3308885”,opaque=“7fafe7300ed96620”,algorithm=md5,qop=“auth”
Server: FPBX-15.0.16.75(16.13.0)
Content-Length: 0

<— Received SIP request (863 bytes) from UDP:192.168.254.15:5060 —>
REGISTER sip:192.168.254.14 SIP/2.0
Via: SIP/2.0/UDP 192.168.254.15:5060;branch=z9hG4bK588306916;rport
Route: sip:192.168.254.14:5060;lr
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 3365 REGISTER
Contact: sip:[email protected]:5060;reg-id=1;+sip.instance=“urn:uuid:00000000-0000-1000-8000-EC74D7887F14
Authorization: Digest username=“101”, realm=“asterisk”, nonce=“1765511810/d505a9a466483e3530c619e6a3308885”, uri=“sip:192.168.254.14”, response=“e16986cb9c1ea9470519bc6b9c313b97”, algorithm=md5, cnonce=“06802108”, opaque=“7fafe7300ed96620”, qop=auth, nc=00000002
Max-Forwards: 70
User-Agent: Grandstream HT814V2 1.0.5.4
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - No matching endpoint found
[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - Failed to authenticate
<— Transmitting SIP response (496 bytes) to UDP:192.168.254.15:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.254.15:5060;rport=5060;received=192.168.254.15;branch=z9hG4bK588306916
Call-ID: [email protected]
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected];tag=z9hG4bK588306916
CSeq: 3365 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1765511810/d505a9a466483e3530c619e6a3308885”,opaque=“574ce22502590451”,algorithm=md5,qop=“auth”
Server: FPBX-15.0.16.75(16.13.0)
Content-Length: 0

<— Received SIP request (864 bytes) from UDP:192.168.254.15:5060 —>
REGISTER sip:192.168.254.14 SIP/2.0
Via: SIP/2.0/UDP 192.168.254.15:5060;branch=z9hG4bK1598789956;rport
Route: sip:192.168.254.14:5060;lr
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 3366 REGISTER
Contact: sip:[email protected]:5060;reg-id=1;+sip.instance=“urn:uuid:00000000-0000-1000-8000-EC74D7887F14
Authorization: Digest username=“101”, realm=“asterisk”, nonce=“1765511810/d505a9a466483e3530c619e6a3308885”, uri=“sip:192.168.254.14”, response=“f6b3eb81cab1ba787aef63f4bb5e298a”, algorithm=md5, cnonce=“08426850”, opaque=“574ce22502590451”, qop=auth, nc=00000003
Max-Forwards: 70
User-Agent: Grandstream HT814V2 1.0.5.4
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - No matching endpoint found
[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - Failed to authenticate
<— Transmitting SIP response (498 bytes) to UDP:192.168.254.15:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.254.15:5060;rport=5060;received=192.168.254.15;branch=z9hG4bK1598789956
Call-ID: [email protected]
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected];tag=z9hG4bK1598789956
CSeq: 3366 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1765511810/d505a9a466483e3530c619e6a3308885”,opaque=“0037c8bb423ead56”,algorithm=md5,qop=“auth”
Server: FPBX-15.0.16.75(16.13.0)
Content-Length: 0

<— Received SIP request (864 bytes) from UDP:192.168.254.15:5060 —>
REGISTER sip:192.168.254.14 SIP/2.0
Via: SIP/2.0/UDP 192.168.254.15:5060;branch=z9hG4bK1022002874;rport
Route: sip:192.168.254.14:5060;lr
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 3367 REGISTER
Contact: sip:[email protected]:5060;reg-id=1;+sip.instance=“urn:uuid:00000000-0000-1000-8000-EC74D7887F14
Authorization: Digest username=“101”, realm=“asterisk”, nonce=“1765511810/d505a9a466483e3530c619e6a3308885”, uri=“sip:192.168.254.14”, response=“511e3427c7cce67a309b0e8dc07dfad8”, algorithm=md5, cnonce=“02089890”, opaque=“0037c8bb423ead56”, qop=auth, nc=00000004
Max-Forwards: 70
User-Agent: Grandstream HT814V2 1.0.5.4
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - No matching endpoint found
[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - Failed to authenticate
<— Transmitting SIP response (498 bytes) to UDP:192.168.254.15:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.254.15:5060;rport=5060;received=192.168.254.15;branch=z9hG4bK1022002874
Call-ID: [email protected]
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected];tag=z9hG4bK1022002874
CSeq: 3367 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1765511810/d505a9a466483e3530c619e6a3308885”,opaque=“3b5732251512666b”,algorithm=md5,qop=“auth”
Server: FPBX-15.0.16.75(16.13.0)
Content-Length: 0

<— Received SIP request (862 bytes) from UDP:192.168.254.15:5060 —>
REGISTER sip:192.168.254.14 SIP/2.0
Via: SIP/2.0/UDP 192.168.254.15:5060;branch=z9hG4bK44159581;rport
Route: sip:192.168.254.14:5060;lr
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 3368 REGISTER
Contact: sip:[email protected]:5060;reg-id=1;+sip.instance=“urn:uuid:00000000-0000-1000-8000-EC74D7887F14
Authorization: Digest username=“101”, realm=“asterisk”, nonce=“1765511810/d505a9a466483e3530c619e6a3308885”, uri=“sip:192.168.254.14”, response=“8657ecb78f6e5c8432c91d2773a6928d”, algorithm=md5, cnonce=“02523143”, opaque=“3b5732251512666b”, qop=auth, nc=00000005
Max-Forwards: 70
User-Agent: Grandstream HT814V2 1.0.5.4
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - No matching endpoint found
[2025-12-11 22:56:50] NOTICE[1226]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘REGISTER’ from ‘“Table 1” sip:[email protected]’ failed for ‘192.168.254.15:5060’ (callid: [email protected]) - Failed to authenticate
<— Transmitting SIP response (494 bytes) to UDP:192.168.254.15:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.254.15:5060;rport=5060;received=192.168.254.15;branch=z9hG4bK44159581
Call-ID: [email protected]
From: “Table 1” sip:[email protected];tag=1242586155
To: sip:[email protected];tag=z9hG4bK44159581
CSeq: 3368 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1765511810/d505a9a466483e3530c619e6a3308885”,opaque=“64bdc051607c6aee”,algorithm=md5,qop=“auth”
Server: FPBX-15.0.16.75(16.13.0)
Content-Length: 0

Well, it appears that extension 101 does not exist (for Asterisk) even though your screenshot of the GUI entry looks fine. Possibly, FreePBX didn’t get built correctly, some module is of a non-functional version, or some invalid data you entered (such as Outbound CID) caused the extension to not get built. Please delete all four extensions, Submit, Apply Config.

Then, for testing, create just extension 101. Fill in only User Extension and Display Name, leave everything else at defaults. Submit and Apply Config. Do the show endpoint again and confirm that the extension is now there. Copy the new value of Secret into the HT and test.

I realized I was operating with Debian 10. I found a better setup with FreePBX Version: 17.0 Asterisk Version: 22 running Debian 12

Went through the long setup process.

I added 4 extensions, set the sip user & authentication to 101 copied and pasted the secret in the HT

Under sip settings clicked “Detect Network Settings”

And finally, remembering to click both the Submit button AND the Apply Config button!

Connected instantly.

Thank you for your time. I’m pretty sure for my basic setup I can manage from here.

Remember, with chan_pjsip if the configuration is bad the object (endpoint, aor, etc) won’t load. So it may exist in the config but never loaded into Asterisk. In this case it doesn’t seem the configs were ever written out but “object does not exist” doesn’t mean it is missing from a config necessarily.

I was not applying the config after making changes to the settings.

In this mess, I managed to get a newer/better build of Debian and FreePBX

Next up, setting up a two port ATA to receive incoming calls from the POTS lines coming into the store.

That’s not an ATA (which means Analog Telephone Adapter). You need a device with (at least) two FXO ports. Or, maybe forward the calls to a VoIP number for testing, then later port the POTS number to VoIP (assuming they have reliable and sufficiently speedy internet service).

I realized that after looking up how to do it. I have FXS need FXO. I’m looking at options.

I’m not sure what each location I’m dealing with has at the moment, but I am going on two POTS lines. Later, it should be easy to integrate proper VOIP service.

Grandstream HT841 has 4 FXO ports which could handle this.

1 Like

Arriving Monday from Amazon.

Thanks again for all the tips/info.

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