Ramin,
avpops works pretty much everywhere.  Try starting ser in debugging mode. You will get output from the avpops module on what happens. It can be difficult to get all the options for the different functions correctly sometimes...
g-)
 
---- Original Message ----
From: Ramin Nikaeen
To: Serusers
Sent: Wednesday, July 13, 2005 10:40 PM
Subject: [Serusers] avpops in route[??] or failure_route[??]

> Valued Colleagues,
>
> Can anyone tell me of avpops can be used within routing and
> failure_route blocks?!
>
> If it can not be used, what can I use instead?
>
> My usr_preferences table in the database contains:
>
> mysql> select * from usr_preferences where uuid='6474383000' order by
> uuid, attribute;
> +------------+------------+--------------+--------------+-----------------------------+------+----------------+
>> uuid       | username   | domain       | attribute    | value      
>> | type | modified       |
> +------------+------------+--------------+--------------+-----------------------------+------+----------------+
>> 6474383000 | 6474383000 | goldline.net | findme1-ring | 20         
>> |    0 | 20050712155359 | 6474383000 | 6474383000 | goldline.net |
>> findme1-uri  | sip:4168491076@xxxxxxxx.xxx |    0 | 20050712155359 |
> +------------+------------+--------------+--------------+-----------------------------+------+----------------+
> I run the code attached at the bottom. Because the table is populated
> properly,
> it should print
>
> "---------ser.cfg - route[11]: inv_timeout: 20!”
>
> but it prints:
>
> "---------ser.cfg - route[11]: default inv_timeout: 20!"
>
> which indicates to me that avp_db_load is not working properly.
>
> Thanks
>
> ramin
>
> route[11]
> {
>                 if (avp_db_load("$ruri/username", "s:findme1-ring"))
>                 {
>                         log(3, "---------ser.cfg - route[11]::
> FindMe: s:findme1-ring read from database\n");
>                 };
>                                        else
>                 if (avp_check("s:findme1-ring", "eq/20/i"))
>                 {
>                         avp_write("i:20", "inv_timeout");
>                         log(3, "---------ser.cfg - route[11]:
> inv_timeout: 20!\n");
>                 }
>                 else
>                 {
>                         avp_write("i:20", "inv_timeout");
>                         log(3, "---------ser.cfg - route[11]: default
> inv_timeout: 20!\n");
>                 }
>
> }
>
>
>
> _______________________________________________
> Serusers mailing list
> serusers@lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers