as I have already announced on the users mailing list, I now want to introduce an implementation of the get_auth_id() function for the uri_db module. We especially require this function to enforce an inbound _and_ outbound channel limit for our customers, which have a single authentication id and password but multiple sip accounts (uri's).
A global outbound channel limit for multiple sip accounts of a single user can simply be implemented by adding a dialog profile to the auth-id and realm. But on incoming calls, e.g. from our PSTN gateways, only the r-uri can be accessed. The attached patch adds the get_auth_id() function to the uri_db module to do a reverse-lookup to get the authentication id and realm of a corresponding uri from uri or subscriber table. This way the count of the previously created dialog profile bound to auth-id and realm can be fetched to get the total amount of calls this customer has currently open (inbound and outbound).
The attached patch is against the current svn head and also includes the documentation part.