-----Original Message-----
From: [email protected]
[mailto:[email protected]] 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()
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users