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