Asterisk FROM field

When I want register to provider, I get 401 Unauthorized error. Dump shows that FROM and TO field is same:


How I can corret this error?
Asterisk v16. PJSIP conf file.

Thank you.

401 is not an error. You need to provide a secret in your register string.

The standard exchange is:

REGISTER wtthout authentication
401 with nonce, and authentication method
REGISTER with authentication
200 OK (or x03 if the secret is wrong).

1 Like

But password is set in config.


Is normal behavior so that the strings “FROM” and “TO” have the same value?

This is not enough information to draw any conclusions. One would either need the complete configuration (reg, auth, ep, aor(s)…), or the lists from within asterisk “pjsip show …”

You may have to check what the service provider wants to see in the From Headers, which is determined by the client_uri field (see for details). Sometimes it is a normalized phone number, sometimes it can be a special username. But these are currently only suggestions where to look at.

Not just normal, but in most cases required:

  From: The From header field contains the address-of-record of the
       person responsible for the registration.  The value is the
       same as the To header field unless the request is a third-
       party registration.

From RFC 3261

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