0
votes

I have a multi tenant FreeSWITCH setup and I am trying to retrieve the registrations belonging to a particular tenant.

  • I am aware of the mod command show registrations described here which returns all the current registrations on the FreeSWITCH.

  • I am also aware of sofia status profile <profile name> reg described here which shows registrations on a particular profile. This won't help either as the profiles on my FreeSWITCH are shared by multiple tenants.

Is there a way I can retrieve the data through event socket for a specified tenant?

3

3 Answers

1
votes

you can execute show registrations via ESL and retrieve its output. The second field is realm, which is basically the name of the tenant. So, you would get all the registrations, and later you can filter by realm name. Also in theory, you can get direct access to the registation SQL database and run the queries directly in it.

1
votes

I have done something similar to this.

  • first get all the registration of profile using following command:

    "api sofia status profile internal reg" using event socket

  • after this based on your need convert data into json and search based on realm and print the result.

0
votes

Please refer sofia_presence_data list|status|rpid|user_agent [profile/]<user>@domain cmd.

Even if this doesn't work. You need to get register and unregister events from ESL and save it to common DB and retrieve the user data, which i think a much simpler way.