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

心瑜 g9234003 at pu.edu.tw
Tue Nov 23 11:40:48 CET 2004


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

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/20041123/4ec69736/attachment.htm>


More information about the sr-users mailing list