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

aska aska22 at sina.com.tw
Sat Nov 6 16:44:04 CET 2004


Hi  everyone~

    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.........

If not, what it will be? How can I get my answer what I want to get ?

Looking for all of the documents, I still can't find the information about how to access databases with exec_msg function.
Hoping someone can give me some advises ^^.
Thannks in advance.


Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20041106/dc675d8b/attachment.htm>


More information about the sr-users mailing list