[asterisk-users] extension.conf with mysql

Doug Lytle support at drdos.info
Mon Jan 7 07:20:48 CST 2008


Gopal krishnan wrote:
> Hi,
>
>    I am trying to connect the outbound dialing with mysql with the 
> following code,
>
> exten => 88,1,MYSQL(Connect connid hostname username password dbname)
> exten => 88,2,GotoIf($["${connid}" = ""]?error,1)
> exten => 88,3,MYSQL(Query resultid ${connid} SELECT\ phone\ FROM\ 
> <tablename>\ WHERE\ phone =${a})

This is what I do:

exten => s,n,MYSQL(Connect connid 192.168.103.15 AsteriskQuery 
'somepass' Administration)
exten => s,n,GotoIf($["${MYSQL_STATUS}" = "-1"]?mysql_failed,s,1)
exten => s,n,MYSQL(Query resultid ${connid} SELECT name \, access \, 
password \, facility \, paging \, afterhours \, lockdown FROM Passwords 
WHERE password = ${get-admin-password})
exten => s,n,MYSQL(Fetch fetchid ${resultid} admin.name admin.access 
admin.password admin.facility admin.paging admin.afterhours admin.lockdown)
exten => s,n,MYSQL(Disconnect ${connid})
exten => s,n,MYSQL(Clear ${resultid})

Doug

-- 
 
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."





More information about the asterisk-users mailing list