Hey everybody, I've been using mysql databases more and more. I've run across a couple of instances where I've either made a mistake on the ip address of the mysql database or for whatever reason, mysql wasn't running. In those instances, I've noted that the mysql command will hang indefinitely (I've counted to 40 before killing it). The offending line is: exten => s,1,MYSQL(Connect connid 192.168.103.15 mysqladmin 'xxxxxxxxx' did) Is there a way to specify a timeout for the mysql command? I'm not finding anything on Google, voip-info or the documents in the add-ons directory. Any help would be appreciated. Thanks, Doug
On 10/21/07, Doug Lytle wrote:> Hey everybody, > > I've been using mysql databases more and more. I've run across a couple > of instances where I've either made a mistake on the ip address of the > mysql database or for whatever reason, mysql wasn't running. In those > instances, I've noted that the mysql command will hang indefinitely > (I've counted to 40 before killing it). > > The offending line is: > > exten => s,1,MYSQL(Connect connid 192.168.103.15 mysqladmin 'xxxxxxxxx'did) there are a couple of things wrong with your MYSQL() call, you may be confusing the db server because mysqladmin the name of a mysql util, pick another username. no quotes around the password. Here are my statements, and they don't hang if mysql isn't running on the db server, the * console shows a connect failed error and continues : exten => s,n,Set(db_host=192.168.111.11) exten => s,n,MYSQL(Connect db_connid ${db_host} user pass dbname)> Is there a way to specify a timeout for the mysql command? > > I'm not finding anything on Google, voip-info or the documents in the > add-ons directory. Any help would be appreciated.more info here : http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+MYSQL -- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071021/8b8c75c2/attachment.htm
> I've been using mysql databases more and more. I've run > across a couple > of instances where I've either made a mistake on the ip > address of the > mysql database or for whatever reason, mysql wasn't > running. In those > instances, I've noted that the mysql command will hang > indefinitely > (I've counted to 40 before killing it). > > The offending line is: > > exten => s,1,MYSQL(Connect connid 192.168.103.15 > mysqladmin 'xxxxxxxxx' did) > > Is there a way to specify a timeout for the mysql > command? > > I'm not finding anything on Google, voip-info or the > documents in the > add-ons directory. Any help would be appreciated. >By experience, after every query sequence you should use MYSQL(Clear ${resultid}) otherwise they'll become 400. As it is said into app_addon_sql_mysql.c "Frees memory and datastructures associated with result set." Hope that helps, Benchev ----------------------------- ??? ADSL ????? - ??????????? ???????? ?????? ???? ?? 19.99 ??./???. ? ??????? ?? 2 ??????. ???? ?? 31 ????????, ?????? ??? ADSL ????? ? ??????? ????????? ?? 14 ???! ?? ?????? ??????????:www.btc.bg http://www.btc.bg/bg/new_btc_adsl_packs.php