Hi!
I have two rotary phones into HT801 ATAs. They register fine and I see them with “pjsip show endpoints”. For now they are on the same home LAN. They talk to a from-scratch asterisk server in the cloud (oracle free tier), version 22.1.0 built on ARM, Ubuntu 24.04.
When I call from one to the other, I get a busy signal.
Verbose logs in the asterisk CLI show a 401 Unauthorized. Here’s extension 42 calling extension 25:
<--- Received SIP request (1227 bytes) from UDP:76.22.6.154:5060 --->
INVITE sip:25@123.456.123.456 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.2:5060;branch=z9hG4bK1097251453;rport
From: "Alice" <sip:42@123.456.123.456>;tag=945179225
To: <sip:25@123.456.123.456>
Call-ID: 1443926305-5060-8@BJC.BGI.D.DJ
CSeq: 60 INVITE
Contact: "Alice" <sip:42@192.168.0.2:5060>
Max-Forwards: 70
User-Agent: Grandstream HT801 1.0.57.1
Privacy: none
P-Preferred-Identity: "Alice" <sip:42@123.456.123.456>
P-Access-Network-Info: IEEE-EUI-48;eui-48-addr=40-3F-8C-72-D3-98
P-Emergency-Info: IEEE-EUI-48;eui-48-addr=00-0B-82-B6-44-5D
Supported: replaces, path, timer, eventlist
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length: 448
v=0
o=42 8000 8000 IN IP4 192.168.0.2
s=SIP Call
c=IN IP4 192.168.0.2
t=0 0
m=audio 5004 RTP/AVP 0 8 4 18 2 97 123 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:2 G726-32/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=20
a=rtpmap:123 opus/48000/2
a=fmtp:123 maxplaybackrate=16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32-36,54
<--- Transmitting SIP response (479 bytes) to UDP:76.22.6.154:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.0.2:5060;rport=5060;received=76.22.6.154;branch=z9hG4bK1097251453
Call-ID: 1443926305-5060-8@BJC.BGI.D.DJ
From: "Alice" <sip:42@123.456.123.456>;tag=945179225
To: <sip:25@123.456.123.456>;tag=z9hG4bK1097251453
CSeq: 60 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1736299772/39bea68548ecc697e584f45f3ce3a8e8",opaque="07b482e26a006fb1",algorithm=MD5,qop="auth"
Server: Asterisk PBX 22.1.0
Content-Length: 0
<--- Received SIP request (284 bytes) from UDP:76.22.6.154:5060 --->
ACK sip:25@123.456.123.456 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.2:5060;branch=z9hG4bK1097251453;rport
From: "Alice" <sip:42@123.456.123.456>;tag=945179225
To: <sip:25@123.456.123.456>;tag=z9hG4bK1097251453
Call-ID: 1443926305-5060-8@BJC.BGI.D.DJ
CSeq: 60 ACK
Content-Length: 0
My pjsip.conf and extensions.conf are hacks from the “make basic-pbx” command, and I’m so new to this that I assume some mistake in here is the reason (e.g. I don’t really understand all the dial plan stuff yet).
pjsip.conf:
[transport-udp-nat]
type = transport
protocol = udp
bind = 0.0.0.0
[mynet-endpoint](!)
type = endpoint
context = mynet
allow = all
trust_id_outbound = yes
device_state_busy_at = 1
dtmf_mode = rfc4733 ; works with HT801 rfc2833 setting
[auth-userpass](!)
type = auth
auth_type = userpass
[aor-single-reg](!)
type = aor
max_contacts = 1
[42](mynet-endpoint)
auth = 42
aors = 42
callerid = Alice <42>
[42](auth-userpass)
password = asdfasdf
username = 42
[42](aor-single-reg)
mailboxes = 42@example
[25](mynet-endpoint)
auth = 25
aors = 25
callerid = Bob <25>
[25](auth-userpass)
password = asdfasdf
username = 25
[25](aor-single-reg)
mailboxes = 25@example
extensions.conf:
[globals]
; General internal dialing options used in context Dial-Users.
; Only the timeout is defined here. See the Dial app documentation for
; additional options.
INTERNAL_DIAL_OPT=,30
[mynet]
; The order of includes here is important for matching the right extensions.
include = Dial-Users
include = Dialing-Errors
; Dial-Users handles calls to internal extensions.
; Calls coming into this context may be *external* or *internal* in origin.
[Dial-Users]
exten = _X,1,Verbose(1, "User ${CALLERID(num)} dialed ${EXTEN}.")
same = n,Set(SAC_DIALED_EXTEN=${EXTEN})
same = n,Gotoif($[${DEVICE_STATE(PJSIP/${EXTEN})} = BUSY]?dialed-BUSY,1:)
same = n,Dial(PJSIP/${EXTEN}${INTERNAL_DIAL_OPT})
same = n,Goto(dialed-${DIALSTATUS},1)
exten = dialed-NOANSWER,1,NoOp()
same = n,Voicemail(${SAC_DIALED_EXTEN}@example,u)
same = n,Hangup()
exten = dialed-BUSY,1,NoOp()
same = n,Voicemail(${SAC_DIALED_EXTEN}@example,b)
same = n,Hangup()
exten = dialed-CHANUNAVAIL,1,NoOp()
same = n,Playback(pbx-invalid)
same = n,Hangup()
exten = _dialed-.,1,Goto(dialed-NOANSWER,1)
exten = h,1,Hangup()
; Callers in the directory may dial 0 which will jump to the
; 'o' extension.
exten = o,1,Goto(42)
[Dialing-Errors]
; Handle any extensions dialed internally that don't otherwise exist.
; Comment out or remove this extension if you would rather have the calls
; ignored.
exten = _X.,1,Verbose(1, "User ${CALLERID(num)} dialed an invalid number.")
same = n,Playback(pbx-invalid)
same = n,Hangup()
pjsip show endpoints:
Endpoint: 25/25 Not in use 0 of 1
InAuth: 25/25
Aor: 25 1
Contact: 25/sip:25@192.168.0.2:1024 d8ccc83048 NonQual nan
Endpoint: 42/42 Not in use 0 of 1
InAuth: 42/42
Aor: 42 1
Contact: 42/sip:42@192.168.0.2:5060 dbdaef7e18 NonQual nan
Thanks for any pointers, or sharp blows to the head!