Hi Andreas,

I guess you already use the uri_db module for checking with check_from() 
the mapping between the SIP id and auth id (against DB).

If so, for the inbound part, the natural way will be to use the same 
module (read : to extend the module) to allow you to retrieve the auth 
Id from the table based on the SIP uri ($ru is better than $tu):
    get_auth_id("$tu", "$avp(s:auth_user)","$avp(s:auth_realm)");

Regards,
Bogdan

Andreas Westermaier wrote:
> 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", "$...@$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
>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to