[asterisk-users] mySQL connection testing

Danny Nicholas danny at debsinc.com
Thu Mar 3 10:50:01 CST 2011


-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Andrew Thomas
Sent: Thursday, March 03, 2011 10:38 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] mySQL connection testing

Gentlemen, can we please not turn this in to an Asterisk and DB commands
bashing thread?

All I want is a simple answer to a simple question - not a debate on
using AGI/AMI or any other methods.

Thanks for your co-operation.

Sorry for the comment/flames
This might do what you want (untested since I don't use MYSQL)
[context]
exten => _X.,1,MYSQL(Connect connid localhost user pass db)
exten => _X.,n,MYSQL(Query resultid ${connid} SELECT `something` FROM
`table` WHERE `number` = ${EXTEN})
exten => _X.,n,MYSQL(Fetch foundRow ${resultid} something)
exten => _X.,n,MYSQL(Clear ${resultid})
exten => _X.,n,Wait(10) ; just for fun
exten => _X.,n,MYSQL(Fetch foundRow ${resultid} something)
exten => _X.,n,Gotoif(${resultid} = 0?7:8)
exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,n,Hangup()




More information about the asterisk-users mailing list