SIP log for outbound call:
<--- SIP read from UDP:24.112.1.61:5063 --->
INVITE sip:12027621401@SERVERHOSTNAME.com SIP/2.0
Via: SIP/2.0/UDP 24.112.1.61:5063;branch=z9hG4bK-22107674
From: "Main" <sip:9001@SERVERHOSTNAME.com>;tag=afe115ae4f310064o3
To: <sip:14432439618@SERVRHOSTNAME.com>
Call-ID: 1b2eef6-bba3b7bc@192.168.0.10
CSeq: 101 INVITE
Max-Forwards: 70
Contact: "Main" <sip:9001@24.112.1.61:5063>
Expires: 240
User-Agent: Linksys/SPA942-6.1.5(a)
Content-Length: 395
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: replaces
Content-Type: application/sdp
v=0M
o=- 38843 38843 IN IP4 24.112.1.61M
s=-M
c=IN IP4 24.112.1.61M
t=0 0M
m=audio 16458 RTP/AVP 0 2 4 8 18 96 97 98 101M
a=rtpmap:0 PCMU/8000M
a=rtpmap:2 G726-32/8000M
a=rtpmap:4 G723/8000M
a=rtpmap:8 PCMA/8000M
a=rtpmap:18 G729a/8000M
a=rtpmap:96 G726-40/8000M
a=rtpmap:97 G726-24/8000M
a=rtpmap:98 G726-16/8000M
a=rtpmap:101 telephone-event/8000M
a=fmtp:101 0-15M
a=ptime:30M
a=sendrecvM
<------------->
[2017-10-29 20:51:38] VERBOSE[16019] chan_sip.c: --- (14 headers 18 lines) ---
[2017-10-29 20:51:38] VERBOSE[16019] chan_sip.c: Sending to 24.112.1.61:5063 (no NAT)
[2017-10-29 20:51:38] VERBOSE[16019][C-00000011] chan_sip.c: Sending to 24.112.1.61:5063 (no NAT)
[2017-10-29 20:51:38] VERBOSE[16019][C-00000011] chan_sip.c: Using INVITE request as basis request - 1b2eef6-bba3b7bc@192.168.0.10
[2017-10-29 20:51:38] VERBOSE[16019][C-00000011] chan_sip.c: Found peer '9001' for '9001' from 24.112.1.61:5063
[2017-10-29 20:51:38] VERBOSE[16019][C-00000011] chan_sip.c:
<--- Reliably Transmitting (NAT) to 24.112.1.61:5063 --->
SIP/2.0 401 UnauthorizedM
Via: SIP/2.0/UDP 24.112.1.61:5063;branch=z9hG4bK-22107674;received=24.112.1.61;rport=5063M
From: "Main" <sip:9001@SERVERHOSTNAME.com>;tag=afe115ae4f310064o3M
To: <sip:12027621401@SERVERHOSTNAME.com>;tag=as1ca005f3M
Call-ID: 1b2eef6-bba3b7bc@192.168.0.10M
CSeq: 101 INVITEM
Server: FPBX-2.11.0(11.25.0)M
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGEM
Supported: replaces, timerM
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="41506cca"M
Content-Length: 0M
M
Using IP authentication , outbound trunk settings:
type=friend
dtmfmode=auto
host=64.2.142.93
context=from-trunk
allow=all
insecure=port,invite
canreinvite=no
allow sip guests= yes
qualify=yes
Enable anonymous SIP calls: is turned on... as we typically get this up and running and then limit IPs in the firewall. But still not working. If there is a better way to do this then let me know. By the log, it looks like the hard phone connected to the hosted PBX server and does not see the number as a local call, so then it sends to the phonenumber@pbxserverhostname . But that says it is unauthorized.