Unpair the extension number from the registration username. One account for many extensions

@BlazeStudios,
thank you. But HINT where is defined? Thank you so much!

\What they always mean in an Asterisk PJSIP dial string, namely the name of the type=endpoinit section in pjsip.conf,

Note that in the example configuration, LOGICNAME has been overloaded. As far as I can remember, there is no absolute requirement for the type=aor section to be called LOGICNAME (and there is no reason why the type=auth section cannot be called LOGICNAME. However, I haven’t seen examples where they differ and that does leave me with some uncertainties as to which is used to match INVITE, and which to match REGISTER. It is certain that there is no requirement that they be the same, as you can have multiple aor sections linked to a single endpoint.

LOGICNAME isn’t an extension, even when it is literally 2000 and nothing in pjsip.conf results in an Asterisk extension being called. The extension called is a combination of the context setting from PJSIP and the request URI received from the device.

Outbound, the device called is determined by the contact value stored in the type=aor section linked to the type=endpoint section, mentioned in the dial string. I’m not completely sure whether the contact is set based on the phone’s user name matching the type=endpoint, or the type=aor section, but I think it is the latter. I think incoming INVITE matching is based on the user name matching the type=endpoint name.

https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_HINT

I think the documentation, as unfortunately too common, is incomplete, and the full syntax is

HINT(extension[@context])

Thank you for all information!

Hi @david551,
Forgive me. Unfortunately, I do not understand.
The only way I managed, in the end, is to use pjsip_wizard.conf.
I have defined a user template, and from these, I have defined a certain number of users to whom I have associated credentials and a certain number of hint_exten. Obviously, this approach allows me to achieve the most essential goal, decoupling the registration username with the telephone extensions, ensuring greater security. In fact, not only the strong password but also strong username. This allows me to have a user (account) who can have multiple phone extensions. Each section defined in pjsip_wizard queries a context in extentions.conf in which the dialplan is defined. This eventually allows you to have a multi-tenant system where the same extensions can be present in different tenants. Excuse me, but I have not understood and followed your solution with pjsip. Thank you very much again. I hope to be able to understand your explanation, perhaps further investigating. But I think it’s my problem with understanding notions in general.
Thanks a lot

No, the documentation on how to create a static hint in the dialplan is correct. This isn’t the proper documentation for that. The Hint() function is for getting the devices associated with a Hint not for setting the Hint. You want to be looking at Extension State and Hints - Asterisk Project - Asterisk Project Wiki which tells you how to set hints in the dialplan. That document shows:

exten = <extension>,hint,<device state id>[& <more dev state id],<presence state id>

So that means if you want something like:

exten = 123,hint,PJSIP/123 ;; Setting a hint for a single PJSIP device

exten = 123,hint,PJSIP/123&Custom:DND123 ; Setting a hint for a PJSIP device and Custom Device DND123. Either one of those devices have a state change, the hint will be updated.

exten = 123,hint,PJSIP/123&PJSIP/456&PJSIP/789 ; Setting a hint for multiple PJSIP devices. Any of those devices have a state change the hint is updated.

That is up to you. The PJSIP wizard allows for you to assign dynamic hints for the endpoint. These hints will be generated automatically and dynamically in the dialplan based on the wizard config settings for it.

Outside of the PJSIP wizard all other hints for the various device techs (queue, confbridge, MWI or any other types you want a hint for) will have to be defined in the dialplan.

1 Like

Hi @BlazeStudios,
Thank you, you were very clear. I finally think I understand. I apologize if I did not fully understand your suggestions or the documentation.

You are very kind!

Hi @david551 and @BlazeStudios ,
I take up our discussion again. But first, let me thank you again!
In another post, David, with his “Joshua’s eyes” managed to correct a spelling error. So now I can post my pjsip_wizard configuration to expand the discussion, hoping it will be helpful to everyone.

[user-template](!)
type = wizard
accepts_registrations = yes
accepts_auth = yes
has_hint = yes
hint_context = dialwizard
hint_application = Dial(${HINT})
endpoint/context = dialwizard
aor/qualify_frequency = 15
aor/max_contacts =10
endpoint/allow = !all,ulaw,gsm,g722
endpoint/direct_media=no
;endpoint/disable_direct_media_on_nate=yes

[alice](user-template)
hint_exten=1000
inbound_auth/username=alice
inbound_auth/password=alicespassword
[alice](user-template)
hint_exten=1002

[bob](user-template)
hint_exten = 1001
inbound_auth/username = bob
inbound_auth/password = bobspassword
endpoint/rtp_symmetric=yes
endpoint/rewrite_contact=yes
endpoint/force_rport=yes

Well, barring my inaccuracies, we can say that we have defined some accounts: alice and bob, to which some telephone extensions have been associated. The phones register according to what is defined by the properties:

inbound_auth / username
inbound_auth / password

The question is: if I register those credentials, is there a way by calling another telephone extension making appear the caller id rather than another? In my scenario, the possibility of choice a caller id rather that a other depend by the “hints” defined.

I am asking myself questions to understand how possible it is to abstract the system. For example, I do not know how useful it is not being able to effectively discriminate on a call from an account with which telephone extension to introduce myself. Otherwise, I have to create many “accounts” in pjsip (one to one relationship, instead of one to many relationships), for example:
bob-pc
bob-mobile
bob-desk
etc…?

But in any case, in Asterisk is it possible to gather them at a concept of a user?
Perhaps, the concept of hint makes sense in one scenario where one extension, (for example 1000), can belong to more than one account (for example alice-mobile, alice-desk) ? But in this way, if I would like to check where alice is registered, it’s impossible since I should have to check every account.
Another thing that comes to mind: isn’t there a concept of a user who can then group these associated resources together? I’d like to have such a scenario: one user (alice) that could be registered from different devices simultaneously (more accounts? ).

I’m confused, user.conf also exists. Should I consider it as a shortcut to create sip configurations? However, it does not seem possible to have pjsip resources created.

Sorry for the countless questions and considerations.
Thank you very much.

Joshua referred to Joshua Colp (jcolp here) Joshua C. Colp, Author at Asterisk

1 Like

I think you are reading to much into “hint”.

With chan_pjsip you can have multiple devices register to the same address of record, and, using the PJSIP_DIAL_CONTACTS function you can construct a first parameter to Dial() which will allow you to ring them all at once.

Even without PJSIP, it was always possible to dial multiple devices, when an extension was called. That is one of the reasons making extension names and device names the same is confusing, as it suggests that there can only be one device per extension, which is not true.

I don’t know of anyone that uses user.conf. I think it might have been used by the, obsolete, Asterisk GUI, but people hand coding configurations generally don’t use it.

1 Like

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