There were no auth ids available

I have connected two phones locally with PJSIP and everything works fine, then I’ve connected my Asterisk with another Asterisk which is using SIP and incoming calls are working, but outbound calls are spitting “There were no auth ids available” error. I’ve tried with one auth both for incoming and outgoing calls and separate auth for both but nothing is working.

My pjsip.conf:

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0

[maklek]
type=registration
retry_interval= 1
max_retries=100
contact_user=maklek
expiration=120
transport=transport-udp
outbound_auth=maklek-out
client_uri=sip:test@192.168.1.230
server_uri=sip:192.168.1.230

[maklek-out]
type=auth
auth_type=userpass
password=test
username=test
realm=asterisk

[maklek-out]
type=aor
contact=sip:192.168.1.230

[maklek-out]
type=identify
endpoint=maklek-out
match=192.168.1.230/32

[maklek-out]
type=endpoint
context=izlezni ;default
dtmf_mode=inband  ;rfc4733
disallow=all
allow=alaw
allow=gsm
allow=ulaw
aors=maklek-out
auth=maklek-out
direct_media=no       
rtp_symmetric=yes

[maklek]
type=aor
contact=sip:192.168.1.230

[maklek]
type=identify
endpoint=maklek
match=192.168.1.230

[maklek]
type=endpoint
context=default
dtmf_mode=rfc4733
disallow=all
allow=alaw
aors=maklek
auth=maklek
direct_media=no 
from_user=test

[maklek]
type=auth
auth_type=userpass
password=test
username=test

[crn]
type=endpoint
context=izlezni
disallow=all
allow=alaw
transport=transport-udp
auth=crn
aors=crn

[crn]
type=auth
auth_type=userpass
password=crn
username=crn

[crn]
type=aor
max_contacts=1

[bel]
type=endpoint
context=so-izlez
disallow=all
allow=alaw
transport=transport-udp
auth=bel
aors=bel

[bel]
type=auth
auth_type=userpass
password=bel
username=bel

[bel]
type=aor
max_contacts=1

extensions.conf

[izlezni]
exten  => _07[0125678]XXXXXX,1,Dial(PJSIP/${EXTEN}@maklek-out)
same  => n,Hangup() 

Output:

 -- Executing [076447393@so-izlez:1] Dial("PJSIP/bel-00000002", "PJSIP/076447393@maklek-out") in new stack
    -- Called PJSIP/076447393@maklek-out
[Oct 16 13:34:14] ERROR[69048]: res_pjsip_outbound_authenticator_digest.c:450 digest_create_request_with_auth: Endpoint: 'maklek-out': There were no auth ids available
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [076447393@so-izlez:2] Hangup("PJSIP/bel-00000002", "") in new stack
  == Spawn extension (so-izlez, 076447393, 2) exited non-zero on 'PJSIP/bel-00000002'

I’ve installed sngrep and its registering (after all I get incoming calls), but when I try to make outbound call it doesn’t sent a INVITE, just ACK after the 401 UNAUTHORIZED…

I can send the full call flow from sngrep if you want, just don’t want to make the post bigger than needed.

Remove the “realm=asterisk” line from the auth.

I did not have that initially, have added that when was debugging. But I’ve removed it now and its still not working…

Okay, is from_user set to the username that should be used to authenticate as? It currently shows as “test”.

It is set to the username that is used to authenticate as. And, should from_user be present just in the outbound and inbound endpoints?

It should be present in the outbound endpoint. For outbound authentication you would also need to set “outbound_auth” to the outbound auth name. “auth” is for inbound.

1 Like

That did the trick, thank you. I’ve been messing with this problem few days, but I’ve already had outbound_auth in the registration, not in the endpoint. And if I don’t have it in the registration, then it gives me errors…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.