Re: [SR-Users] avp_db_query() question
please keep the mailing list cc-ed all the time. Thanks, Daniel On 1/20/11 1:49 PM, ?? wrote: many thanks I've fixed the problem. http://problem.Your Using $(avp(s:name)) instead of $avp(s:name) Your http://problem.your/ solution is OK too. At 2011-01-20 18:10:40??Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, maybe is better to use sqlops module, it more suitable for queries with many records in result. http://kamailio.org/docs/modules/stable/modules_k/sqlops.html Cheers, Daniel On 1/19/11 2:58 PM, Klaus Darilion wrote: looks fine. try to increase debug level - then you should see the query and the results in syslog regards klaus Am 18.01.2011 12:07, schrieb ??: 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 in http://www.kamailio.org/docs/avp_db_query.html,but it doesn't work.| |like below| |mysqlselect 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!| ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla Kamailio (OpenSER) Advanced Training Jan 24-26, 2011, Irvine, CA, USA http://www.asipto.com -- Daniel-Constantin Mierla Kamailio (OpenSER) Advanced Training Jan 24-26, 2011, Irvine, CA, USA http://www.asipto.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] avp_db_query() question
Hello, maybe is better to use sqlops module, it more suitable for queries with many records in result. http://kamailio.org/docs/modules/stable/modules_k/sqlops.html Cheers, Daniel On 1/19/11 2:58 PM, Klaus Darilion wrote: looks fine. try to increase debug level - then you should see the query and the results in syslog regards klaus Am 18.01.2011 12:07, schrieb ??: 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 in http://www.kamailio.org/docs/avp_db_query.html,but it doesn't work.| |like below| |mysqlselect 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!| ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla Kamailio (OpenSER) Advanced Training Jan 24-26, 2011, Irvine, CA, USA http://www.asipto.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] avp_db_query() question
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 mysqlselect 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!___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] avp_db_query() question
looks fine. try to increase debug level - then you should see the query and the results in syslog regards klaus Am 18.01.2011 12:07, schrieb ??: 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 in http://www.kamailio.org/docs/avp_db_query.html,but it doesn't work.| |like below| |mysqlselect 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!| ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users