Confused about AORs and endpoints

I’m trying to set up a bunch of grandstream phones. Right now, just two. Here’s the config:

;; ====== Templates ====

type = auth
auth_type = userpass
password = 0000

type = endpoint
context = grandstream
dtmf_mode = rfc4733
disallow = all
allow = ulaw
direct_media = no
;direct_media = yes
tos_audio = ef
tos_video = af41
cos_audio = 5
cos_video = 4
aors = grandstream

; ========= Common ==========

type = aor
max_contacts = 2

; ===== endpoints and auth ========

auth = 185

**** EDIT *** for some reason the inheritance is not displayed
*** should be 185 parens grandstream-endpoint parens

**** 185 parens grandstream-auth parens ***
username = 185

auth = 186


And I’m getting these errors:
res_pjsip_registrar.c:1016 find_registrar_aor: AOR ‘185’ not found for endpoint ‘185’
res_pjsip_registrar.c:1016 find_registrar_aor: AOR ‘186’ not found for endpoint ‘186’

The sip username for the grandstream phones is 185 and 186. I would expect that pjsip would look for AOR “grandstream”.

pjsip show endpoint 185

Endpoint: 185 Unavailable 0 of inf
InAuth: 185/185
Aor: grandstream 2

Why would it try to find AOR 185 ?

When the phones try to register, the match is the name of the endpoint, correct ?

The user portion is “eggowaffles”, so Asterisk attempts to look up an endpoint called “eggowaffles” in its configuration.

So here the user portion is 185, and there’s an endpoint 185. And the endpoint says use AOR grandstream.

How do I have this wrong ?

AORs are an actual SIP concept, and the AOR that is being registered to is actually part of the REGISTER process. The device itself is saying “I am reachable here, and I want this information on AOR X”. Generally this is the same as the user, so each phone is saying it wants to be on an AOR of the username. The aors option configures which AORs an endpoint is allowed to add itself to.

Slow down a little. This reminds me of when I tried to take a topology class. I’m way over my head.

“The AOR that is being registered to” is …what… 185, grandstream ?
“The device itself” = the grandstream phone ?
“each phone … wants to be on an AOR of the username” , Therefore I need an [185] and [186] AOR ?

My mistake was thinking the username registers with endpoint [name]. Actually username registers with AOR [name].

“the aors option configures which AORs an endpoint is allowed to add itself to” so I need a [grandstream] endpoint with option: “aors = 185,186”. And two AORs, [185] and [186] ?

So for N phones, I need N AORs ? Then I need 1 to N endpoints with the “aors” option “adding itself to” one or more of the AORs .

In other words, AOR is the real connection, Can AORs point to >1 connection ? Endpoints collect, or point to, AORs.

Am I getting warmer ?

chan_pjsip supports multiple contact addresses for one address of record. chan_sip does not.

If one had a pure SIP environment, the address of record, including the domain, would be the equivalent of your phone number. As very few people have such environments (see the free calls thread), only the user part of the address of record, which tends to be the same as the PSTN number or extension number, is significant. Asterisk is based on a non-SIP PBX and only, normally, uses the user part for matching, when it is the registrar.

I just started to use pjsip and I love it, I shared my working configuration with you


rewrite_contact=yes  ; necessary if endpoint does not know/register public ip:port
ice_support=yes   ;This is specific to clients that support NAT traversal

max_contacts= 2
qualify_frequency=1    ; Interval at which to qualify an AoR (default: "0")
maximum_expiration=7200        ; Maximum time to keep an AoR (default: "7200")
minimum_expiration=6000  ; Minimum keep alive time for an AoR (default: "60")
1 Like

The wiki[1] has information about the different sections and there are also wizards[2] to simplify configuration. Essentially, though, an endpoint is the configuration for a phone or device. An AOR is the information of how to contact them. An auth is for authentication. Each phone or device would normally have 1 endpoint, 1 AOR, and 1 auth. So for 5 phones you would have 5 of each.


1 Like