Multiple passwords for one endpoint?

Using realtime (preferably) is it possible for a single endpoint to use more than one set of credentials? I want to use web sockets in a web application and I envision the following flow:

  1. User opens app
  2. User logs in with email/password, this is not linked to Asterisk at all. Think for example logging in with something like Auth0.
  3. After login, the app generates a temporary password for the current session, this password is used for the web socket login.

However said user may also be logged into a hardphone (multiple registrations) and I would not want to break the hardphone connection. That is why I am wondering if it is possible to have multiple credentials.

So far I tried to simply add a new row to ps_auths with the same username but different password, however after setting on core set debug 5 I see that the queries for authentication being produced are the following:

SELECT * FROM ps_auths WHERE id = ?

And ID is a primary key (unique) so it won’t work. I was hoping the query would search by username and tried all registries but apparently it does not.

So is there some other way I may be missing to accomplish this or something similar?

I’m not sure if there is any built-in way to do this in Asterisk, but if you are comfortable with adding patches to Asterisk, you could add another option to endpoints (e.g., “altpasswords” in a comma-separated list or something similar), parse it, and check it when something attempts to register. This can be extended to realtime as well.

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