ARCAMUSA VOICE ENGINEERING

Asterisk PJSIP Endpoint, AOR, Auth and Registration Explained

Map each res_pjsip object to its job so inbound identification, outbound authentication and contact location do not become one ambiguous configuration.

Understand object relationships before editing

A registration sends REGISTER and can reference outbound authentication. An endpoint defines channel behavior and references one or more AORs and optionally outbound auth. An AOR locates contacts. An identify object assigns inbound traffic to an endpoint based on a trusted matching rule. An object existing in CLI output does not mean all of its references resolve or that a contact exists.

Complete registration-auth trunk model

CONFIG CHANGESENSITIVE OUTPUT
Registration-auth modelCONFIGINI
[carrier-auth]
type=auth
auth_type=userpass
username=EXAMPLE_USERNAME
password=PRIVATE_VALUE_NOT_STORED_IN_PUBLIC_SOURCE

[carrier-registration]
type=registration
transport=transport-udp
outbound_auth=carrier-auth
server_uri=sip:sip.example.net
client_uri=sip:EXAMPLE_USERNAME@sip.example.net
contact_user=carrier-inbound
retry_interval=60

[carrier-aor]
type=aor
contact=sip:sip.example.net
qualify_frequency=60

[carrier-endpoint]
type=endpoint
transport=transport-udp
context=from-carrier-restricted
aors=carrier-aor
outbound_auth=carrier-auth
disallow=all
allow=ulaw
direct_media=no

The registration and endpoint may reference the same outbound auth but serve different transactions. The registration client URI and credential must follow the peer contract. The endpoint still needs an AOR for outbound addressing. Keep the working secret outside public documentation and limit file access.

Static IP-auth trunk model

CONFIG CHANGEPRODUCTION CAUTION
Static documentation-IP modelCONFIGINI
[carrier-aor]
type=aor
contact=sip:203.0.113.10:5060
qualify_frequency=60

[carrier-endpoint]
type=endpoint
transport=transport-udp
context=from-carrier-restricted
aors=carrier-aor
disallow=all
allow=ulaw
direct_media=no

[carrier-identify]
type=identify
endpoint=carrier-endpoint
match=203.0.113.10

This model has no REGISTER object and may have no digest auth. The identify match is a trust decision, so specify only approved peer sources and protect against spoofing at the network boundary. The endpoint context must not expose unrestricted dialing.

Registration relationship and state

Registration inspectionCOMMANDBASH
sudo asterisk -rx "pjsip show registrations"
sudo asterisk -rx "pjsip show registration carrier-registration"
Illustrative registered stateOUTPUTCONSOLE
<Registration/ServerURI......................> <Auth.........> <Status.....>
carrier-registration/sip:sip.example.net      carrier-auth   Registered

Registered means the registrar accepted the current binding. It does not prove the endpoint AOR is dialable, an INVITE will be admitted, or media will pass. If the CLI shows no registrations on an IP-auth trunk, that is expected.

AOR and contact resolution

AOR/contact inspectionCOMMANDBASH
sudo asterisk -rx "pjsip show aor carrier-aor"
sudo asterisk -rx "pjsip show contacts"
sudo asterisk -rx "pjsip qualify carrier-aor"
Illustrative reachable contactOUTPUTCONSOLE
Aor: carrier-aor  1
Contact: carrier-aor/sip:sip.example.net  Avail  42.100

An AOR object with zero contacts gives Asterisk no address for that logical destination. Causes include a missing static contact, an endpoint that never registered, max_contacts=0 for an inbound registration scenario, expired contacts, or a name mismatch. Qualification status reflects OPTIONS behavior only.

Inbound identify and matching order

Identifier inspectionCOMMANDBASH
sudo asterisk -rx "pjsip show identifiers"
sudo asterisk -rx "pjsip show endpoint carrier-endpoint"
sudo asterisk -rx "pjsip show identifies"

If a request logs “No matching endpoint found,” compare the packet’s observed source address with the identify match and inspect identifier order. Do not trust the From domain as proof of network source. Where source addresses legitimately vary, obtain the peer’s published architecture and use a supported, bounded matching method.

CLI verification matrix

PJSIP object verification
ObjectCommandHealthy state
Transportpjsip show transportsRequired protocol and bind appear.
Endpointpjsip show endpoint carrier-endpointAOR, auth, context and codecs resolve.
AORpjsip show aor carrier-aorExpected static or dynamic contact.
Authpjsip show authsNamed object loaded; secrets are not copied.
Registrationpjsip show registrationsRegistered or explicitly not applicable.
Identifypjsip show identifiesApproved source maps to intended endpoint.

Object exists but calls still fail

Relationship failures
SymptomRelationship to inspectMeaning
Endpoint exists; “no route to destination”endpoint → aors → aor → contactAOR reference or contact missing.
REGISTER rejectedregistration → outbound_authChallenge realm, username or policy differs.
Inbound request unmatchedidentify → endpointSource/matching method does not select endpoint.
401 repeats indefinitelyendpoint/registration → outbound_authAuthenticated retry absent or rejected.
Wrong context receives callidentify → endpoint → contextDifferent endpoint matched inbound traffic.
Endpoint Available; call 403INVITE policy beyond AOR qualifyOPTIONS reachability is not admission.

Rollback and security

PRODUCTION CAUTION

Back up the complete object set because restoring only the endpoint can leave mismatched references. After rollback, show each object and repeat an inbound and outbound controlled test. Keep auth files private, constrain identify matches, isolate inbound contexts and avoid publishing CLI output that contains internal addresses or user names.

WHAT THIS CONFIGURES

A coherent graph of PJSIP objects for two trunk models.

WHY IT EXISTS

Each object controls a distinct signaling responsibility.

EXPECTED STATE

Every reference resolves and the intended contact/match exists.

VERIFY WITH

Object-specific CLI commands and one correlated transaction.

IF IT FAILS

Trace the missing edge rather than recreating all objects.

ROLLBACK

Restore the complete reviewed object set.

SECURITY IMPACT

Auth and identify are trust controls; context limits dialplan exposure.

Related engineering resources

Safe object change sequence

When changing a trunk, model the desired object graph before editing: transport, endpoint, AOR/contact, authentication, optional registration and identify mapping. Validate object names and references in a staging file, back up every affected section, then introduce the smallest coherent set. Reloading an endpoint that references an absent AOR creates a predictable failure even though the endpoint itself appears in CLI output.

After change, prove outbound and inbound behavior separately. Outbound validation follows endpoint to AOR/contact and optional auth; inbound validation follows observed source or other identifier to endpoint and restricted context. Registration is a third transaction with its own auth relationship. Keeping these tests distinct prevents a Registered status from masking an inbound identify failure.

Expected state after object loading

The expected state is not merely “objects listed.” The selected endpoint must name the intended context, codecs, transport, AOR and outbound auth; the AOR must contain the correct static or registered contact; the registration must be Registered only when that model applies; and the identify object must map the observed authorized source to the same endpoint. Save a sanitized snapshot of those relationships before the call.

During the test, prove that the outbound INVITE uses the resolved contact and transport, and that an inbound request enters the restricted context through the expected identifier. If either direction selects a different object, return to matching and naming rather than changing media options. This expected-state record is the comparison point for rollback.

Authoritative references

Inputs you need from your peer

Peer input to configuration mapping
Peer-provided valueObject or parameter that consumes it
Registrar or static peer URIregistration server_uri or AOR contact
Outbound credentialsauth object
Trusted inbound source rangesidentify match
Contact/qualify policyAOR qualify settings
Channel and media policyendpoint object

Implementation closure

Inputs required

Peer URI/contact → AOR; outbound credentials → auth; registrar and retry policy → registration; trusted source ranges → identify; channel policy → endpoint.

Change surface

The relevant res_pjsip object sections and their references; dialplan and firewall are outside this object-model exercise unless explicitly tested.

Apply and reload semantics

Load the smallest coherent object set and inspect it with pjsip show commands. Reload only the affected module/configuration path supported by the installed Asterisk branch.

Healthy result

Every reference resolves, the AOR has the intended contact, registration state matches the chosen model, and inbound identification selects the intended endpoint.

Failure path

If an object exists but calls fail, follow the reference graph and observed source address instead of renaming or recreating unrelated objects.

Stop conditions

Stop when the installed option names differ from the guide, an identify range is broader than the peer allocation, or credentials cannot be protected.

Definition of done

Endpoint, AOR, auth, registration or static contact, identify, and verification output agree with the documented trunk model.

Last substantively reviewed: 2026-09-13