# Outbound authentication errors using pjsip

**URL:** <https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297>\
**Category:** Asterisk SIP\
**Created:** [January 29, 2019, 9:58am UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297 "2019-01-29T09:58:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 9:58am UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/1 "2019-01-29T09:58:34Z")

</div>

I’m using Asterisk 16.1 but I don’t think this problem is really related to the version.  
I’m also using odbc for the pjsip configuration.  
I get a series of error messages at startup:  
[Jan 29 10:00:53] WARNING[3639]: res\_pjsip\_outbound\_authenticator\_digest.c:178 digest\_create\_request\_with\_auth: Host: ‘192.168.1.31:5060’: Unable to create request with auth. No auth credentials for realm(s) ‘asterisk’ in challenge.  
[Jan 29 10:00:53] WARNING[3639]: res\_pjsip\_outbound\_authenticator\_digest.c:178 digest\_create\_request\_with\_auth: Host: ‘192.168.1.31:5060’: Unable to create request with auth. No auth credentials for realm(s) ‘192.168.1.31’ in challenge.  
[Jan 29 10:00:53] WARNING[3639]: res\_pjsip\_outbound\_authenticator\_digest.c:178 digest\_create\_request\_with\_auth: Host: ‘192.168.1.31:5060’: Unable to create request with auth. No auth credentials for realm(s) ‘asterisk’ in challenge.  
[Jan 29 10:00:53] WARNING[3638]: res\_pjsip\_outbound\_authenticator\_digest.c:178 digest\_create\_request\_with\_auth: Host: ‘192.168.1.31:5060’: Unable to create request with auth. No auth credentials for realm(s) ‘asterisk’ in challenge.  
[Jan 29 10:00:53] WARNING[3638]: res\_pjsip\_outbound\_authenticator\_digest.c:178 digest\_create\_request\_with\_auth: Host: ‘192.168.1.31:5060’: Unable to create request with auth. No auth credentials for realm(s) ‘localhost’ in challenge.  
[Jan 29 10:00:53] WARNING[3639]: res\_pjsip\_outbound\_authenticator\_digest.c:178 digest\_create\_request\_with\_auth: Host: ‘192.168.1.31:5060’: Unable to create request with auth. No auth credentials for realm(s) ‘192.168.1.31’ in challenge.  
[Jan 29 10:00:53] WARNING[3638]: res\_pjsip\_outbound\_authenticator\_digest.c:178 digest\_create\_request\_with\_auth: Host: ‘192.168.1.31:5060’: Unable to create request with auth. No auth credentials for realm(s) ‘asterisk’ in challenge.

The realms concerned seem to be those in the ps\_auth table of the odbc configuration.  
I’ve tried different valus asterisk, localhost,192.168.1.31 to see if it makes any difference.  
I suppose first of all I don’t understand what asterisk is trying to do here.  
Nor do I understand the notion of realms which seem to equate to domains but do they?

The ps\_domain\_aliases table is empty. Should it be?

If someone can point me to some documentation which would help me to understand what’s going on, I’d appreciate it.

Pete

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 29, 2019, 11:20am UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/2 "2019-01-29T11:20:29Z")

</div>

What exactly is the current configuration?

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 11:45am UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/3 "2019-01-29T11:45:31Z")

</div>

What would you like to see, bearing in mind that the config is on MySQL so either I dump the tables: ps\_auth, ps\_endpoints? or screenshots?

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 29, 2019, 11:59am UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/4 "2019-01-29T11:59:51Z")

</div>

Both the auth and endpoint, so the record from ps\_auth and ps\_endpoints respectively.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 29, 2019, 12:00pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/5 "2019-01-29T12:00:26Z")

</div>

Oh, and you can just leave the realm empty and Asterisk will use the realm as received by the remote side.

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 12:49pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/6 "2019-01-29T12:49:31Z")

</div>

I’ve changed the realm field in ps\_endpoints to NULL. Now all the error messages indicate 'No auth credentials for realm “asterisk” in challenge

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 12:50pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/7 "2019-01-29T12:50:18Z")

</div>

I have a problem with phpmyadmin which is stopping me from exporting the tables

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 29, 2019, 12:58pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/8 "2019-01-29T12:58:14Z")

</div>

Instead of NULL can you just make it an empty string?

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 1:10pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/9 "2019-01-29T13:10:34Z")

</div>

Same error messages are produced referring to realm “asterisk” with empty string as opposed to NULL

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 1:11pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/10 "2019-01-29T13:11:34Z")

</div>

I’d still like to understand what asterisk is trying to do here

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 29, 2019, 1:23pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/11 "2019-01-29T13:23:50Z")

</div>

It’s how SIP fundamentally works. The remote side challenges for authentication with a realm, and Asterisk then resends the request with credentials. We search for the correct authentication to use based on the realm, and if no realm is specified in our configuration then we use that one.

Have you verified what Asterisk sees for configuration in the CLI commands? Is an auth actually configured for what is being challenged for? Do you know what the SIP request is?

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 1:44pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/12 "2019-01-29T13:44:12Z")

</div>

Without changing the source code, I can’t see’how I can find out what SIP requests are causing the errors. I’ve tried core set debug 64 pjsip and pjsip set logger on but they don’t give anything more informative.

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 1:52pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/13 "2019-01-29T13:52:00Z")

</div>

BTW the version of pjproject I’m using is 2.8

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 29, 2019, 1:57pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/14 "2019-01-29T13:57:52Z")

</div>

You can configure in pjsip.conf in the global section the “debug” option which will enable “pjsip set logger on” from the very start, causing SIP requests and responses to be output to the Asterisk console.

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 2:36pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/15 "2019-01-29T14:36:54Z")

</div>

Now I have set debug to yes and the default realm to XXXXX as opposed to “asterisk” and XXXXX is in the error messages. So now the question is where we are supposed to define realms?  
I’ve tried creating entries in the ps\_domain\_aliases table pointing to the server but that doesn’t seem to change anything

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 29, 2019, 2:38pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/16 "2019-01-29T14:38:00Z")

</div>

The realm is defined in the auth section, but I can’t give specifics because I have no data or configuration to go on to know what is truly happening.

---

<div class="post-metadata">

**Author:** ![gjoseph](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/gjoseph/32/1690_2.png) [@gjoseph](https://community.asterisk.org/u/gjoseph)\
**Post date:** [January 29, 2019, 2:46pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/17 "2019-01-29T14:46:47Z")

</div>

Run the following CLI commands:

```auto
CLI> pjsip show settings
CLI> pjsip show endpoint <endpoint>
CLI> pjsip show aor <'aors' listed in endpoint>
CLI> pjsip show auth <'auth' listed in endpoint>

```

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 2:47pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/18 "2019-01-29T14:47:29Z")

</div>

The realms in ps\_auth are all linked to endpoints aren’t they?

---

<div class="post-metadata">

**Author:** ![gjoseph](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/gjoseph/32/1690_2.png) [@gjoseph](https://community.asterisk.org/u/gjoseph)\
**Post date:** [January 29, 2019, 2:48pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/19 "2019-01-29T14:48:36Z")

</div>

no. they’re strictly for authentication purposes.

---

<div class="post-metadata">

**Author:** ![pkirkham](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pkirkham/32/165_2.png) [@pkirkham](https://community.asterisk.org/u/pkirkham)\
**Post date:** [January 29, 2019, 2:57pm UTC](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297/20 "2019-01-29T14:57:43Z")

</div>

Global Settings:

# ParameterName : ParameterValue

contact\_expiration\_check\_interval : 30  
debug : yes  
default\_from\_user : KFONE1  
default\_outbound\_endpoint : default\_outbound\_endpoint  
default\_realm : KFONE2  
default\_voicemail\_extension :  
disable\_multi\_domain : false  
endpoint\_identifier\_order : ip,username,anonymous  
ignore\_uri\_user\_options : false  
keep\_alive\_interval : 20  
max\_forwards : 70  
max\_initial\_qualify\_time : 0  
mwi\_disable\_initial\_unsolicited : false  
mwi\_tps\_queue\_high : 500  
mwi\_tps\_queue\_low : -1  
regcontext :  
unidentified\_request\_count : 5  
unidentified\_request\_period : 5  
unidentified\_request\_prune\_interval : 30  
use\_callerid\_contact : no  
user\_agent : Asterisk PBX 16.1.1

System Settings:

# ParameterName : ParameterValue

accept\_multiple\_sdp\_answers : false  
compact\_headers : false  
disable\_tcp\_switch : true  
follow\_early\_media\_fork : true  
threadpool\_auto\_increment : 5  
threadpool\_idle\_timeout : 60  
threadpool\_initial\_size : 0  
threadpool\_max\_size : 50  
timer\_b : 32000  
timer\_t1 : 500

Endpoint: 1001/1001 Not in use 0 of 1  
OutAuth: PeteKirkham/PeteKirkham  
InAuth: PeteKirkham/PeteKirkham  
Aor: PeteKirkham 10  
Contact: PeteKirkham/sip:1001@192.168.1.31:5060 c41c49f388 NonQual nan  
Transport: transport-udp udp 0 0 0.0.0.0:5060

Endpoint: 1004/1004 Not in use 0 of 1  
OutAuth: PortablePete/PortablePete  
InAuth: PortablePete/PortablePete  
Aor: PortablePete 10  
Contact: PortablePete/sip:PortablePete@192.168.1.16 41336d7601 NonQual nan  
Contact: PortablePete/sip:1004@192.168.1.31:5060 03dc3202c1 NonQual nan  
Transport: transport-udp udp 0 0 0.0.0.0:5060

Endpoint: Brigitte/1003 Not in use 0 of 1  
InAuth: Brigitte/Brigitte  
Aor: Brigitte 10  
Contact: Brigitte/sip:1003@192.168.1.31:5060 eff72bb66b NonQual nan  
Transport: transport-udp udp 0 0 0.0.0.0:5060

Endpoint: Fiona/1002 Not in use 0 of 1  
InAuth: Fiona/Fiona  
Aor: Fiona 10  
Contact: Fiona/sip:1002@192.168.1.31:5060 f376ad048f NonQual nan  
Transport: transport-udp udp 0 0 0.0.0.0:5060

Endpoint: PeteKirkham/1001 Not in use 0 of 1  
InAuth: PeteKirkham/PeteKirkham  
Aor: PeteKirkham 10  
Contact: PeteKirkham/sip:1001@192.168.1.31:5060 c41c49f388 NonQual nan  
Transport: transport-udp udp 0 0 0.0.0.0:5060

Endpoint: PortablePete/1004 Not in use 0 of 1  
InAuth: PortablePete/PortablePete  
Aor: PortablePete 10  
Contact: PortablePete/sip:PortablePete@192.168.1.16 41336d7601 NonQual nan  
Contact: PortablePete/sip:1004@192.168.1.31:5060 03dc3202c1 NonQual nan  
Transport: transport-udp udp 0 0 0.0.0.0:5060

Endpoint: net2phone Not in use 0 of 1  
OutAuth: net2phone/610569414904  
InAuth: net2phone/610569414904  
Aor: net2phone 2  
Contact: net2phone/sip:ippbx.net2phone.com 0a5bd7e8d2 NonQual nan  
Transport: transport-udp udp 0 0 0.0.0.0:5060  
Identify: net2phone/net2phone  
Match: 66.33.146.52/32  
Match: 169.132.196.11/32

Endpoint: ovh Not in use 0 of 1  
OutAuth: ovh/0033972306227  
InAuth: ovh/0033972306227  
Aor: ovh 2  
Contact: ovh/sip:0033972306227@sip.ovh.fr 5c91c115fa NonQual nan  
Transport: transport-udp udp 0 0 0.0.0.0:5060  
Identify: ovh/ovh  
Match: 91.121.129.20/32

Endpoint: webrtc\_client Unavailable 0 of inf  
InAuth: webrtc\_client/KFONE  
Aor: webrtc\_client 1  
Transport: transport-udp udp 0 0 0.0.0.0:5060

Endpoint: 1001/1001 Not in use 0 of 1  
OutAuth: PeteKirkham/PeteKirkham  
InAuth: PeteKirkham/PeteKirkham  
Aor: PeteKirkham 10  
Contact: PeteKirkham/sip:1001@192.168.1.31:5060 c41c49f388 NonQual nan  
Transport: transport-udp udp 0 0 0.0.0.0:5060

# ParameterName : ParameterValue

100rel : yes  
accept\_multiple\_sdp\_answers : false  
accountcode :  
acl :  
aggregate\_mwi : true  
allow : (g729|alaw|ulaw|gsm|h263)  
allow\_overlap : true  
allow\_subscribe : true  
allow\_transfer : true  
aors : PeteKirkham  
asymmetric\_rtp\_codec : false  
auth : PeteKirkham  
bind\_rtp\_to\_media\_address : false  
bundle : false  
call\_group :  
callerid : “Pete” \<1001\>  
callerid\_privacy : allowed  
callerid\_tag :  
connected\_line\_method : invite  
contact\_acl :  
context : outgoing  
cos\_audio : 0  
cos\_video : 0  
device\_state\_busy\_at : 1  
direct\_media : false  
direct\_media\_glare\_mitigation : none  
direct\_media\_method : invite  
disable\_direct\_media\_on\_nat : false  
dtls\_auto\_generate\_cert : No  
dtls\_ca\_file :  
dtls\_ca\_path :  
dtls\_cert\_file :  
dtls\_cipher :  
dtls\_fingerprint : SHA-256  
dtls\_private\_key :  
dtls\_rekey : 0  
dtls\_setup : active  
dtls\_verify : No  
dtmf\_mode : rfc4733  
fax\_detect : false  
fax\_detect\_timeout : 0  
follow\_early\_media\_fork : true  
force\_avp : false  
force\_rport : true  
from\_domain :  
from\_user :  
g726\_non\_standard : false  
ice\_support : false  
identify\_by : username  
inband\_progress : false  
incoming\_mwi\_mailbox :  
language : fr  
mailboxes : 1001@default  
max\_audio\_streams : 1  
max\_video\_streams : 1  
media\_address :  
media\_encryption : no  
media\_encryption\_optimistic : false  
media\_use\_received\_transport : false  
message\_context :  
moh\_passthrough : false  
moh\_suggest : default  
mwi\_from\_user :  
mwi\_subscribe\_replaces\_unsolicited : no  
named\_call\_group :  
named\_pickup\_group :  
notify\_early\_inuse\_ringing : false  
one\_touch\_recording : false  
outbound\_auth : PeteKirkham  
outbound\_proxy :  
pickup\_group :  
preferred\_codec\_only : false  
record\_off\_feature : automixmon  
record\_on\_feature : automixmon  
refer\_blind\_progress : true  
rewrite\_contact : false  
rpid\_immediate : false  
rtcp\_mux : false  
rtp\_engine : asterisk  
rtp\_ipv6 : false  
rtp\_keepalive : 0  
rtp\_symmetric : false  
rtp\_timeout : 0  
rtp\_timeout\_hold : 0  
sdp\_owner : -  
sdp\_session : Asterisk  
send\_connected\_line : yes  
send\_diversion : true  
send\_pai : false  
send\_rpid : false  
set\_var :  
srtp\_tag\_32 : false  
sub\_min\_expiry : 0  
subscribe\_context :  
suppress\_q850\_reason\_headers : false  
t38\_udptl : false  
t38\_udptl\_ec : none  
t38\_udptl\_ipv6 : false  
t38\_udptl\_maxdatagram : 0  
t38\_udptl\_nat : false  
timers : yes  
timers\_min\_se : 90  
timers\_sess\_expires : 1800  
tone\_zone :  
tos\_audio : 0  
tos\_video : 0  
transport : transport-udp  
trust\_connected\_line : yes  
trust\_id\_inbound : false  
trust\_id\_outbound : true  
use\_avpf : false  
use\_ptime : false  
user\_eq\_phone : false  
voicemail\_extension :  
webrtc : no

Auth: PeteKirkham/PeteKirkham

# ParameterName : ParameterValue

auth\_type : userpass  
md5\_cred :  
nonce\_lifetime : 32  
password : xxxxxxxxxxx  
realm :  
username : PeteKirkham

Aor: PeteKirkham 10  
Contact: PeteKirkham/sip:1001@192.168.1.31:5060 c41c49f388 NonQual nan

# ParameterName : ParameterValue

authenticate\_qualify : false  
contact : sip:1001@192.168.1.31:5060  
default\_expiration : 3600  
mailboxes : 1001  
max\_contacts : 10  
maximum\_expiration : 7200  
minimum\_expiration : 60  
outbound\_proxy :  
qualify\_frequency : 0  
qualify\_timeout : 3.000000  
remove\_existing : false  
support\_path : false  
voicemail\_extension :

[Next page](https://community.asterisk.org/t/outbound-authentication-errors-using-pjsip/78297.md?page=2)
