[Users] Using schemes with AVPops

Daniel-Constantin Mierla daniel at voice-system.ro
Tue Aug 16 14:04:26 CEST 2005


Hello,

On 08/16/05 01:31, Martin Kjeldsen wrote:

> Hi
>
> Thanks for the help. So far I'm still having some trouble getting the 
> info out of the DB via the load function. I'm trying to get the 
> username in tha alias table with these settings.
>
> modparam("avpops", "db_scheme", 
> "scheme0:uuid_col=contact;value_col=username;value_type=string;table=aliases") 
>
>
> avp_db_load("$from","s:pai/$scheme0");
>
> But not getting anything!!!
>
could you watch the log of mysql server (usually it is 
/var/log/mysql.log or /var/log/mysql/mysql.log) and see the SQL query 
for this case? That will help to understand what happens and what has to 
be corrected.

> And a second thought is how will I be able to push it into the header 
> as "P-Asserted-Identity", when the only accepts headers of Request or 
> Reply?

I am not sure that I get the question here, but you can add the value in 
the P-Asserted-Identity header to the request with 
avp_pushto("$P-Asserted-Identity","s:pai");

Daniel

>
> Thanks in advance
>
>
> Regards
> Martin
>
>
>
>
> Daniel-Constantin Mierla wrote:
>
>> Try:
>>
>> modparam("avpops", "db_scheme", "scheme0:uuid_col=contact; \
>>          value_col=username;value_type=string;table=aliases")
>> ...
>> avp_db_load("$uri_avp","s:pai/$scheme0");
>> avp_pushto("$P-Asserted-Identity","s:pai");
>>
>> Note that $uri_avp is an alias to the avp storing user's uri to match 
>> the contact column from the table aliases. As I suppose, it should be 
>> the From uri and in this case you can use directly $from as first 
>> parameter in avp_db_load(). You may have some problems if the UA adds 
>> parameters in From URI (it will not match the contact column) and in 
>> this case you have to use avp_subst() to get rid of them.
>>
>> An easier solution would be if you use the dbaliases table (alias_db 
>> module).
>>
>> Daniel
>>
>> On 08/12/05 21:39, Martin Kjeldsen wrote:
>>
>>> Hi
>>>
>>> I'm in need of some help using the schemes with AVPops!
>>>
>>> What I would like to do, is extract a value from the coloum:username 
>>> in table:aliases, matched by a specific user.
>>> First of all I'm uncertain of how to create such a scheme and match 
>>> it with a specific user, and second of all, can I push this in to 
>>> the header as a P-Asserted-Identity?
>>> And I'm not mistaken, when I under the impression thatI dont need to 
>>> create a AVP table for this, am I?
>>>
>>> Thank you in advance
>>>
>>>
>>> Kind regards
>>> Martin
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openser.org
>>> http://openser.org/cgi-bin/mailman/listinfo/users
>>>
>>
>
>




More information about the Users mailing list