[Serusers] avp_check function Query

Vivek Bhat vigibi at yahoo.com
Wed Jul 19 01:26:02 CEST 2006


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 



More information about the sr-users mailing list