[SR-Users] Negative value returned when using sql_pvquery

Jonathan Hunter hunterj91 at hotmail.com
Tue Jan 5 16:38:58 CET 2016


Hi Guys,
Wonder if anyone has experienced this before, on kamailio 4.1.
I am using an sql_pvquery and it works fine, unless I pull a value from the database that is defined as 10 digits and starts with a 3, actually its populated as 03785702370 but due to the table it removes the leading 0 (bigint(20) unsigned).
Running a manual query in my database for a DestinationMsisdn I get;

select DestinationMsisdn,SourceMsisdn from MsisdnPoolAllocations where PoolMsisdn='+44162489xxxx';+-------------------+--------------+| DestinationMsisdn | SourceMsisdn |+-------------------+--------------+|        3785702370 | 4474526xxxxx |+-------------------+--------------+

However running in the kamailio.cfg an sql_pvquery to do the same query as below;
sql_pvquery("cd","select DestinationMsisdn,SourceMsisdn from MsisdnPoolAllocations where PoolMsisdn='$rU'","$var(MOdest),$var(NewSourceMSISDN)");
However this returns a value of -509264926 for $var(MOdest) which should just be the 3785702370  number.
What can cause kamailio to interpret this as a negative value? Has anyone seen this before?
Many thanks
Jon 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160105/0ee52d19/attachment.html>


More information about the sr-users mailing list