[OpenSIPS-Users] Retrieve callee auth username and realm

Andreas Westermaier andreas.westermaier at gmx.de
Tue Mar 10 12:45:13 CET 2009


Hi,

in one of our setups we want to have one authorization username per customer, which in turn got different sip accounts (user names). For each of its accounts the customer uses the same authorization user name and the same password, just the user name differs.

We want to enforce a inbound _and_ outbound channel limitations on a per customer basis, this means on the authorization user. A customer should just be able to receive/make two (the sum of incoming and outgoing) calls, where it doesn't matter which of its sip accounts the customer uses.

For outgoing channel limitation I currently achieve this by setting set_dialog_profile("xyz", "$au@$ar"), where I bind the profile to the auth user and realm. But for incoming calls, especially from our pstn gateway, I currently have only access to the "to-uri" and I'm not able to get the current amount of calls the callee currently has.

Is there a way to retrieve the corresponding auth-user and realm for a local callee from the "to-uri", already?

If not, where is the best place to start integrating this function? I thought of adding it to the uri_db module where the functions then could be called just like 

- get_uri_authuser("$tu", "$avp(s:tu_au)") and
- get_uri_authrealm("$tu", "$avp(s:tu_ar)")

Auth user/realm will be returned in the given avp and the function returns success or no success (if no local user fort he given to-uri exists).

Please tell me if there's already such a possibility so I can start implementing it if it's not. I think such functions are essential in enforcing channel limits which affect inbound and outbound channels at the same time for one user with multiple sip accounts.

Comments appreciated. :-)


Regards,
Andreas




More information about the Users mailing list