Asterisk won't authenticate ht813 messages

Hi,

I’m trying to get asterisk 18.26.1 running on a pi 4 to work with a Grandstream ht813. After much effort and trying things out, I’ve made (what appears to me) to be great progress. But no matter what I try, I can’t get asterisk to authenticate the ht813 messages.

On the pi, my pjsip.conf is:

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060

[ht813]
type=endpoint
aors=ht813-aor
context=from-ht813
disallow=all
allow=ulaw
direct_media=no
transport=transport-udp

[ht813-aor]
type=aor
max_contacts=1

[ht813-identify]
type=identify
endpoint=ht813
match=192.168.1.62

sorcery.conf is:

[res_pjsip]
endpoint=config,pjsip.conf
aor=config,pjsip.conf
identify=config,pjsip.conf

Showing the endpoint in asterisk, I see:

auth :

identify_by : username,ip (which I believe to be wrong)

The ht813 is configured as:

call forward to voip sip:ht813@192.168.1.63:5060
primary sip server 192.168.1.63
SIP user ID (empty)
Authenticate ID (empty)
Authenticate password (empty)
SIP registration No
Local SIP port 5062
NAT Traversal No

and many other options which may not be relevant.

I am completely new to this. So new that I don’t know enough to ask intelligent questions, or even provide more complete information that would be useful. Sorry.

Any pointers on what I might investigate to fix this would be greatly apprecieated.

Thanks,

Dave

Hi Dave,

I’ve worked with Asterisk, FreePBX, and devices like the HT813. Your issue sounds like a missing SIP authentication setup.

If you’re not using SIP registration, match by IP is fine — just make sure auth= isn’t set.
But if you do want auth, you’ll need to define an auth section and set credentials on both sides.

Let me know your setup preference — happy to guide

Hi kingsterisk,

I tried authorizing with SIP registration but couldn’t get that to work. So I switched to IP. auth= is empty when I show endpoint. I’ve tried dozens of different configurations even going so far as to re-install asterisk and factory reset the ht813. I’m certainly missing something.

Thanks for the reply.

Dave

BTW, I tried going back to userid auth. I set both the call forward port and sip local port to 5060, added an auth section to pjsip.conf. when the call comes in, it comes from port 44169. I have no clue as to where that comes from and don’t see any configurations in the ht813 with that port.

This is what asterisk sees:

<— Received SIP request (1119 bytes) from UDP:192.168.1.62:44169 —>
INVITE sip:ht813@192.168.1.63:5060 SIP/2.0

???

Apologies for multiple posts. :frowning:

And the response is:

<— Transmitting SIP response (489 bytes) to UDP:192.168.1.62:44169 —>
SIP/2.0 401 Unauthorized

userid and password are identical between asterisk and ht813.

OK, after another dozen attempts I figured out what went wrong. My extensions.conf had “exten => _X.” which I expected to match my authorization name. When I changed to “exten => ht813” it worked.

Sorry to have wasted bandwidth here, but thanks for reviewing anyway.

Regards,

Dave

1 Like

Glad your issue is solved. If you face any problems in the future, feel free to reach out! @dwills

Thanks rizwan1,

I thought I fixed it. Not. Afterwards I found the ht813 was sending
incorrect data to asterisk, including the caller number as the
endpoint (which makes no sense at all). Trying to go back to IP
authorization, I now get mostly what I want except the INVITE comes
from 192.168.1.62:44169. I’ve looked at every configuration in the
ht813 and there is no incidence of the port 44169. No idea where
that comes from, but it won’t authorize with that.

:frowning:

Dave

It will be a random high numbered port. That’s typical TCP/IP client behaviour. If you can change that, it will be at the HT end, not the Asterisk end.

IP authorisation isn’t really authorisation; it is just relying on use a specific match= line. I would hope that that would ignore the port number, unless you gave it explicityl.

Hi david551,

To all of you, I can’t be more appreciative of you help and attention.

I was going to post my sorcery.conf and pjsip.conf but I think this error message points to the problem:

[May 1 17:44:53] NOTICE[39833]: res_pjsip/pjsip_distributor.c:673 log_failed_request: Request ‘INVITE’ from ‘“WIRELESS CALLER” sip:1xxxxxxxxxx@192.168.1.63’ failed for ‘192.168.1.62:44169’ (callid: 1414871018-44169-6@BJC.BGI.B.GC) - No matching endpoint found. The 'x’s are my cell number. I believe this should either be “ht813” or “sip:ht813” from my ht813 configuration.

Here are important configurations from the HT813:
SIP User ID, Authorization and Password are all empty. The SIP server is correct. SIP registration is No. NAT Transversal is No. The local SIP port is 5060. The unconditional call forward to VOIP is : sip:ht813@192.168.1.63:5060, though I suspect sip:ht813 may be wrong since that was when I used username instead of IP.

???

You don’t appear to have overridden the From user in your HT813 configuration, so the above is what I’d expect. Asterisk will use ht813, in your configuration, as the extension, not the endpoint. It hasn’t got that far, as the endpoint hasn’t matched.

Thanks again. This does appear to be a Grandstream HT813 problem. Having to do over, I wouldn’t buy the Grandstream. I’m going to look for another option.

Thanks.

I have a Grandstream HT813 and configured its FXS Port. Everything works just fine, no problems. I can make a receive calls.

Thanks for the reply. After much trial and error, I was able to make everything work. I did use ChatGPT which has advantages and disadvantages. The only advantage I see is the response time is much faster. Disadvantages: It’s not AI but AS (stupidity). It’s not as smart as the people it strips data from. It does not auto-learn. So when ChatGPT makes a mistake, you can tell it to give a better answer. Somewhere downstream when it still hasn’t found a solution, it scours its memory for a solution and recommends the same brain-dead answer it gave before. But if you’re persistent…

Thanks again.

Dave

1 Like

Sigh… Well spoke too soon. For inbound calls everything worked fine. But no matter what I tried, I cannot make outbound calls from an analog phone through the HT813 and to the telco.

Pretty sure this is an HT813 problem and Asterisk is fine. Worked with Grandstream for about a month but they were no help at all.

So in the end, I think I’m going to return the HT813 as non-functional.

Anyone have a suggestion for a low cost, easy to find, alternative that works with Asterisk?

Thanks,

Dave

I’ve had an HT813 connected to 3cx, FusionPBX and FreePBX. It was horrendous to configure From memory I think the HT813 did need the show a registered connection to work properly in my case. A post on github post helped me get things running. It might have been the one tilted “Grandstream HT813 - France PSTN + FreePBX”. Another post on the FreePBX forum helped showing images of the setting required on each tab. I never had a phone connected directly to the HT813 though. All phones were connected to the PBX with the HT813 connecting to a UK POTS line. I dumped the HT813 and the POTS line in the end as there was a delay waiting for the phones to ring with the HT813. I may still have a backup file somewhere with the working config.

Thanks Jimbob. Just today I was able to make progress. Not sure what did it but I think it was mostly ht813 configuration as you found. I also have delays but I’m going to ignore those for a while. I’m working on a complicated extensions.conf to trap spam calls now.

Thanks again.

Dave

OK, after 6 weeks of banging my head against the wall and dealing with Grandstream support, I’m going to give up on the HT813. I can get dial out working, or dial in working with asterisk, but not both at the same time.

Anyone have a suggestion for a replacement with 1 FXO and 1 FXS that does pretty much the same thing, only works without the headaches? Looks like the Obi110 would work but that’s discontinued and I’m not sure the 212 would work well with Asterisk. Other options seem to be way more expensive.

Thanks.

Well after deciding to give up, I gave this one more try and was finally able to make it work. Since I’m no expert, I can’t say either the Asterisk or HT813 configurations are optimal, but it is working just fine.

The system I designed pretty much puts a stop to all robo calls. I’ll create a new topic to explain.

Thanks,

Dave

On Friday 13 June 2025 at 19:08:51, dwills via Asterisk Community wrote:

Well after deciding to give up, I gave this one more try and was finally
able to make it work. Since I’m no expert, I can’t say either the
Asterisk or HT813 configurations are optimal, but it is working just fine.

I think it could be helpful to people searchig for “HT813” (or just
Grandstream) and “Asterisk” in the future if you would post your working
configuration here.

It’s always rather more satisfying, if you find a discussion thread about
someone who has the same problem as you do, if you get to the end of it and
find out how they solved it, rather than just reading that “it works now” with
no further details :slight_smile:

Antony.


Before you begin scrambling up the ladder of success,
make sure it’s leaning against the right building.

  • Stephen Covey