[SR-Users] AVP obtain with regular expression

Anto potxoka at gmail.com
Tue Feb 14 23:28:53 CET 2012


Hello

I'm using AVP, but I can not finish assimilating the concept. I try to
input messages, according to their DID. Once it enters an INVITE
message treatment with alias_db for its user, but I want some AVP for
each DID.

I can think of three cases. The first I have no very clear if possible
and if it were, I think is not optimal.

1)

Given the configuration of the module:
modparam("avpops","avp_url","mysql://user:passwd@host/database")

Had thought if I can use regular expressions to get the "prs" in the
database (DID_IN, DID_DEST, etc).

USR_PREFERENCES table:

| id | uuid | username | domain  |       attribute       | type |
value | modified |
| 1 | XXX | user1        | dmn.tld  | 571XXX_IN       |  1     |  XXX
|               |
| 2 | XXX | user2        | dmn.tld  | 571XXX_DEST | 1      |  XXX  |
            |

2)

Maybe better to use the module configuration schemes:

modparam("avpops","db_scheme","scheme1:uuid_col=uid;value_col=job;value_type=string;table=emp")
modparam("avpops","db_scheme","scheme2:username_col=user;domain_col=domain;value_col=email;table=users")

3)

Or use avp_db_query() function.

Can anyone guide me? I'm pretty lost :-S. The first case, I know if
possible and possibly more difficult to maintain. Thanks very much.

Best regards
Anto



More information about the sr-users mailing list