Pjsip failed to authenticate

Hi

I have a problem with configuration of two asterisk boxes. On one of them i create pjsip account which is used for registration on another. Registration is working but when i place a call from second to my first i see on console information about incoming invite and message Failed to authenticate.

What I have to do for resolved my issue ?

post your pjsip.conf file and also the CLI output

Why are you trying to register if you control both boxes? Registration is so that one box can discover the IP address of the other.

ok, have you any idea how to dump mysql tables to readable format ?

I am just testing few things

Presumably using the same tools as you used to populate them in the first place. In any case you didn’t say that you were using Asterisk Realtime Architecture, so we naturally assumed that you would provide a copy of pjsip.conf.

:slight_smile: I wrote a script which dump my data to more readable format - I hope so ! :smiley:

=== DUMP DATABASE ===
ps_aors
==ROW of ps_aors==
id = 101
max_contacts = 1
==ROW of ps_aors==
id = mini-test
contact = sip:10.0.190.11:5060

ps_auths
==ROW of ps_auths==
id = 101
auth_type = userpass
nonce_lifetime = 2
password = 101
username = 101
==ROW of ps_auths==
id = mini-test
auth_type = userpass
nonce_lifetime = 1
password = haslo
username = mini

ps_endpoints
==ROW of ps_endpoints==
id = 101
transport = udp_transport
aors = 101
auth = 101
context = telefon
disallow = all
allow = alaw,ulaw
direct_media = no
force_rport = yes
ice_support = yes
rtp_symmetric = yes
from_domain = my_domain
==ROW of ps_endpoints==
id = mini-test
transport = udp_localnet
aors = mini-test
context = from-external
disallow = all
allow = ulaw,alaw
outbound_auth = mini-test

ps_transports
==ROW of ps_transports==
id = udp_localnet
bind = 0.0.0.0:7140
protocol = udp
==ROW of ps_transports==
id = udp_transport
bind = 0.0.0.0:7142
domain = my_domain
external_media_address = my_ip
external_signaling_address = my_ip
external_signaling_port = 7142
protocol = udp
symmetric_transport = yes

ps_registrations
==ROW of ps_registrations==
id = mini-test
client_uri = sip:mini@10.0.190.11
outbound_auth = mini-test
retry_interval = 60
server_uri = sip:10.0.190.11
transport = udp_localnet
line = yes


=== DUMP DATABASE ===
ps_aors
==ROW of ps_aors==
id = mini
max_contacts = 1

ps_auths
==ROW of ps_auths==
id = auth-mini
auth_type = userpass
nonce_lifetime = 1
password = haslo
username = mini

ps_endpoints
==ROW of ps_endpoints==
id = mini
transport = udp_transport
aors = mini
auth = auth-mini
context = from-mini
disallow = all
allow = ulaw,alaw

ps_transports
==ROW of ps_transports==
id = udp_transport
bind = 0.0.0.0:5060
protocol = udp

ps_registrations


And this is what i get on my second asterisk box

[Nov  8 23:12:02] NOTICE[4646]: res_pjsip/pjsip_distributor.c:659 log_failed_request: Request 'INVITE' from '"mini-test" <sip:101@10.0.190.10>' failed for '10.0.190.10:7140' (callid: 01269705-e43e-40ea-b6f7-00e3195b437a) - Failed to authenticate