[SR-Users] avp_db_query() question

侯旭光 marquis_hxg at 126.com
Tue Jan 18 12:07:40 CET 2011


Hello
avp_db_query(query[,dest]) can get a database query and store the results in the avps.
But what if the results returns many rows,and how can I get all the results? How to set the [dest] parameter ?
I've tried the method describered inhttp://www.kamailio.org/docs/avp_db_query.html,but it doesn't work.
like below
mysql<select mem_user from tgroup where grp_name='1234';
+----------+
| mem_user |
+----------+
| 1013     |
| 2013     |
+----------+
2 rows in set (0.00 sec)
kamailio.cfg
if(avp_db_query("select mem_user from tgroup where grp_name='1234'","$avp(name)"))
{
       xlog("L_INFO","query results[1] :$avp(name[1])\n");
       xlog("L_INFO","query results[2] :$avp(name[2])\n");
}
syslog
<INFO> query results[1] :<null>
<INFO> query results[2] :<null>
version: kamailio 3.0.2 MySQL 5.0
 
thank you very much!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110118/b8ada69c/attachment.htm>


More information about the sr-users mailing list