[asterisk-users] Asterisk pjsip registration issues

Dave Platt dplatt at radagast.org
Tue Sep 26 14:27:08 CDT 2017


> Hey all
>
>  I am trying to register a PJSIP server on our office to an Asterisk 11
> chan_sip server in a datacenter.
>
>  I keep getting
>   WARNING[18084]: res_pjsip_outbound_authenticator_digest.c:178
> digest_create_request_with_auth_from_old: Host: 'XXX.XXX.XXX.XXX:5060':
> Unable to create request with auth. No auth credentials for realm(s)
> 'asterisk' in challenge.
>
>  Any insights would be appreciated I have been banging my head for
several
> days now.

I ran into a very similar problem when I tried to switch my PJSIP
service with Vitelity from "fixed IP address" to "registration-based".
I would try to place a call, and it would simply time out and then get
a "busy here" error from Vitelity.

Calls to a similar Vitelity sub-account from a Zoiper soft-phone worked
just fine.

I wiresharked the sessions and found that the critical difference seemed
to be in the From: and Contact: headers.  Zoiper set these to the
Vitelity sub-account name (the registration name) while PJSIP just set
them to "asterisk".

I checked the PJSIP wizard file, and found that the outbound
authentication object had the right username information in it,
so that wasn't the problem.

After stumbling around for hours, I found that it's necessary to
set the "from_user" parameter in the endpoint object to match the
username in the outbound authentication object.  This causes PJSIP
to send this value (rather than "asterisk") in the From and Contact
fields of the INVITE, and this apparently gives the far end the
information it needs to issue a proper credentials challenge.

Once I added this one line to my definition and restarted, outbound
calls worked like a charm.

So, in pjsip_wizard, one would write something like

[peername]
type = wizard
transport = transport-udp
remote_hosts = outbound.peer.com
sends_auth = yes
endpoint/context = outbound
endpoint/from_user = MYNAME
outbound_auth/username = MYNAME
outbound_auth/password = MYPASSWORD

Modify and embellish as required.  If you're writing your PJSIP
objects individually rather than via the wizard, just set the
fields in those objects appropriately.





More information about the asterisk-users mailing list