Hello Guys, I’m trying to configure a PJSIP trunk based on the SIP trunk settings; Everything works except inbound calls via PJSIP; I’m trying all possible solutions but so far no success; Basically my PJSIP trunk registers to a SBC, it registers fine, it can make outbound calls from Asterisk to SBC, but inbound calls only work via SIP, my main problem is when I use PJSIP and the call comes in Asterisk replies with 401 Unauthorized. I initially thought the problem could have to do with the ‘From’ domain or contact IP, so I installed Kamailio on port 5260 and configured it to forward INVITE between SBC and Asterisk, so I could manipulate the headers before the call reaches Asterisk, and so far nothing that I do fixes the inbound problem. I’m attaching a pcap that shows two bad PJSIP inbound calls, one connecting directly and the other connecting via Kamailio, and one good SIP inbound call connecting directly. Can someone help me figure out what could possibly be wrong with my setup, on FPBX the trunk is setup to not use registration or authentication, but Asterisk keeps replying with 401 even though the INVITE comes from the same host.
Thank you!
chan_pjsip is a better implementation of SIP, not a different protocol.
This is the wrong forum for FreePBX questions. If you want to ask here, you need to provide the generated contents of pjsip.conf and its included files.
The proxy appears to have corrupted the From header (lost the tag).
From domain and Contact headers are not normally used to identify endpoints.
Plain text logs, from Asterisk itself, using log files, are preferred, even on the FreePBX forum
Hi David, thank you for the update, I understand this is not FreePBX forum, but as long as the PJSIP settings are good it shouldn’t matter right? I’m pasting my PJSIP settings and debug from Asterisk logs. In this test I called 089791065 from exten 9989 using Zoiper, the call is sent to Kamailio, that sends the call to SBC, the SBC then calls Kamailio that modifies the TO/FROM/Contact headers and send the call to Asterisk that returns 401; The reason why I’m modifying the headers is because I have already tried everything, including not modifying anything, but I get 401 everytime
[HOT_PJSIP]
type=endpoint
transport=0.0.0.0-udp
context=from-pstn
disallow=all
allow=alaw,ulaw,gsm,g722,opus,h264,mpeg4
aors=HOT_PJSIP
send_connected_line=false
rtp_keepalive=0
language=en
from_user=0732189960
user_eq_phone=no
t38_udptl=no
t38_udptl_ec=none
fax_detect=no
trust_id_inbound=no
t38_udptl_nat=no
direct_media=no
rewrite_contact=yes
rtp_symmetric=yes
dtmf_mode=auto
[HOT_PJSIP]
type=auth
auth_type=userpass
password=
username=HOT_PJSIP
[HOT_PJSIP]
type=aor
qualify_frequency=60
contact=sip:10.9.6.14:5260
[HOT_PJSIP]
type=identify
endpoint=HOT_PJSIP
match=10.9.6.14, 192.168.145.39
debug.txt (63.4 KB)
The proxy seems to be missing the Via header from its incoming side.
It also doesn’t seem to understand that it needs to forward PRACK to the SBC. I didn’t follow the log to the end, but the SBC is going to conclude that its 183 Progress never made it.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.