Asterisk Pjsip Registration Issues

Home » Asterisk Users » Asterisk Pjsip Registration Issues
Asterisk Users 2 Comments

I have now spent over a week trying to figure out what is going on with PJSIP registrations.

I am able to register handsets against an asterisk 13 server running pjsip, but I am not able to get pjsip to register out to an older chan_sip asterisk server. If I drop the registration I can make things work, but when I have to register the asterisk – pjsip server against another server the registration completes, but I can not send any calls across the registration, nor will it handle options correctly as well.

We keep getting … No auth credentials for realm(s)
‘asterisk@XXX.XXX.XXX.XXX’ in challenge. In one form or another, and I have been unable to find any definitive documentation on what is at cause for this. In some areas I have seen responses saying it is an issue with realms so I have tried with and without but no success.

I really need some direction on this. This is the last issue I know of that is holding up us from moving to pjsip. If I can’t get asterisk / pjsip to register and send authenticated messages than it can’t work for replacing chan_sip in all situations.

What am I doing wrong?

type=registration endpoint=zktech_trunk transport=udp-nat outbound_auth=zktech_trunk server_uri=sip:ACCT.8009@XXX.XXX.XXX.XXX
contact_user=zktech_trunk retry_interval`

type=auth auth_type=userpass password=rossi72v8qr username

2 thoughts on - Asterisk Pjsip Registration Issues

  • Break this down further because you have some conflicting and confusing information. Does the outbound registration work or not work? Does it show as registered in PJSIP? If you leave out the “realm” option what happens? When you say “can’t send any calls across the registration”
    what does that mean? Are you referring to inbound calls or outbound calls?

  • several

    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

    type = wizard transport = transport-udp remote_hosts = 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.