[Kamailio-Users] About 'avp_check' and strings formed with pseudo-variables

Iñaki Baz Castillo ibc at aliax.net
Sun Nov 9 00:41:57 CET 2008


Hi, I've stored in "usr_preferences" some entries with:
- attribute: 'bla'
- value: 'alice at domain.org'  <--- With no "sip:" in front.

I use 'avp_db_load' to get that value and compare using 'avp_check' with the 
To uri without protocol (without "sip:").

I get this behaviour by doing:

--------------------------
  if avp_db_load("$fu/uri", "$avp(s:bla)") {
    $var(To) = $tU + '@' + $td;
    if avp_check("$avp(s:bla)","eq/$var(To)/gi") {
      [...]
--------------------------

But I would like to avoid using a variable $var(To), something as:

--------------------------
  if avp_db_load("$fu/uri", "$avp(s:bla)") {
    if avp_check("$avp(s:bla)","eq/$tU + '@' + $td/gi") {
    # or:
    if avp_check("$avp(s:bla)","eq/$tU@$td/gi") {
      [...]
--------------------------

Unfortunatelly it doesn't work, it's not valid. Do I really need to use a 
variable (or AVP) for "avp_check"?

Thanks.






-- 
Iñaki Baz Castillo




More information about the Users mailing list