[Serusers] How to set the query into database and get answers with exec_msg?

邱磊 qiulei212 at 163.com
Thu Feb 26 08:49:22 CET 2009


Hi  ,I am a student studying in VoIP and implementing my theory in SER.
I try to access mysql database to get some information, but have a problem aboout paramaters of exe_msg.

    My goal is :count the number of contact addresses that certain user registered, and take 
this is my solution: 
exec_msg(' Count="select count(contact) from location where username=\"$SIP_HF_CONTACT\" "'
                   CountResult=`mysql -user -pheslo -e "$Count" ser`;
                 ')

What is the result of "CountResult" ?
I  suppose originally that it will be the the number of the query, but it seems not.........

and i try the exec_msg('rm -r test'); but it failed;
Dose the  function wored? and how to use it,Hhw can I get my answer what I want to get ?

Hoping someone can give me some advises ^^.
Thannks in advance.

2009-02-26 



邱磊 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20090226/a0af4e65/attachment.htm>


More information about the sr-users mailing list