[SR-Users] Unexpected evaluation to false on a phonenumber in $avp

Daniel Tryba daniel at pocos.nl
Mon Jan 5 16:19:51 CET 2015


Not a really important question, just an observation that caused some 
headscratching on my first day after a nice vacation.

I'm using an avp to make a redirect decision. Normally this avp contains Dutch 
telephone numbers (+31[0-9]{7,10}). With a simple:
if($avp(dst_redirectnumber))
{
	#change $ru
}
this works flawless (normally).

But a client decided, to forward to a Swiss number (+4141743xxxx) but with 
this number the if condition results in a false. A German number just works 
fine (+49)

The avp is stuffed in an avp_db_query loop with $avp($avp(i:1))=$avp(i:2) as 
key/value pair from the table.

I changed above condition to check if the string length of dst_redirectnumber 
is larger than 0. But I'm at a loss why the false occurs, first guess was an 
octal conversion (number only contains the digits 0-7) which results in a 
number "just" above 2^32. But changing a digit to 8 still fails.

-- 

POCOS B.V. - Croy 9c - 5653 LC Eindhoven
Telefoon: 040 293 8661 - Fax: 040 293 8658
http://www.pocos.nl/   - http://www.sipo.nl/
K.v.K. Eindhoven 17097024



More information about the sr-users mailing list