This is your cue in the output:
check_avp: check <7267261005>against <UNAMEOFTO> as str
The s: prefix in your test is interpreted as a string.
You need to create an alias (modparam), then write into the alias and
then reference the alias "eq/$unameofto/gi"
g-)
Vivek Bhat wrote:
Hi,
I tried to call avp_write() and avp_check()
funtctions as below:
avp_write("$ruri/username", "s:UNAMEOFRURI");
avp_print();
avp_write("$to/username", "s:UNAMEOFTO");
avp_print();
if (avp_check("s:UNAMEOFRURI", "eq/s:UNAMEOFTO/gi")) {
log(1, "Usernames of RURI and TO are identical."); }
else {
log(1, "Usernames of RURI and TO are NOT
identical.");
}
------------------------------
However, when avp_check is called, always "esle" part
is executed even though "s:UNAMEOFRURI" and
"s:UNAMEOFTO" are identical. Why is it happening? I am
using SER 0.9.6 on Linux. Is it a bug in SER?
The debug output for the above is as below:
9(31343) DEBUG:avpops:print_avp: p=0xbd7340b8,
flags=3
9(31343) DEBUG:
name=<UNAMEOFRURI>
9(31343) DEBUG:
val_str=<7267261005>
9(31343) parse_headers: flags=4
9(31343) DEBUG:avpops:print_avp: p=0xbd7340f0,
flags=3
9(31343) DEBUG:
name=<UNAMEOFTO>
9(31343) DEBUG:
val_str=<7267261004>
9(31343) DEBUG:avpops:print_avp: p=0xbd7340b8,
flags=3
9(31343) DEBUG:
name=<UNAMEOFRURI>
9(31343) DEBUG:
val_str=<7267261005>^
9(31343) DEBUG:avpops:check_avp: check <7267261005>
against <UNAMEOFTO> as str
9(31343) DEBUG:avpops:check_avp: checked failed
----------------------------------------------------------
Note that while executing avp_check, it checks
7267261005 against UNAMEOFTO instead of "7267261004".
Why is that?
Thanks,
Vivek Bhat
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Serusers mailing list
Serusers(a)lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers