Reputation: 1640
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?
Upvotes: 0
Views: 1328
Reputation: 385
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.
Upvotes: 1
Reputation: 2864
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.
Upvotes: 0
Reputation: 1961
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.
Upvotes: 2